Earlier quoted context omitted.
I mean... Nix satisfies every single one of what you mentioned and people say its too complicated. It's literally just the JSON data structure with lambdas, which really is basic knowledge for any computer scientist, and yet people complain about it. It's fairly straightforward to 'embed' and as a bonus it generates json anyway (you can use the Nix command line to generate JSON). Me personally, I use it as my templat…
Tried to use Nix as a homebrew replacement and failed to get it installed correctly with it blowing up with crazy error messages that I couldn't google. I didn't even get to the point of assessing the language. It really seems like the right kind of idea, but it doesn't seem particularly stable or easy enough to get to that initial payoff. If there's a nice language under there it is crippled by the fact that the ave…
Why are we templating YAML? (2019)
621–630 of 667 posts
Re: Why are we templating YAML? (2019)
#622Earlier quoted context omitted.
I don't see any practical difference w.r.t. cybersecurity between "I blindly applied this pile of YAML to my production kubernetes clusters without looking at it" and "I blindly downloaded and ran this computer program on my CI runner without looking at it". A supply chain attack on the former means that your environment is compromised. So does the latter.
I do see a difference. GitHub actions isn't going to run your Python code on its orchestration infra. Nor is DigitalOcean or Fly.io or CircleCI. They all convened around "YAML" because it's a very limited set of instructions. I'm quite sure you cannot write a bitcoin miner (or something that opens a backdoor) in Liquid inside YAML in the DSL that Github Actions has. I am 100% sure you can write a bitcoin miner in Pyt…
Re: Why are we templating YAML? (2019)
#623Earlier quoted context omitted.
This is not true in a correctly configured editor.
How so?
Any editor used for programming needs to be capable of this.
Re: Why are we templating YAML? (2019)
#624Earlier quoted context omitted.
Every editor I know can enter n spaces when pressing tab. That might solve your concern.
It does not. You still have to mess around with a bunch of spaces when you're editing or copy/pasting, and not having exact even numbers makes for ambiguous situations.
Re: Why are we templating YAML? (2019)
#625Earlier quoted context omitted.
Would you be able to link the repo? I'm curious on your impl
https://github.com/nickelpack/nck I wanted to use Nickel, but it turns out that it can't do everything you'd need it to do to completely replace NixLang. So right now I'm bikeshedding on what to use instead (and desperately trying not to invent something), in other words it's definitely being renamed. Either way there's a bash script in the `test` dir that shows the general concept.
Re: Why are we templating YAML? (2019)
#626I'm completely done with configs written in YAML. Easily the worst part of Github Actions, even worse than the reliability. When I see some cool tool require a YAML file for config, I immediately get hit with a wave of apprehension. These same feelings extend to other proprietary config languages like HCL for Terraform, ASL for AWS Step Functions, etc. It's fine that you want a declarative API, but let me generate my…
Re: Why are we templating YAML? (2019)
#627Earlier quoted context omitted.
Yeah, I'm pretty sure there are exactly two substantive problems with JSON for (static) configuration file use cases, which are comments and multiline strings (especially with sane handling of indentation). YAML fixes these, but it adds so much complexity in the process including such a predictable footgun of unquoted strings (the no/false problem is particularly glaring/absurd, but it's also easy to forget to quote…
Solutions abound, but one option is to use either Javascript (config.js): // comments! ({ no_quotes: [1, 2, (() => /* code! */)()], ... }) Or, let the whole thing be a function. Then your config can have parameters, maybe mapped from environment variables or something. ({foo, bar, ...kwargs}) => ({ datacenter: foo === 'old' ? 'useast1' : 'uswest', ... }) Can do as Crockford says, and write in the JSON subset of Javas…
Re: Why are we templating YAML? (2019)
#628Earlier quoted context omitted.
> Haml, Pug, and JSX are not template languages even though they can output HTML. That's nonsense, unless we go by your idiosyncratic definition of what a template language is ("fancy string interpolation"). > Haml (HTML Abstraction Markup Language) is a templating system that is designed to avoid writing inline code in a web document and make the HTML cleaner. > Pug – robust, elegant, feature rich template engine fo…
I am aware that Haml and Pug call themselves template languages, but they are not. In a template language, the source is a "template" that has some special syntax to fill in some bits. I don't think that's a very idiosyncratic definition. Pretty much any programming language can output a bunch of text, but most of them are not template languages. Java has XMLBuilder, but that doesn't make it a template language for o…
As an aside, on another post yesterday, I had a pleasant surprise about "templating" in life itself.
> The familiar distinction between software and hardware loses its meaning in living cells. We propose new ways to study the phylogeny of metabolisms, new astronomical ways to search for life on exoplanets, new experiments to seek the emergence of the most rudimentary life, and the hint of a coherent testable pathway to prokaryotes with template replication and coding.
https://arxiv.org/abs/2401.09514
Maybe DNA is the original templating language. (Hopefully with more sophistication than fancy string interpolation.)
Re: Why are we templating YAML? (2019)
#629Earlier quoted context omitted.
I started off with "I'm not sure what you mean" and you have given zero examples. I'm not being disingenuous. Other people can't read your mind. Other people aren't experts on the same things you are. And specifically, I described the class keyword as slight. Don't be an asshole by accusing people of things they're not doing.
do not speak with authority if you do not know. do not try and downplay something just because you want it to be true.
And I stand by saying there was no need for the awkwardness with classes.
What did I downplay? You still haven't said what they did. I can't be downplaying a thing that isn't part of the conversation.
Re: Why are we templating YAML? (2019)
#630Earlier quoted context omitted.
Oh man, i have a similar issue with NixLang. Though i know it's not "implarative". Many days i just want to write Nix in my preferred language. I wish Nix had made a simple JSON based IO for configuration, because then i could see what the output of something is - and generate the input state from some other language. Really frustrating. Nix works.. but i just don't see the value, personally. And this is after living…
I see Nix as a powerful way to write config files. It is purely functional, so the only thing it does is create a build recipe. That build recipe is then run by other Nix tooling. A .nix file is either a config file itself or a function that returns a config file or a function. By passing in enough parameters, you get the configuration. I've not seen as clean a way of doing this anywhere else. Guix uses Guile which i…
Ie yea, i can load up the Eval and call my config func - but what about the params? Well now i have to generate the params. Some of them might be easy, but some are difficult as hell - and if they differ now executing my func in the Eval is not producing the same output (or failing entirely) as it does when i run it "for real".
Nix in practice felt like all of the problems of imperative languages but wrapped in a nice functional wrapper. It was functional without any of the real benefits of functional - to me.
Eg i can't easily get the same input and pass it into a function to produce the same output. To be able to view a function as a simple slice of functionality that i can inspect, debug, etc. They have get access to the entire universe (nixpkgs/etc), a huge stdlib, etc - and you need to recreate all of that if you want to use the function.