Live data from Hacker News

TOML, Tom's Own Markup Language

github.com

91–100 of 173 posts

Re: TOML, Tom's Own Markup Language

#92
post #76
post #64

Earlier quoted context omitted.

Go "back"?! There are lots of places where xml is alive and well and config files is one of them. And you can see why - empty elements with attributes look rather concise, and without all that punctuation noise JSON has.

cough every java project ever cough

Typesafe Config says hello.

Re: TOML, Tom's Own Markup Language

#93
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...?

This bit of ruby should take care of it HashMap = HashTable = Map = Table = Dictionary = Hash And if you're feeling adventurous, Object.send :remove_const, :Hash

I approve of this. Don't listen to that other guy. This should be standard.

One addition though:

    Cocktionary = HashMap
"Dictionary" never really made sense.

Re: TOML, Tom's Own Markup Language

#94
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).

meteor has a way of serializing and deserializing datetime values http://docs.meteor.com/#ejson

Re: TOML, Tom's Own Markup Language

#95
post #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]].

I don't know how much it is going to help as you're going to have to wrap the values anyway to get a Map with heterogeneous values.

Re: TOML, Tom's Own Markup Language

#96
post #77
post #56

Earlier quoted context omitted.

And this is only 10% curly braces, not counting spaces.

Despite that, the thread easily illustrates the difficulty of writing valid JSON by hand.

JSON wasn't invented, it was discovered, from a long evolution of programming languages. The punctuation isn't ceremony. It's the amount needed for it to be concise (clear and terse, not just terse).

Re: TOML, Tom's Own Markup Language

#97
post #25

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.

Especially when their own logotype has it in all lowercase.

That wouldn't at all back up calling it "Github."

Re: TOML, Tom's Own Markup Language

#98
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.

Re: TOML, Tom's Own Markup Language

#99

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.

I've never liked 'dictionary'. The analogy isn't at all apparent to me. A dictionary explains what words means. The thing we're talking about doesn't explain what keys mean. (Someone who spends most of his time writing python here.) 'map' or 'mapping'.

It's about the operations. One Does Not Simply (tm) read a dictionary. One instead performs a “lookup” for a particular item. The dictionary is designed to make this lookup fast and reliable, which matches the purpose of these data structures in software.

Re: TOML, Tom's Own Markup Language

#100

It seems to me that YAML does this better already (with parsers which are already high-quality). If we want simplicity, then why not make sure it is a subset of YAML?

I agree, and high quality YAML parsers are generally available in every language one might want to use. I don't believe I've ever encountered a situation where I was unable to obtain one. Well rust comes to mind, but then rust is really young and you could probably make one easily by just wrapping libyaml. That said, I might just write a TOML parser in python just for kicks.
Post reply on HN