5 ms·
What would you recommend instead? Personally, I think Typescript makes a great config language
by bbkane 3y ago
What would you recommend instead? Personally, I think Typescript makes a great config language
- 10000truths 3y agoLua is fantastic for the config-as-code use case. Easy to read and write, with a lightweight embeddable interpreter, and it has almost universal library support across different languages/environments.
- ishigoemon 3y agoIt's a shame that helm v3 didn't move forward with the lua engine[0]. I don't imagine ~=/1-based arrays were a worse timeline... And here we are 5 years later. [0] https://github.com/helm/helm/issues/5084 https://github.com/helm/helm/issues/5084
- jpgvm 3y agoDedicated config languages are the best usually. Jsonnet/Cue/friends. Failing that if you actually need/want a procedural/non-pure language then I think Kotlin or Ruby take the cake. Both have extremely strong support for DSLs which IMO is key to reaching a modicum of usability.
- sakjur 3y agoStarlark is nice as well, it’s syntactically based on Python, and behaves a lot like regular procedural languages, but it’s meant to provide a pure and safe environment for configuration and be embeddable.
- jpgvm 3y agoSince using Bazel a bit I have grown an appreciation for Starlark also. The big thing is that list and dict comprehensions are a really nice fit for these types of tasks.
- mieubrisse 3y agoBig +1. We switched to Starlark for our DSL last year and have been very pleased. Users who've never used Starlark before come in with some 'what, another language?' trepidation, and end up pleasantly surprised.
- ljm 3y agoI dunno - using cdk8s at one place was a miserable experience. Adding runtime evaluation just made everything more complex than it should be. In that case I preferred to describe infrastructure rather than program it.