Live data from Hacker News

YAML: Probably not so great after all

arp242.net

411–420 of 457 posts

Re: YAML: Probably not so great after all

#411

Earlier quoted context omitted.

Programming language design and implementation is a huge and hard problem. What you get is an incomplete frustrating language full of semantic oddities and confusions without any serious support tooling to help you out. If you use it in anger, you quickly need all language features e.g. importing libraries, namespaces, functions, data-structures, rich string manipulation etc. But you rarely get these. At run-time, yo…

One of the most ridiculous examples of this was the Smarty templating language for PHP. Somebody got the silly idea in their head of implementing a templating language in PHP, even though PHP is ALREADY a templating language. So they took out all the useful features of PHP, then stuck a few of them back in with even goofier inconsistent hard-to-learn syntax, in a way that required a code generation step, and made tem…

> One of the most ridiculous examples of this was the Smarty templating language for PHP.

Wow... Yuck!

Lua is at least a "standard" and rather sane language. Not ad hoc insanity.

Re: YAML: Probably not so great after all

#412

From my experience, while YAML itself is something one can learn to live with, the true horror starts when people start using text template engines to generate YAML. Like it's done in Helm charts, for example, https://github.com/helm/charts/blob/master/stable/grafana/te... Aren't these "indent" filters beautiful?

> the true horror starts when people start using text template engines to generate YAML I just had a shiver recalling a Kubernetes wrapper wrapper wapper wrapper at a former job. I think there were at least two layers of mystical YAML generation hell. I couldn't stop it, and it tanked much joy in my work. It was a factor in me moving on.

> Kubernetes wrapper wrapper wapper wrapper at a former job

oh god why

Re: YAML: Probably not so great after all

#415

Earlier quoted context omitted.

-1 for Turing complete config languages.

+1 for Turing complete programming languages instead of half-assed config languages.

Why are you putting logic in the config in the first place? Just let it be data.

Re: YAML: Probably not so great after all

#416

Earlier quoted context omitted.

It's telling that the responses to this question are broad and varied. Still not a well solved problem, it seems.

It's also telling that even with every other possible answer being given by someone, there's still no one who wants XML.

nah, the XML people are just keeping quiet because no one likes hearing 'I told you so'

Re: YAML: Probably not so great after all

#417

Earlier quoted context omitted.

Sounds like another short sighted decision. Why don't they support an intermediatory representation that many languages can support. Even yaml would be fine if other languages can generate it. If they had to absolutely use something why not something more main stream and popular like Python. Helm asks too much for the functionality it provides.

-1 for Turing complete config languages.

How about normally-Turing-complete languages that can be stripped down to non-Turing-completeness to make a configuration DSL?

This is exactly what Tcl supports / was designed to do (and in turn is one of my motivations for developing OTPCL). This is also exactly what your average Lisp or Scheme supports.

Re: YAML: Probably not so great after all

#418
post #374

Earlier quoted context omitted.

> When they build something better I'll be the first to jump ship. Will you though? With learning a tool (almost any tool), its value increases with more use until you find a local maximum. The amount of effort to switch to something with a higher maximum at that point will definitely be considered by most people as part of the cost of that competitor. It is very hard to write off years of your life on anything. When…

Will I? Personally, I enjoy tinkering with new tech. If we look at trends in technology, it's an absolute guarantee. The last time I wrote off technology? In 30 years I've been doing this, I would say constantly, especially with tooling. I wouldn't consider the lessons learned using defunct tools to be lost either. I'm not complaining about serialization formats, so why would I dedicate time to making it better? Solu…

Ok, I'll give it a shot.

Smalltalk environments don't typically have "configuration files" because it's so much easier to just directly manipulate the configuration parameter. Interactive development- the kind impossible with anything but the most specialised of IDE-- simply makes "config files" obsolete. Take a look at the seaside configuration guide[1] to get an idea what this is like.

In k/q[2] we also don't typically use configuration files, but for a different reason: Every type can be serialised over network or onto the disk, and when it's written to the disk it's usually in a format we can mmap() and access transparently. This is how q is also a database -- the data types q supports also includes tables.

k/q also has a built-in event loop that's not dissimilar to what you get when you run nodejs with the debugger port open except it's fast, and it's the regular way k/q processes communicate with each other.

What typically happens is that a table is designed for configuration, and we just expose it to the UI. Production environments are usually locked down so the only UI is to edit existing configuration parameters (and those are permissioned accordingly). These UI are typically quite general for any k/q data type, so they're quite rich and easy for people to use.

Then parts of the application interested in configuration just query the appropriate configuration table - this is only about 1000x faster than you would expect connecting to a remote database, and in many ways it's similar to a python application just storing its config in an sqlite database, except SQLite doesn't let you have a table as a data type so you can't put a table into another table, and you don't have tooling around comments and advice like you do with k/q UIs.

There are other places if you look carefully: Environments people have used (even beyond thirty years ago) that didn't have configuration "files", often had interesting and useful solutions to storing configuration. People tended to build configuration into part of their application, and so the legacy of that has tended to be excellent tooling instead of novel file formats.

[1]: http://www.shaffer-consulting.com/david/Seaside/Configuratio...

[2]: https://kx.com/

Re: YAML: Probably not so great after all

#419

Earlier quoted context omitted.

Any reason why you think they're bad? Sounds enticing to me to be able to have a bit of logic in configuration file.

Programming language design and implementation is a huge and hard problem. What you get is an incomplete frustrating language full of semantic oddities and confusions without any serious support tooling to help you out. If you use it in anger, you quickly need all language features e.g. importing libraries, namespaces, functions, data-structures, rich string manipulation etc. But you rarely get these. At run-time, yo…

Why not use an actual language instead? Like Guix uses guile.

Re: YAML: Probably not so great after all

#420

Earlier quoted context omitted.

+1 for Turing complete programming languages instead of half-assed config languages.

Why are you putting logic in the config in the first place? Just let it be data.

That's like saying that God existed before creating the universe. Then you have to ask who created God? And if God was created only from data and not any logic, then the config file must have been really huge and unmaintainable.
Post reply on HN