Re:YAML: Probably not so great after all (2019)
by karussell on Sunday April 12, 2020 @11:40AM
(#22848909)
It is so easy to complain about something, but seriously: what are the alternatives for human readable config files?
[ Parent
| on HN ]
Re:YAML: Probably not so great after all (2019)
by vsajip on Sunday April 12, 2020 @01:28PM
(#22849692)
In 2008, before many of the options for configuration that are available now had been created, I came up with a hierarchical configuration language [0] to use in my Python code. More recently, I had a look at some of the newer options available (JSON5, HJSON, HOCON, SANE and TOML), but still find them wanting in various ways. The latest iteration of my take on it [1] is now available in multiple environments (Python, the JVM, .NET, Go, Rust, D and JavaScript). I would welcome any critique from the HN community.
Re:YAML: Probably not so great after all (2019)
by cyphar on Sunday April 12, 2020 @01:07PM
(#22849507)
I really like TOML. It's very similar to old-school INI files except it has a standard and parsers in quite a few languages. It does has its own downsides (while the concept of tables is quite useful, it can be a bit tricky to understand when you first see it). But it's one of the least-bad "modern" configuration formats I've seen.
Re:YAML: Probably not so great after all (2019)
by sooheon on Sunday April 12, 2020 @04:18PM
(#22850741)
EDN is great. https://github.com/edn-format/edn
Re:YAML: Probably not so great after all (2019)
by m4r35n357 on Sunday April 12, 2020 @11:47AM
(#22848965)
For a scripting language, how about the language itself?
Re:YAML: Probably not so great after all (2019)
by eyelidlessness on Sunday April 12, 2020 @11:52AM
(#22849012)
This is what I do whenever possible. And bonus if your scripting language is statically typed. My projects use TypeScript configurations, with the `config` import statically typed and each configuration file checked against those types. It's a great way to ensure you don't miss a config change for an environment you're not working on at the time.
Re:YAML: Probably not so great after all (2019)
by williamdclt on Sunday April 12, 2020 @12:35PM
(#22849293)
Many reasons to prefer a static declarative config over a dynamic imperative one. Sometimes the latter makes more sense, but there is very much a need for the niche YAML tries to fill
Re:YAML: Probably not so great after all (2019)
by gruez on Sunday April 12, 2020 @12:42PM
(#22849344)
submission about exactly that: https://news.ycombinator.com/item?id=22787332
Re:YAML: Probably not so great after all (2019)
by baq on Sunday April 12, 2020 @12:11PM
(#22849141)
Turing complete configuration is a no-no.
Re:YAML: Probably not so great after all (2019)
by gruez on Sunday April 12, 2020 @12:41PM
(#22849338)
Why?
Re:YAML: Probably not so great after all (2019)
by baq on Sunday April 12, 2020 @02:22PM
(#22850055)
I want my configuration to be guaranteed to halt for one, I don’t want my configuration to have the ability to open sockets, I don’t want configuration to import business logic or 3rd party modules, etc.
Re:YAML: Probably not so great after all (2019)
by bspammer on Sunday April 12, 2020 @02:04PM
(#22849929)
JSON is perfectly readable in my opinion.
Re:YAML: Probably not so great after all (2019)
by Kaze404 on Sunday April 12, 2020 @12:26PM
(#22849234)
Doesn't the article go over that?
Re:YAML: Probably not so great after all (2019)
by karussell on Sunday April 12, 2020 @12:27PM
(#22849244)
Where? I only see in "conclusions" that StrictYAML is recommended, but this is only about the implementation not the format itself.
TOML is mentioned but I do not see wide adoption, e.g. no up-to-date Java or similar implementation. (https://github.com/toml-lang/toml/wiki#implementations)
Additionally I think TOML is more verbose compared to YAML but avoids the indentation ugliness.
Re:YAML: Probably not so great after all (2019)
by hocuspocus on Sunday April 12, 2020 @12:55PM
(#22849438)
If you're in the Java world, HOCON is pretty neat.