Jun 22 12:11:58 Hi rikkus :) Jun 22 12:12:16 What's up? Jun 22 12:12:57 Tsela: writing cross-platform user settings handling class. Works on Windows with registry, almost done for UNIX rc files, now wondering what MacOS uses... Jun 22 12:14:18 rikkus: MacOS X is based on BSD, so I' d suppose they use something similar to what BSD uses... Jun 22 12:14:41 which would be rc files... Jun 22 12:14:51 but I'm guessing they use something a bit more modern Jun 22 12:15:44 rikkus: I wouldn't know what would be more modern (rc files in XML? :P ) Jun 22 12:15:51 --> hynek (hynek@pD9570BA9.dip.t-dialin.net) has joined #ruby-lang Jun 22 12:15:58 joking aside, yes :) Jun 22 12:16:15 KDE stuck with rc files (well, more like Windows .ini files) Jun 22 12:16:30 the only reason being that they're easy to read/edit for 'normal' users. Jun 22 12:16:43 if that reason wasn't given such weight, they would have been xml Jun 22 12:17:46 <-- webfiend has quit ("Leaving") Jun 22 12:18:12 rikkus: Gnome uses XML. Personally, I think XML is already overused (and oververbose in many places), so I don't mind if it's not used in this case :) . Jun 22 12:18:38 http://xmlsucks.org/ Jun 22 12:18:43 Now XML has its uses, but people seem to want to apply it to everything under the sun :P Jun 22 12:19:19 well, for small (they invariably are) configuration files, I think it's ideal Jun 22 12:20:37 rikkus: I think that for small files, XML usually complicates and lengthens them needlessly :) . And you rarely need the structure they bring :) Jun 22 12:20:53 xml is overly verbose. it can't be ideal for "small configuration files" Jun 22 12:21:30 Important things: 1. It's easy to parse, because you just tell your XML parser to read it. 2. You can't put data into it in the wrong format, because the XML parser will make sure everything is 'quoted' correctly. Jun 22 12:21:52 Also, KDE already has an XML parser, so it's no extra code (Qt has a couple inbuilt) Jun 22 12:22:30 XML is also still human readable, and easy to mess around with (for techies at least), so it's possible to edit config files with vi. Jun 22 12:23:11 and also, most config files are 0-2k, which means they fit within a filesystem block anyway, so size arguments aren't that useful Jun 22 12:24:02 --> ThreeDayMonk (~ThreeDayM@79.133-200-80.adsl.skynet.be) has joined #ruby-lang Jun 22 12:27:16 rikkus: Well, I don't think XML is that easily readable, and it's really *far* too verbose. They could have easily gone with the very same idea, but implemented using a TeX-like syntax. It would have been just as readable, just as parsable (without having to write tools from scratch) and far more powerful. And it would have been more concise :) . Jun 22 12:27:49 But I guess it's too late now :( Jun 22 12:28:56 Tsela: that would have been nice for HTML, too Jun 22 12:31:18 ThreeDayMonk: Yep. I would have liked that :) . I often think that a quick simple TeX interpreter engine with limited capacities would have made a great browser :) . Jun 22 12:34:36 http://xmlsucks.org/but_you_have_to_use_it_anyway/useful-xml.html . Something based on TeX would answer most of the complains. Jun 22 12:35:25 But XML is already widely accepted, so I guess it's no use fighting anymore :P Jun 22 12:36:54 Tsela: s/accepted/pushed/ XML is the Windows of the fileformats. Jun 22 12:38:51 personally, I'd have liked something like this: book{ title{Metamorphosis, The} author{Kafka, Franz} } Jun 22 12:39:08 same thing in a fraction of the space Jun 22 12:39:30 rikkus: http://forums.macosxhints.com/showpost.php?p=114558&postcount=11 . A good starting point about how MacOS X handles global/user settings (apparently through a database). Jun 22 12:39:37 ThreeDayMonk: attributes? Jun 22 12:39:58 lypanov: they suck Jun 22 12:40:07 * lypanov gives ThreeDayMonk a gold star Jun 22 12:40:13 xml is seriously flawed Jun 22 12:40:27 if you really need them, book(type="novel"){ ... } Jun 22 12:40:29 as it has two entry points for any given piece of data Jun 22 12:40:43 more even than that Jun 22 12:40:44 ThreeDayMonk: That's exactly the kind of syntax I'd have liked :) Jun 22 12:40:50 you should *never* need (type=) Jun 22 12:40:59 I agree Jun 22 12:41:04 attributes if they did exist should be strongly typed Jun 22 12:41:14 book.novel{} would be an idea Jun 22 12:41:24 hynek: yeah, subclassable Jun 22 12:41:29 aye Jun 22 12:41:35 Nice idea. Jun 22 12:41:50 what say we make another markup language? ;-) Jun 22 12:42:03 ThreeDayMonk: I'm in! :) Jun 22 12:42:08 rlml (ruby-lang markup language) Jun 22 12:42:24 making the Linux between the markups? ;) Jun 22 12:42:48 hynek: Hehe :) Jun 22 12:42:56 rlml sounds neat Jun 22 12:43:22 * ThreeDayMonk starts writing a spec and parser Jun 22 12:43:30 * lypanov wonders what he could use it for Jun 22 12:43:37 nice pun: real life markup language ;) Jun 22 12:43:44 hynek: :P Jun 22 12:43:45 hynek: oooh I like that! Jun 22 12:44:36 * rikkus still doesn't see what's wrong with xml Jun 22 12:44:56 --> jesse99 (~Snak@dialup-4.242.33.221.Dial1.Seattle1.Level3.net) has joined #ruby-lang Jun 22 12:45:17 rikkus: having to close with the tag name Jun 22 12:45:29 rikkus: <> ain't easy to type Jun 22 12:45:32 why is that a problem? Jun 22 12:45:35 rikkus: attributes suck ass Jun 22 12:45:42 rikkus: xml is usually badly designed due to that Jun 22 12:45:43 XML isn't meant to be typed, it's meant to be written by code Jun 22 12:45:45 <-- jesse98 has quit (Read error: 60 (Operation timed out)) Jun 22 12:45:51 there was a nice thread in the german usenet with the title "Warum XML scheisse ist". Jun 22 12:46:03 rikkus: it's supposed to be human-parsable too Jun 22 12:46:04 hehe, I can translate that title :) Jun 22 12:46:12 ThreeDayMonk: It is. I can read it fine. Jun 22 12:46:24 in fact, a great deal of my day is often spent reading XML Jun 22 12:46:39 but it whould be possible to write it too Jun 22 12:46:43 should Jun 22 12:46:48 I do that, too Jun 22 12:46:59 generally, I use code to write it Jun 22 12:47:27 then you must be aware that it isn't very easy to manipulate by hand, and that is a total waste of time, money, and effort Jun 22 12:47:34 rikkus: this is a contradiction. it's sick verbosity is constitued by human readability Jun 22 12:48:04 I don't know about a total waste of time, money and effort. I never noticed that it was a problem to write . I often copy+paste the opening tag and add / Jun 22 12:48:08 i heard that the rfc was xmlfied and the signal/noise-ratio got 1/3 Jun 22 12:48:38 --> cow_2001 (~N@bzq-82-80-180-86.red.bezeqint.net) has joined #ruby-lang Jun 22 12:48:41 rikkus: Believe me, it's a problem. Jun 22 12:49:07 * lypanov notes down a feature request for ruvi Jun 22 12:49:11 keybinding to close current tag Jun 22 12:49:31 lypanov: don't forget: "support rlml" ;) Jun 22 12:49:41 hynek: of course :P Jun 22 12:49:45 A good markup language should be easy to write with more and no copy/paste :) Jun 22 12:49:45 actually Jun 22 12:49:48 OK - ideas for typing? Jun 22 12:50:20 how's gonna write me a test file? Jun 22 12:50:33 if you do it before i leave today i'll add syntax highlighing for it to ruvi :) Jun 22 12:50:47 by what time? Jun 22 12:51:07 5 hours from now :P Jun 22 12:51:14 OK Jun 22 12:51:54 blah.rlml? Jun 22 12:52:04 * lypanov guesses so Jun 22 12:52:07 Hehe :) Jun 22 12:52:10 ThreeDayMonk: will u have a header or? Jun 22 12:52:16 yeah, I think so Jun 22 12:52:21 rlml{ Jun 22 12:52:23 blah Jun 22 12:52:23 } Jun 22 12:52:26 Yeah, let's make it easy to parse Jun 22 12:52:33 outer element? Jun 22 12:52:36 (another flaw of xml) Jun 22 12:52:41 * lypanov doesn't believe in outer elements Jun 22 12:52:43 but maybe no need for an element Jun 22 12:52:45 me neither Jun 22 12:52:50 nice nice Jun 22 12:53:24 i think i'll make it really funky Jun 22 12:53:25 I'm allowing # for comment lines Jun 22 12:53:27 book.novel{} is an outer element nevertheless :) Jun 22 12:53:31 different color per element Jun 22 12:53:41 hynek: you can have several Jun 22 12:53:43 ThreeDayMonk: (* *) pascal style? :) Jun 22 12:54:01 or just # across multi lines? Jun 22 12:54:07 hmm... Jun 22 12:54:07 i.e, repeated Jun 22 12:54:15 I was thinking repeated Jun 22 12:54:28 What about comment{}? Jun 22 12:54:31 it's a good visual cue Jun 22 12:54:40 i'd vote for #{} for comments...line-orientation sucks Jun 22 12:54:40 Tsela: namespace abduction Jun 22 12:54:47 Tsela: and what about } inside... Jun 22 12:54:51 * ThreeDayMonk supports hynek Jun 22 12:54:53 lypanov: True... Jun 22 12:54:54 lypanov: \{ Jun 22 12:55:03 ThreeDayMonk: its a comment u shouldn't need to escape... Jun 22 12:55:13 hynek: nod Jun 22 12:55:21 hynek: i was going to suggest. but wasn't sure Jun 22 12:55:23 I hope this markup language is going to be readable on every platform in the world, handles any encoding nicely, can be transformed easily, and can be validated according to a set of rules passed to a validation tool :P Jun 22 12:55:29 I meant \} inside any tag Jun 22 12:55:43 ThreeDayMonk: ah right. i meant for the comment{ } case Jun 22 12:55:51 rikkus: How do you think XML began? Jun 22 12:55:54 i like #{} and # Jun 22 12:56:01 Tsela: as HTML Jun 22 12:56:06 rikkus: you're just jealous not being a part of the revolution! ;) Jun 22 12:56:07 * lypanov isn't sure that just one is good... Jun 22 12:56:41 Is it really a good idea to make a whole new markup language when you could just hack your XML parser to accept as end-of-current-open-element? :) Jun 22 12:56:44 rikkus: I meant that originally, it wasn't readable on every platform in the world. It grew. Jun 22 12:56:45 ThreeDayMonk: naming conventions, any utf8 apart from }? Jun 22 12:57:01 ThreeDayMonk: is the . standardized or usage? Jun 22 12:57:12 well } and \s Jun 22 12:57:16 and { Jun 22 12:57:23 I'm not sure about naminng - there's ambiguity with e.g. cyrillic c and roman c Jun 22 12:57:31 rikkus: End tags are not the only problem of XML. Moreover, what you're talking about would never be accepted in the standard and is thus useless. Jun 22 12:57:35 ThreeDayMonk: ouch yer true Jun 22 12:57:41 --> ak|ra (~t1dfe7e@pD9E4701D.dip.t-dialin.net) has joined #ruby-lang Jun 22 12:57:51 but then... just latin would suck Jun 22 12:57:54 hi Jun 22 12:58:04 Tsela: I think you're more likely to get accepted in the XML standard than some-new-markup-language accepted by all the XML users Jun 22 12:58:22 lypanov: but ascii can be written by anyone Jun 22 12:58:25 whats the best way to format a string on output so its x-wide and wraps the words ok ? Jun 22 12:58:26 ThreeDayMonk: true Jun 22 12:59:03 rikkus: Somehow I'm not sure about that :P Jun 22 12:59:14 I personally would prefer just [A-Xa-z0-9_] for identifiers Jun 22 12:59:21 Z not X Jun 22 12:59:29 ak|ra: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/10625 Jun 22 12:59:40 ruby -e 'puts $<.read.gsub(/\n/, " ").gsub(/.{1,65}(?:\s|\Z)/){$&+"\n"}' foo Jun 22 12:59:51 xml is really crappy as a data storage format Jun 22 13:00:04 now, regarding book.novel ... Jun 22 13:00:16 lypanov: thanx Jun 22 13:00:20 is it needed and desirable? Jun 22 13:00:43 i'd say leave it Jun 22 13:00:46 but allow .'s in names Jun 22 13:00:54 and then specify this in a new specification later on Jun 22 13:00:58 leave this one ultra simple Jun 22 13:00:59 lypanov: yeah, seems best Jun 22 13:00:59 and validation only make sure that the syntax of the language implemented over xml is valid, which is what any language implementation should do anyway Jun 22 13:01:45 OK... what about whitespace? Jun 22 13:01:52 * lypanov was waiting for that :) Jun 22 13:01:55 my suggestion is to trim leading and trailing whitespace Jun 22 13:02:05 i'd say its up to the application... Jun 22 13:02:18 but you can have Jun 22 13:02:21 title { Jun 22 13:02:23 blah { Jun 22 13:02:26 bibble Jun 22 13:02:28 } Jun 22 13:02:40 or blah {bibble} Jun 22 13:02:42 * lypanov isn't sure Jun 22 13:02:48 they should be equivalent, I think Jun 22 13:02:58 however, we need to allow whitespace sometimes Jun 22 13:03:06 blah{bibble Jun 22 13:03:10 bibble Jun 22 13:03:11 } Jun 22 13:03:21 ki \e Jun 22 13:03:32 --> prof (~opera@14.15.233.220.exetel.com.au) has joined #ruby-lang Jun 22 13:03:38 lypanov: what if it's only one line with ws? Jun 22 13:03:57 i think it should be up to app Jun 22 13:04:07 but helper functions should be mandatory in lib impl Jun 22 13:04:17 example? Jun 22 13:04:31 datastore.blah :trimmed Jun 22 13:04:37 -> "bibble" Jun 22 13:04:58 :simplify_whitespace Jun 22 13:05:10 lypanov: perfect, thanx Jun 22 13:05:11 :leave_intact Jun 22 13:05:12 or something Jun 22 13:05:15 ak|ra: np :) Jun 22 13:05:20 <-- prof (~opera@14.15.233.220.exetel.com.au) has left #ruby-lang Jun 22 13:05:29 akira! tetsuo! Jun 22 13:05:37 sorry, couldn't help it ;-) Jun 22 13:05:38 kurosaw Jun 22 13:05:39 a Jun 22 13:05:51 hehe Jun 22 13:06:03 * ThreeDayMonk likes kurosawa Jun 22 13:07:03 for comments, I have a suggestion Jun 22 13:07:15 #{ starts a comment, and only } on a line alone can close it Jun 22 13:07:26 oh, wait... that won't work Jun 22 13:07:41 #{ through }# ? Jun 22 13:07:52 class String Jun 22 13:07:53 def block(width=80) Jun 22 13:07:53 gsub(/\n/, " ").gsub(/.{1,#{width}}(?:\s|\Z)/){$&+"\n"} Jun 22 13:07:53 end Jun 22 13:07:53 end Jun 22 13:07:54 (* *) ? :P Jun 22 13:07:58 ak|ra: :) Jun 22 13:08:02 isnt this sexy .. i love this language :) Jun 22 13:08:07 ruby rules :) Jun 22 13:08:07 cyall Jun 22 13:08:10 cya ak|ra Jun 22 13:08:13 <-- ak|ra (~t1dfe7e@pD9E4701D.dip.t-dialin.net) has left #ruby-lang (""use fluxbox" :)") Jun 22 13:08:58 ThreeDayMonk: that's a closing-tag, you see that? ;) Jun 22 13:09:18 (: :) Jun 22 13:09:28 smiley comments Jun 22 13:09:33 :P Jun 22 13:09:58 we could allow Pascal (* *) and C /* */ and C++ // and shell # comments all at the same time, to allow nesting... Jun 22 13:10:13 (* *)'s can be nested anyway Jun 22 13:10:19 /* otoh can't Jun 22 13:10:22 because that sucks Jun 22 13:10:30 can they? OK, then (* *) gets my vote Jun 22 13:10:38 afair Jun 22 13:10:52 we can specify nesting is allowed Jun 22 13:10:58 one line comments with #? Jun 22 13:11:08 yup Jun 22 13:11:38 ThreeDayMonk: http://www.tmt.com/helphtml/prog_comm.htm Jun 22 13:12:04 : in Standard Pascal comments do not nest. : Jun 22 13:12:08 okay i take it back :) Jun 22 13:12:12 how about this: a tag that contains tags may not contain naked data? Jun 22 13:13:01 still. some compilers allow it in pascal Jun 22 13:13:06 and non support /* nesting Jun 22 13:13:20 ThreeDayMonk: ummm Jun 22 13:13:29 i would like to say yes Jun 22 13:13:38 but it complexifies some stuff horrendougly... Jun 22 13:13:42 lol Jun 22 13:13:45 horrendously Jun 22 13:13:48 yes, it does, doesn't it Jun 22 13:14:08 but then, how do we distinguish naked text from a tag name? Jun 22 13:14:16 tagnames aren't allowed spaces Jun 22 13:14:26 tagname\s+{} Jun 22 13:14:36 so a single word that is followed by { Jun 22 13:14:36 until the {'s are quoted. should always match Jun 22 13:14:36 OK Jun 22 13:14:45 erm Jun 22 13:14:45 \s* Jun 22 13:15:03 over multiline Jun 22 13:15:17 text{blah blah blah{bibble}} Jun 22 13:15:17 -> Jun 22 13:15:26 blah Jun 22 13:15:27 { Jun 22 13:15:28 } Jun 22 13:15:29 ? Jun 22 13:15:42 some people do prefer that... Jun 22 13:15:42 huh? Jun 22 13:15:47 wibble blah Jun 22 13:15:49 { Jun 22 13:15:52 oy, yeah, that's what I meant Jun 22 13:15:54 wibble{blah} Jun 22 13:15:55 } Jun 22 13:15:55 * rikkus prefers that Jun 22 13:15:56 ah. okay Jun 22 13:16:06 need both then Jun 22 13:16:14 \s/m Jun 22 13:16:16 don't pander to me. I'm using XML :P Jun 22 13:16:23 rikkus: :P Jun 22 13:16:36 Jun 22 13:16:59 wibble{blah{}} Jun 22 13:17:12 we rule Jun 22 13:17:15 yup Jun 22 13:17:30 and unlike xml its not inconstant with itself Jun 22 13:17:41 Jun 22 13:18:08 wibble{size{4} blah{}} Jun 22 13:18:08 * lypanov ponders Jun 22 13:18:21 rikkus: good point Jun 22 13:18:32 oop, misread it Jun 22 13:18:33 isn't that 4 ? Jun 22 13:19:02 yeah - but we decided to disallow attributes iircf Jun 22 13:19:05 blahibble Jun 22 13:19:05 -f Jun 22 13:19:21 wibble{size{4}blah ibble{}} Jun 22 13:19:28 umm Jun 22 13:19:39 wibble{ size{4} blah ibble{} } Jun 22 13:19:46 not too bad actually Jun 22 13:19:55 no - wibble{size{4} blah{ibble} blah}, right? Jun 22 13:20:08 apart from the fact i was wrong Jun 22 13:20:10 hehe Jun 22 13:20:11 ThreeDayMonk: right Jun 22 13:20:18 erm Jun 22 13:20:25 order ing of data is not guaranteed Jun 22 13:20:30 wibble{size{4} blah blah{ibble}} Jun 22 13:20:32 owh Jun 22 13:20:37 * batsman sees something about a new markup lang Jun 22 13:20:38 must be Jun 22 13:20:40 is this serious? Jun 22 13:20:46 ThreeDayMonk: it has to be... Jun 22 13:20:48 batsman: yeah Jun 22 13:20:54 goals? Jun 22 13:20:56 ThreeDayMonk: otherwise you should disallow inner text Jun 22 13:21:19 I'm not sure what is an attribute and what is an element there Jun 22 13:21:20 ThreeDayMonk: as otherwise "blah { my text img{myimagefilename} my second piece of text}" is pointless Jun 22 13:21:26 rikkus: no attributes Jun 22 13:21:28 batsman: goal is to suck less than XML ;-) Jun 22 13:21:34 ok Jun 22 13:21:44 OK, ordering is preserved Jun 22 13:21:48 yay Jun 22 13:22:17 ThreeDayMonk: that's fairly easy. But do you want it for RPC/serialization or as a doc. format, etc? Jun 22 13:22:20 Jun 22 13:22:23 beat that then :P Jun 22 13:22:47 _blah { my text _img{myimaginefielname} (* a comment!!!! *) my second piece of text } Jun 22 13:22:52 employee{name{Rik Hemsley} nickname{rikkus biggus dikkus} age{28}} Jun 22 13:22:54 * lypanov ponders Jun 22 13:23:07 * lypanov notes that ThreeDayMonk's is cuter Jun 22 13:23:11 still shorter than xml Jun 22 13:23:29 ThreeDayMonk: Looks good :) Jun 22 13:23:35 ThreeDayMonk: attribute names and tags are in same namespace Jun 22 13:23:41 ThreeDayMonk: this means that . is a must... Jun 22 13:23:46 ThreeDayMonk: but then what's the difference between the types of age and 28? They both look like elements to me... how do I know that 28 is an 'attribute' ? Because it doesn't have {} after it? Jun 22 13:24:07 rikkus: there are no attributes Jun 22 13:24:12 rikkus: everything is a tag Jun 22 13:24:16 ok... Jun 22 13:24:16 ThreeDayMonk: are you planning to make it w/ executable Ruby code? It'd be fairly easy to make it self-validating then. Jun 22 13:24:36 batsman: juts brainstorming the spec now Jun 22 13:25:01 * ThreeDayMonk creates #rlml Jun 22 13:25:13 * lypanov joins Jun 22 13:25:43 * lypanov pokes everyone Jun 22 13:26:03 --> dynek (~dynek@3ffe:bc0:e40:0:280:adff:fe79:f890) has joined #ruby-lang Jun 22 13:26:10 batsman: executable ruby code? Jun 22 13:26:25 self validation is maybe needed... Jun 22 13:26:26 <-- trinitacs has quit ("Leaving") Jun 22 13:26:26 * lypanov wonders Jun 22 13:27:10 lypanov: if the syntax is like the stuff above, that can be parsed by Ruby Jun 22 13:27:25 yup Jun 22 13:27:25 lypanov: and with some meta-programming, it will self-validate Jun 22 13:27:30 ah Jun 22 13:27:31 yup Jun 22 13:27:55 * lypanov gives batsman a shove up the #rlml stairs Jun 22 13:28:51 is this for data transmision or storage? Jun 22 13:29:08 everytyyttthhingnggg Jun 22 13:29:15 writable markup Jun 22 13:29:27 well, if it is for storage, then i'd like to reference an element from another element Jun 22 13:29:36 otherwise, it's just a trimmed down xml Jun 22 13:30:34 myobject{id{18}}myobject{id{19}}myarray{ref{18} ref{19}} Jun 22 13:30:45 ah, explicit id ala xml sucks Jun 22 13:30:54 its not explicity Jun 22 13:30:58 application dependant Jun 22 13:31:08 join #rlml :) Jun 22 13:31:37 batsman: I'm devil's advocate. I think XML iz dah b0mb Jun 22 13:31:46 batsman: I'll go back and abuse them after lunch Jun 22 13:32:11 lol