This looks promising! I like that the template file also defines constraints at compile time, and that there is codegen to make it easy to work with pkl files well-typed in a decent variety of languages.
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.
Thats awesome, look forward to trying it. If you really forced me to say anything negative about caddy (it's such a delightful tool), would be the config and the configs docs/validation. Relatedly, I feel like just having some cargo cultable config examples for basic setups would be great.
HR overheard that, and now they want a meeting tomorrow :(
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”..
Dollars to doughnuts, it short-circuits an infinite loop of 20 people who aren't sure it makes sense to post to _the_ GitHub and also aren't sure who knows how to get it up there.
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.
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
The class keyword was added (as a functional syntax I mean) specifically because people understand class base inheritance but not prototype inheritance. It is literally just syntactic sugar on what you could do previously, so it’s not “needed” any more than many other basic syntax options.
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.
This has some pretty great ideas within it. A few that stuck out to me in case others don't want to skim the full spec:
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.
My understanding is that's an implementation detail, not a design. That is, there's nothing inherently anti-Rust or -Python there, but they first worked on the languages they needed to use themselves.