Live data from Hacker News

TOML, Tom's Own Markup Language

github.com

81–90 of 173 posts

Re: TOML, Tom's Own Markup Language

#81

About the use of mark up language as config file. I see that in most Python apps, the config file is just another Python script and not using another markup language. This way makes sence in a dynamic language and it feels natural. I understand it is a habit to use yaml in Ruby apps for config. Is it not possible to just use Ruby script as config file since the script can be loaded dynamically? What are the pros and…

Your configuration file might need to be read by more than one language.

It's also nice to have a configuration file mean the same thing regardless of its runtime environment.

Re: TOML, Tom's Own Markup Language

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

The difficulty level is hardly extreme. It is not an unreasonable challenge to learn that writing an array of elements requires opening and closing brackets.

Re: TOML, Tom's Own Markup Language

#85
post #64

Earlier quoted context omitted.

please let's not bring XML into this. last thing we need is someone inspired to say let's all go back to XML.

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.

Somewhere, in a small room in a larger building owned by a gigantic corporation, a SOAP programmer just felt validated.

Re: TOML, Tom's Own Markup Language

#88

Earlier quoted context omitted.

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'.

A dictionary maps words to their definitions. The words are the keys, the definitions are the values. Seems reasonable to me. Though as another predominantly pythoner, I do prefer map as well.

In a dictionary the value (meaning) is often (partially) implied by the key (word), by etymology etc. In the data structure there need be no relationship between the key and value other than the fact that they are a key-value pair in this instance. It introduces messy cultural concepts into what should be a clean, abstract concept.

Re: TOML, Tom's Own Markup Language

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

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.
Post reply on HN