6 ms·
One of the problems that the yaml interpreter class of languages, or whatever you'd call them, suffer from is the fact that yaml itself is a language and tends
by jethro_tell 2y ago
One of the problems that the yaml interpreter class of languages, or whatever you'd call them, suffer from is the fact that yaml itself is a language and tends to be more or less undocumented in the interpreter docs.
It's sort of assumed that you are going to do extremely simple tasks on very flat data structures. That doesn't tend to be the reality that most of us live in. And to really get the most out of these languages you have to understand an entire unspoken set of rules on how to use yaml. That's never really pointed out in the docs.
Additionally, there are docs for the unique settings for each module but as far as using the standard settings, additionally, its rarely clear how to operate on the data that might be returned or combined with anything mildly complex, you are given a dozen 1 stanza examples for each item like a stack of ingredients and then told to bake a cake.
I've had this experience with basically every one of the various yaml interpreter systems I've used.
After a few 100k lines of yaml I can get things done but the docs are useless other than a listing of settings.
- ornornor 2y agoTo illustrate this point, here is how to have a multi line value in yaml: just kidding, it’s so confusing that there is a whole website to help you figure it out: https://yaml-multiline.info/ https://yaml-multiline.info/
- hombre_fatal 2y agoThose examples don’t look confusing except there being more than one way.
- ornornor 2y agoGood luck remembering which is which :)
- cromka 2y agoIsn’t it why toml is seemingly increasingly used to replace yaml in projects?
- tormeh 2y agoToml is great for simple use-cases. For complex ones you have the same problem that yaml has: Templating a language with significant whitespace via text substitution is a horrible horrible idea. Somehow this sad state of affairs has become industry standard.
- jethro_tell 2y agoIts not even the white space, a food liter or language server can handle that. It's not that, as much ad the fact that the most complex data structure is a list. If you want to get crazy, you can push a dict into a list and operated on it but it gets tough at the second level. And don't get me started on if/else statements.
- mardifoufs 2y agoIn my experience toml is worse at anything complex. It's nice as an .ini replacement but makes even yaml look sane in comparison if you want to use it for very complex or deeply nested stuff. But it wasn't designed to do that anyways
- vundercind 2y agoAm I alone in greatly preferring nesting in toml compared with yaml?
- bvrmn 2y agoDid you try to convert any mid-complexity ansible role into toml? It was very interesting exercise for me and vastly conclusive.
- jethro_tell 2y agoI hope not, toml is even worse at complex things and just slightly better at the stuff that isn't confusing. Add a k:v to a mildly complex dict. At this point, I'm pushing into a place where I'm just going to switch to go because its getting to be a mess.
- tootie 2y agoI honestly wonder why not just write your web server in node or something. It would be traceable and testable and probably performant enough. There's just so much arcana inside platforms like traefik or nginx where they do all this miraculous stuff if you just add the right flags, but also when it doesn't work it's a total black box and there's no way to discover what it thinks it's doing.
- itintheory 2y agoThe Traefik dashboard is pretty helpful for visualizing what's happening. Also their error message are usually pretty clear about what's wrong.
- CoolCold 2y agoI like that "probably" for perfomant here, but let's focus on features so far. Let's imagine we go this way, implemented own self made webserver in nodejs, started using it and the next day it will be required to add simple things like basic auth for specific location or ACL based on Maxmind geo data or even setting straightforward round-robin balancing among several php-fpm upstream, even without weights - what would be the flow here? Involving dev team and trying to put those tasks into their backlog? Why it's better than just adjust Nginx config in 5-10 minutes?