Live data from Hacker News

TOML, Tom's Own Markup Language

github.com

131–140 of 173 posts

Re: TOML, Tom's Own Markup Language

#131

Working node.js version: https://github.com/aaronblohowiak/toml I just need to auth and push it to npm.

Nice work! It's too bad that this guy squatted on the `toml` package name without any implementation: https://github.com/BinaryMuse/toml-node

I think he invited pull requests containing implementations.

Re: TOML, Tom's Own Markup Language

#132

This is quite nice but there are a few of things that I miss: 1. A way to have multi-line values for non array types 2. A more flexible number syntax (e.g. allow hex and binary integers, allow exponents on floats, allow NaN and +/-Inf) 3. Make it possible to have an extra comma after the last element on an array (as in Python) 4. Add a way to "include" another config file #1 is important because some projects require…

+1 for #3

It's not just in the diffs. Trailing commas make editing the list easier.

Re: TOML, Tom's Own Markup Language

#133
post #60

I note that, like many erstwhile specs, TOML does not document the escape sequences accepted in strings. Nor does it exhaustively specify integer formats and float formats - rather ironic for a spec that advertises "TOML is designed to be unambiguous and as simple as possible." The limitation on array types seemed fairly arbitrary at first glance, but after thinking it over I realized it aided compatibility with lang…

>I realized it aided compatibility with languages that do not support homogeneous arrays. Don't you mean languages that only support homogeneous arrays (or languages that do not support non-homogeneous)? As the spec says that the array elements must all be of the same type, thus homogeneous. If I a mistaken, can you please explain why?

I meant "only support homogeneous arrays," or "do not support heterogeneous arrays," and apparently got the two wordings mixed up. Thanks.

Re: TOML, Tom's Own Markup Language

#134

Earlier quoted context omitted.

Because the primitive is called Hash my %hash = (); Hash.new So naturally people talk of Hashes etc. I understand where you're coming from, but it's really not very important, and it would be more confusing to talk of Hash Tables as learners would naturally look for HashTable in the stdlib.

That was the question: why the class is named Hash instead of HashMap or Dictionary? Was it done intentionally, or it is just an accident because someone did not know English very well?

I agree Map or Dictionary would have been fine too, but it's so widely used it needs to be easy to type so two words is not great (HashMap). However I suspect it was just named that way following perl (written by an english speaker). Obviously it's far to late to change it now and I can't say it bothers me or most Ruby users. It's something you get used to very quickly.

Re: TOML, Tom's Own Markup Language

#136

I note that, like many erstwhile specs, TOML does not document the escape sequences accepted in strings. Nor does it exhaustively specify integer formats and float formats - rather ironic for a spec that advertises "TOML is designed to be unambiguous and as simple as possible." The limitation on array types seemed fairly arbitrary at first glance, but after thinking it over I realized it aided compatibility with lang…

[deleted]

Re: TOML, Tom's Own Markup Language

#137

The biggest concern with JSON seems to be the lack of comments. So what voodoo is Sublime Text 2 performing? Why can't we just use that? { // Sets the colors used within the text area "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", // Note that the font_face and font_size are overriden in the platform // specific settings file, for example, "Preferences (Linux).sublime-settings". // Because of this…

Some JSON implementations supports comments, others don't. If you know the one you use supports (and will continue to support) comments, go ahead and use it. It just won't be portable.

Douglas Crockford himself suggests you "Go ahead and insert all the comments you like. Then pipe it through JSMin before handing it to your JSON parser." That sounds like a reasonable workaround.

https://plus.google.com/118095276221607585885/posts/RK8qyGVa...

Re: TOML, Tom's Own Markup Language

#138

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

No comments. Lack of essential data types, forcing you to make the contents of strings part of a hidden unspecified semantic (this parses as date, that parses as time, etc). Constrained by the limitations of JS floats (they aren't even bigdecimal). Excessive significant punctuation. Insignificant white space (permitting a difference between valid, and pretty-printed form). Looks like executable code and tempts you to parse it with eval.

Re: TOML, Tom's Own Markup Language

#139

Ah, the power of fame. Implementations spreading like weeds. Four already in javascript, even though the spec is not anywhere near finished: npm search toml npm http GET https://registry.npmjs.org/-/all/since?stale=update_after&startkey=1361700343737 npm http 200 https://registry.npmjs.org/-/all/since?stale=update_after&startkey=1361700343737 NAME DESCRIPTION AUTHOR DATE node-toml TOML parser =ricardobeat 2013-02-24…

In a few years, maybe we can have "nfnpm" (noise-free node package manager).

Re: TOML, Tom's Own Markup Language

#140
post #53

And how is this better than xml?

Let's see: . No native support for numbers, dates, booleans or lists. The latter can be implemented using subelements, but it's so cumbersome that you skimped on that and used a non-typed string instead (the database ports). . Redundant verbosity. Root elements, closing tags, way too much crap to be manually inserted. . XML parsers are huge, complex beasts which have no place in many smaller applications. . Being XML…

Most of your points are environment specific and I think that you forgot the strongest of them - "xml APIs usually suck". In .net they are non-issues. And about being cumbersome and verbose, the point I tried to make is that you don't have to be zealous and put every small piece of data in a separate element. No reason not to put data in attributes or even in comma/whitespace separated strings, if that piece of data can be extracted in one short line of code.
Post reply on HN