Live data from Hacker News

TOML, Tom's Own Markup Language

github.com

121–130 of 173 posts

Re: TOML, Tom's Own Markup Language

#121

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

Update: It seems that he has provided an implementation now. I feel better about that, I can't stand when people squat on package names in Node.js.

(Meta: the edit link expired, hence the reply to myself)

Re: TOML, Tom's Own Markup Language

#122

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…

I don't know specifically about Sublime Text 2, but from my own experience writing a configuration library which accepts JSON as an input, you usually strip out those comments before feeding the resulting content to your appropriate json_decode function.

1- Read the contents of your JSON file.

2- Strip out the comments with some regex foo or such.

3 - Feed the remaining contents to your JSON parser.

Re: TOML, Tom's Own Markup Language

#123
post #9

Urg. Off topic, but I dislike this perl/ruby tendency of calling hash tables hashes . When I see the word hash , I always think of a value (ie a hash code) and not a data structure. Why couldn't they call it a hash map, hash table, map, table, dictionary etc like all the other languages...?

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?

Re: TOML, Tom's Own Markup Language

#124
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, it leaves way too many possibilities for crappy developers. Namespaces in config files, oh joy!

http://harmful.cat-v.org/software/xml/

Re: TOML, Tom's Own Markup Language

#125

Given Jekyll's enormous backlog of issues and pull requests[0], can we expect this to be maintained or supported any bit beyond the late night drunken brain fart that this is? [0] https://github.com/mojombo/jekyll

Parker Moore and I (along with many contributors) have been spending quite a bit of time on Jekyll recently. Over the last 30 days we've merged 17 pull requests and closed 62 issues. We're ramping up for a 1.0 release and there's a brand new website in the works. You can check it all out on the master branch. Tens (or possibly hundreds) of thousands of people use Jekyll now. It's interesting to note that Jekyll start…

> I'd wager that most of the great things we use today started as nearly ephemeral emanations from someone's mind, often late at night, or helped along by a snifter of brandy.

Scientific support for this:

http://www.psychologytoday.com/blog/choke/201204/alcohol-ben...

http://bigthink.com/ideafeed/how-alcohol-inspires-creativity

https://www.sciencedirect.com/science/article/pii/S105381001...

Re: TOML, Tom's Own Markup Language

#127
post #89

Earlier quoted context omitted.

I agree with that. 'map' or 'dictionary' are the best choices I think (or 'associative array', but why bring arrays into it). That's the interface, of which a hash table is just one possible implementation.

Sadly "map" is also the name of the critical "map" function which operates on lists. Maybe with an indefinite article ("a map") it's clear enough.

Sure, so go the Lua route: table. Or the python route: dictionary. If neither of those do it for you, how about "mapping"?

Hash (and hash map, hash table etc) leak too much implementation detail. What if you want a tree-based mapping instead? I like how in C++ it's map (for ordered, rb-tree based maps) and unordered_map (for unordered, hash table based maps).

Re: TOML, Tom's Own Markup Language

#128

What is wrong with JSON? Everything already supports it. JSON has two drawbacks: a lack of comments (although you could add "#" keys in relevant places) and no binary support (arbitrary conventions include base64) but this doesn't support binary anyway.

couldn't you just use JS Object notation? you get comments, less cruft (having to quote string definitions in the key-space might be annoying).

Am I missing something with that?

Re: TOML, Tom's Own Markup Language

#129
post #114

Earlier quoted context omitted.

Lack of comments is pretty much a deal breaker for configuration. I see a lot of undocumented JSON used for configuration and I find it difficult to believe that is something we want for the future. Lack of comments makes JSON much better for data exchange than formats with comments.

Lack of comments is at once annoying and beneficial: it forces your [JSON-based] configuration to be simple.

Like xcode project files...

Re: TOML, Tom's Own Markup Language

#130

Earlier quoted context omitted.

As proper nouns become more common, they first lose any capitalization in the middle of the word, and then finally capitalization of the initial letter. It's human language. It happens.

Yes, and I think it's arrogance on the part of Wordpress (there I did it) folks to insist that everyone capitalize it in the prescribed manner. Especially since they weren't consistent from the get-go. They even went so far as to make Wordpress (trolol) itself filter content to be capitalized if someone tries using the lower case p. http://justintadlock.com/archives/2010/07/08/lowercase-p-dan...

It's to do with protecting their trademark though. That whole human language makes proper nouns normal words - companies don't like that at all. In the case of WordPress, there's a lot of potential for abuse if anybody can call their system it or whatever.
Post reply on HN