Introducing Pkl: Apple's New Configuration-as-Code Language
If you haven't yet checked out Pkl (pronounced "Pickle"), it's time to take a look at this innovative open-source configuration-as-code language from Apple. Designed to blend the best of static and general-purpose programming languages, Pkl offers a powerful and flexible way to handle configurations.
What is Pkl?
Pkl is an open-source language programmed in Java, specifically designed for writing configurations in a programmable manner. This means that with Pkl, you can create configurations that are not only concise and validated but also capable of handling complex use cases.
Key Features
Native vs. JVM Versions
Interestingly, the Pkl documentation recommends using a native version instead of a JVM version. For those unfamiliar, a native version compiles Java bytecode to machine code, bypassing the need for a JVM at runtime. While this approach has its own pros and cons, it's an intriguing aspect that could be the topic of another post.
领英推荐
Installation and Tooling
Pkl comes with a Read-Eval-Print Loop (REPL) for experimenting and learning. For code editor support, Pkl currently integrates with IntelliJ, VS Code, and Neovim. I tried installing the VS Code plugin, and while it's a bit manual (you have to download and install the latest Visual Studio Extension (.vsix) file yourself), it's straightforward enough.
Final Thoughts
Pkl represents a significant step forward in the realm of configuration-as-code. By making configurations more programmable and manageable, Pkl stands to benefit the entire tech ecosystem. Whether you're looking to streamline your build processes or enhance the flexibility of your configurations, Pkl is definitely worth exploring.
You can learn more about Pkl and start experimenting with it by visiting their official website.