4 ms·
I have been developing my own package manager, and my core idea is that proper programming languages are the proper level for describing packages. Programs tak
by davidmdm91 2y ago
I have been developing my own package manager, and my core idea is that proper programming languages are the proper level for describing packages.
Programs take inputs and can output arbitrary data such as resources. However they can do so with type safety, and everything else a programming ecosystem can achieve.
For asset distribution it uses wasm, and that's it!
If you want to check it out its here:
github: (https://github.com/davidmdm/yoke https://github.com/davidmdm/yoke)
docs: (https://davidmdm.github.io/yoke-website https://davidmdm.github.io/yoke-website)
I like that you said:
> I think proper programming language support is the way to go.
I think we need to stop writing new ways of generating yaml since we already have the perfect way of doing so. Typed languages!
- verdverm 2y ago> that isn't turing complete and guaranteed to terminate This means general purpose languages do not qualify, and more generally, no general recursion
- davidmdm91 2y agoWhy limit yourself to those types of tools? To protect against somebody writing a non-terminating program? General programming languages come with a lot of general purpose benefits from their ecosystems like package managers npm, cargo, go modules, etc. They have test runners, and control flow. Lots of them already have type definitions for kubernetes and if you are working in Go you have access to almost the entire kubernetes ecosystem. Maybe we are throwing the baby out with the bath water when we disqualify general purpose languages?
- verdverm 2y agoBecause people write code that is hard to understand. Configuration doesn't need all that. What it needs is to be provably correct and easy for someone to make predictable changes under high pressure (when prod is down). The non-terminating thing is one of the features of a turing incomplete language, not the goal. You don't want inheritance either, because it becomes hard to know where and when a value gets set (which is what helm overlay via multiple -f uses effectively is) You speak like turning incomplete languages cannot have the control structures, tooling, and ecosystems we enjoy elsewhere, which would be the wrong assessment. I recommend you take a look at CUE to see how this can be true The OpenAPI specs are probably better than the Go language types for k8s. They have more of the validation information and you can get at the CRDs / versions actually running in the cluster.
- davidmdm91 2y agoI am not saying that Turing incomplete languages don’t or can’t be a good fit for this task. However there’s no reason we should rule out general purpose languages. We have a lot of configuration based IaC and configuration tooling a la jsonnette and cue and yet these are riddled with their own problems and DX issues. Anyways we don’t need to see eye to to eye on this but I respect your position.
- mitjam 2y agoIn addition it is actually hard to not make a template language accidentally Turing complete. Here is an entertaining list of accidentally Turing complete things: https://beza1e1.tuxen.de/articles/accidentally_turing_complete.html https://beza1e1.tuxen.de/articles/accidentally_turing_comple...
- MrDarcy 2y ago> However there’s no reason we should rule out general purpose languages. We’ve learned the hard way general purpose languages are poor for configuration at scale. I know first hand having worked on some of the larger prod infrastructures out there. At scale, the best SRE’s out there still have trouble reasoning about the system and end up pushing bad config that takes down prod. Languages like CUE really are different and better. CUE in particular hits the right balance for configuration of millions of lines of k8s yaml.
- verdverm 2y ago> CUE in particular hits the right balance for configuration of millions of lines of k8s yaml. CUE was created by the same person who wrote the Borg precursor and also worked on BCL & GCL.
- davidmdm91 2y agoI actually really like CUE. I use it kind of extensively as a YAML replacement where I can, and at my work we've done our best to integrate cue with our charts to validate the values used to invoke our charts and to unify the value space. However there's something about a full blown general purpose language that is so much more flexible. I don't think that the fact that people can and do write bad programs disqualifies general purpose languages from being great tools to build packages. I am sure there is just as equally bad CUE, Jsonette, PKL, etc out there. Other than CDK8s I don't know of other tools that have tried in this space to use general purpose languages to define their packages, and I think CDk8s uses are generally happy. Much more so than helm users at least. I am not sure I can agree with this statement > We’ve learned the hard way general purpose languages are poor for configuration at scale I think we've just assumed this, or seen a pulumi project we didn't like working in. I believe and hope there will be plenty of room to experiment and innovate in this space!