Live data from Hacker News

TOML, Tom's Own Markup Language

github.com

41–50 of 173 posts

Re: TOML, Tom's Own Markup Language

#41

I'll be the first to ask: whats wrong with JSON?

Like JS from which it sprang, it lacks an integer type. Fortunately, parsers written for languages that do have integers can usually parse them correctly.

(If you don't know why this might matter, try opening your browser's Javascript console and evaluating 10000000000000001)

That's my peeve, though. I suspect that Tom is probably more concerned with readability. TOML also looks like it can be parsed a line at a time and doesn't really need to do any recursive parsing, so you could probably parse a stream of it as it arrives, which I imagine is trickier with JSON.

Re: TOML, Tom's Own Markup Language

#45
post #33

Because we need a decent human readable format that maps to a hash and the YAML spec is like 600 pages long and gives me rage. No, JSON doesn't count. You know why. I do not know why, And would love if one can explain me? Other than comments, I see not difference between both. Also, that human readable is not an accurate, as it should be hacker readable, you know, IT folks are the only target audience of those files.…

In JSON that datetime won't deserialize to a datetime instance in your language in a conforming parser. Further JSON has no comments (this is a killer for a configuration format).

There are ways to fake comments by using extra fields:

{ "what i want": "what i really really want", "ಠ_ಠ":"Ignore the eyes" }

Re: TOML, Tom's Own Markup Language

#46
post #15

Would this be considered legal? [ [1,2], ["a", "b"] ]

It's unspecified, I guess, but if you want to read into the spirit of it, which is to make it trivially-supportable by type-nazi languages such as haskell, you either get a [[Int]] or a [[String]].

Re: TOML, Tom's Own Markup Language

#47
post #33

Because we need a decent human readable format that maps to a hash and the YAML spec is like 600 pages long and gives me rage. No, JSON doesn't count. You know why. I do not know why, And would love if one can explain me? Other than comments, I see not difference between both. Also, that human readable is not an accurate, as it should be hacker readable, you know, IT folks are the only target audience of those files.…

In the authors own words[1]: { 'because': { '80': 'percent' }, {'of': 'JSON', 'is': 'brackets' } } [1] https://github.com/mojombo/toml/issues/2#issuecomment-140029...

That's actually not valid JSON -- should use double quotes

{ "because": { "80": "percent" }, {"of": "JSON", "is": "brackets" } }

Re: TOML, Tom's Own Markup Language

#49
post #43

I'll be the first to ask: whats wrong with JSON?

I use it liberally, but the only thing that I find wrong with json is the [\u2028\u2029] issue: {"The invisible character":"really messes with javascript "} Copy the text and paste it in console.

Nitpick: that's an issue with JavaScript, not JSON.

Re: TOML, Tom's Own Markup Language

#50
I've always been a fan of the .INI syntax but the lack of a standard (which I think Microsoft should have championed) made the format hard to use consistently. There have been attempts at standardization [1] but, alas, they never spread widely enough. In light of the above, I'm glad to see an INI-derived format with a real spec -- not necessarily because it might replace JSON but because it might replace INI.

Speaking of INI, for the longest time the killer app for INI files for me was persistent data storage in batch scripts (.bat/.cmd files in Windows 9x/NT). Using a command line utility like [2] or a similar program from IBM that sadly wasn't legally redistributable you were able to achieve persistence with minimum effort, which would otherwise be difficult to program in batch. I even wrote a portable clone of inifile.exe for MS-DOS and Linux to be able reuse my scripts more easily. TOML would sure benefit from the same.

[1] http://www.cloanto.com/specs/ini/

[2] http://www.horstmuc.de/wbat32.htm#inifile

Post reply on HN