28
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 19 Sep 2023
28 points (100.0% liked)
Linux
47984 readers
1992 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
I think data configuration is fine until you get to a point where you need functions. This is one of my pet peeves: data configuration formats that get creative to work around the format limitation when they should switch to scripting. My example is Home Assistant.
Home Assistant is a home/smart device automation server. It uses Yaml for automation scripts. But you often need functions. So they use jinja2 templates to emulate functions in Yaml. Then you have to manage copying variable values to make them available in the runtime context who where jinja2 templates are evaluated. There is no static validation for templates. And it takes a lot of detective work to figure out what variables and helpers are available. It's very frustrating. I really wish Home Assistant would use a type-checked scripting language instead. And it's not the only system out there that uses Yaml with string templates!
Same here, I avoid using Jinja if at all possible because I just hate blindly poking at stuff like that. I wish the YAML portion had schemas available for autocompletion when editing, at the very least.
Ansible comes to mind as something in a similar vein, I've been messing with it pretty often these days. At least here you do get robust autocomplete support and whatnot that eliminates a lot of the guesswork, although Jinja is always a bit painful lol.
Oh yeah, and with Ansible there is an alternative to point to, Nix, which does configuration better IMO using a scripting language. It's still not typed so editor LSP support is limited. At least with NixOS modules and with Home Manager modules runtime validation is pretty good.