Apple Pkl
github.com
github.com
- [3 days ago] https://news.ycombinator.com/item?id=39430511
- [10 days ago] https://news.ycombinator.com/item?id=39350714
- [11 days ago] https://news.ycombinator.com/item?id=39340288
- [16 days ago] https://news.ycombinator.com/item?id=39276826
- [16 days ago] https://news.ycombinator.com/item?id=39282459
- [19 days ago] https://news.ycombinator.com/item?id=39239265
- [20 days ago] https://news.ycombinator.com/item?id=39233546
- [20 days ago] https://news.ycombinator.com/item?id=39237838
- [20 days ago] https://news.ycombinator.com/item?id=39232976
> Pkl — pronounced Pickle — is a configuration-as-code language with rich validation and tooling
Dhall seems to be explicitly total (non-turing complete) while Pkl seems to be Turing Complete, hence dangerous as you can basically compute anything
The tutorial is also nicely written. Props to Apple for writing really good docs on this one! The error messages it produces also look pretty good.
It would be nice if they added compiled equivalents of each code snippet from the tutorial in other formats, though, since it wasn't immediately clear how certain types (like `duration: Duration = 30.min`) would be represented in JSON.
If anyone at Apple is reading this, another thing that would make it much easier to evaluate and decide whether to adopt pkl would be to include an online compiler with a few built-in examples so that anyone can quickly see how the configuration is transformed without delving into the full docs.
You can try it out and see what it generates.
The big gotcha is it's only implemented in Java. So any language bindings have to shell out to a subprocess to actually do any work.
You might want to consider also publishing a schema for it too, as a Pkl package. The package can simply be published as a GitHub release (see details in this post here: https://github.com/apple/pkl/discussions/85#discussioncommen...)
Also, despite being written in Java, Pkl is distributed as a native executable for macOS and Linux (Windows coming soon).
But yeah, you do need the executable installed on your system in order for our pkl-go bindings to work.
Is there any way to use pkl from Go without needing to shell out? Maybe Go library that calls a wasm blob or something?
Apparently getting out of your seat early at lunch and announcing to your coworkers that you’re gonna go “tickle my pickle” is “inappropriate for the work place” and “completely unacceptable behavior”..
I haven't had a chance to use it yet, but it addresses some gaps in validation for JSON, YAML and other configuration files and I appreciate their approach to the problem. I look forward to using it the next time I have a system with JSON that's unwieldy.
Yeah that looks pretty useful.
In JavaScript land, I just do this with zod to crash the server on startup, but I can't remember if there's already an easy way to do it with the java/kotlin/gos
Not sure what you’re specifically talking about wrt to late bind or how you feel it’s relevant to this, so I am curious what you mean.
But the reason the class syntax was added to the language was 100% just a programmer familiarity change, nothing else.
Start with YAML/JSON/TOML, but then add:
- Optionally strict typing and structs
- Inheritance
- Dynamically computed properties
- Functions & object methods, which are really more like computer properties
- If/Else conditionals, which are really more like a ternary
.. and managed to do it while still making it look like a simple config file.
The closest analogue from memory might actually be Terraform.
The one thing that had me squinting was the object extension syntax. It looks powerful.. and I understand its value.. but wow that's ends up being eye-full of () {} and [] all in one code bock.