Tuesday, February 6, 2024

Pkl Programming Language

Apple (via Hacker News):

We are delighted to announce the open source first release of Pkl (pronounced Pickle), a programming language for producing configuration.


We created Pkl because we think that configuration is best expressed as a blend between a static language and a general-purpose programming language. We want to take the best of both worlds; to provide a language that is declarative and simple to read and write, but enhanced with capabilities borrowed from general-purpose languages. When writing Pkl, you are able to use the language features you’d expect, like classes, functions, conditionals, and loops. You can build abstraction layers, and share code by creating packages and publishing them. Most importantly, you can use Pkl to meet many different types of configuration needs. It can be used to produce static configuration files in any format, or be embedded as a library into another application runtime.


When binding to a language, Pkl schema can be generated as classes/structs in the target language. For example, the Application.pkl example from above can be generated into Swift, Go, Java, and Kotlin.

Daniel Jalkut:

Who had “Apple will release a new language, implemented in Kotlin, with IDE integration for everything but Xcode” on their bingo card?


Vision Pro is cool and all, but have you ever spent time searching for that format error in your YAML file?

Joe Heck:

The choice of package/module configuration IN swift was a decision I wish had been revisited back prior to Swift3 - so many ongoing and upgrading complications from that alone.

8 Comments RSS · Twitter · Mastodon

Isn't Pickle (spelt differently but pronounced the same) a format used for serializing Python objects?

Does this mean Swift as one-language-for-everything™️ has failed?

I keep reading "Tcl", which is both a big favourite of mine that I still use, and great for configuration and as a general-purpose metalanguage.

Guess when you're Apple, you have bigger fish to fry.

ObjC4Life: yes.

>...with IDE integration for everything but Xcode”...

Not too surprising. Apple is super secretive, even between teams internally. The pickle people probably couldn't talk to the Xcode people.

Mailman2 used to use pickles to store all its data in, but it doesn't do that anymore in Mailman3. (Mailman3 is the triumph of complexity over common sense.)

@ bob: sure, Apple has a lot of inter-team secrecy, but I think this is more a case of Apple server teams not having much to do with the Xcode teams. Server-side Swift basically isn't a thing, nor is appropriate Mac hardware, so they live in their own little ecosystem that probably isn't very Apple-esque.

Worth noting the existence of https://github.com/apple/pkl-swift - I've been told Swift et al has been supported since day 1.

Leave a Comment