Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Since finding CUE, it has become by language of choice for anything declarative, it's become my devops superglue.

Great CLI that lets you work with CUE/Yaml/JSON, a Go SDK to get sophisticated, and WASM based bindings to unlock all the other languages.



Have you given Apple's language, Pkl, a try?

https://github.com/apple/pkl


I've been using Pkl since it came out and I like it a lot, and the editing experience is fantastic with intellij.

I don't think inheritance is a flaw at all here. It makes a lot of sense to build configuration up from base definitions, especially when you account for its merge syntax.

I've been using it for k8s manifests a la customize. The biggest pain point for me is the lack of flat member syntax when updating deeply nested fields.

Something that's caught my eye is KCL, which seems similar, but maybe a bit more mature?


I looked at it, but it has the OOP flaw that CUE is designed to avoid. In other words, overrides are bad and inheritance is a form of override. CUE enables one level of override through defaults or preference marks.

I recommend reading The Logic of CUE to get a gist of the theory

https://cuelang.org/docs/concept/the-logic-of-cue/


i’ll be honest, that article makes it sound like the creators of CUE are really just taking their interest in type theory and applying it wholesale to devops configuration. maybe it’s just late but my eyes were glazing over by the third lattice diagram that really made no sense to me. you seem really into it so i’m sure there’s a reason and i’d like to know what makes it cool, but in more accessible terms like maybe what it lets me do that i couldn’t do in another language. got any links like that?


I have a website I maintain, many people tell me it has helped them

https://cuetorials.com

I've built a monorepo software catalog that solves a number of the complexities in CI, manage most k8s/helm resources with CUE, and built a code gen framework on top of CUE

https://docs.hofstadter.io

To me, I think want sold me was being able to build up large config values from pieces and pattern constraints, know that the system will ensure correctness, and being able to easily inspect that config. Being able to combine CUE with yaml or json in a single CLI call is super handy and helped me when advocating for adoption. You can use CUE to validate existing config or layer a bit on top before having to convince people to change their toolset

That CUE is a logical language makes the learning curve a bit stepper than most other config languages. I've kept it simple for the devs I serve and being a JSON superset makes their modifications to my code an easy ask/lift


i’ll check those links out —thanks for taking the time to write up your thoughts!


I also generate HCL JSON from CUE too, since the OP is about HCL


yeah what they don't mention is that Pkl is based on Java.

you need a 100MB+ runtime to get started with.

But if you are already a Java shop like us, there are even more things to make your complex configs even more complex with pkl gradle plugin.

Of course, you do have to setup and install gradle, and to run gradle you need to install and setup Java JDK.


https://github.com/apple/pkl-go/blob/v0.6.0/.circleci/config... seems to imply it's "curl && chmod" so maybe you're thinking of developing pkl itself?

I happened to have a container that I am certain contains no Java and it fired right up

  $ docker run -it --rm --entrypoint=/usr/bin/env public.ecr.aws/aws-cli/aws-cli:2.15.38 bash -c 'curl -fsSLO https://github.com/apple/pkl/releases/download/0.25.3/pkl-linux-aarch64; chmod a+x pkl-linux-aarch64; ./pkl-linux-aarch64 --help'
  Usage: pkl [OPTIONS] COMMAND [ARGS]...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: