Apple has announced the first release of Pkl (pronounced Pickle), a programming language for creating configurations.
When we think of configuration, we usually think of static languages such as JSON, YAML, or property lists. While these languages have their merits, they tend to fall short when the configuration becomes more complex. For example, the lack of expressiveness of these languages results in code that is often repetitive. In addition, it is easy to make mistakes in the configuration because these formats do not provide any validation.
To address these shortcomings, formats are sometimes augmented with auxiliary tools that add specialised logic. For example, it may be necessary to make the code more logical, so a special property is introduced that understands how to resolve references and merge objects. Or you need to guard against validation errors, so a new way is created to check the configuration value against the expected type. Soon these formats become almost programming languages, but ones that are hard to understand and hard to write.
Developers created Pkl because they believe that configuration is best shown as a blend between a static language and a general-purpose programming language. They want to take the best of both worlds; provide a language that is declarative and easy to read and write, but enhanced with features borrowed from general-purpose languages. When writing Pkl you can use familiar language features such as classes, functions, conditions and loops. You can create levels of abstraction and share code by creating packages and publishing them. Most importantly, Pkl can be used for a variety of configuration tasks. You can use it to create static configuration files in any format or embed it as a library in another application’s runtime environment.
Pkl was developed with three main goals:
- To provide safety by catching validation errors before deployment.
- To scale from simple to complex use-cases.
- To be a joy to write, with best-in-class IDE integrations.
- Generate any static configuration formats. Define all your data in Pkl and generate output for JSON, YAML, property lists and other configuration formats.
- Integrated application configuration. Embed Pkl into your applications for rantime configuration and get code generation for Java, Kotlin, Swift and Go.
- Incredible IDE integration. A great toolkit for writing Pkl with the same ease as statically typed languages. There are plugins and extensions for IntelliJ, Visual Studio Code and Neovim, and Language Server Protocol support is coming soon.
- Catch bugs before deployment. With rich type checking and validation, you can catch configuration errors before you deploy your application.
You can learn more about the language on the official website.
Mobile App Development Trends – 29.02
Working with dates and Codable, Fun with shapes in Compose, The missing guide to deep linking and more!
The open source StarCoder 2 model runs on regular GPUs
Companies are making more and more artificial intelligence-based code generators at an astonishing rate – services like GitHub Copilot and...
Google TV updates the homescreen
You may notice your apps taking a different shape on your Google TV For You screen.
Decompose – Kotlin Multiplatform lifecycle-aware business logic components with routing and pluggable UI
Decompose is a Kotlin Multiplatform library for breaking down your code into tree-structured lifecycle-aware business logic components (aka BLoC), with...
Mobile App Development Trends – 28.02
How to use VariadicView, Comprehensive Guide To Kotlin Context Receiver, OWASP Mobile Top 10 and more!
GitHub opens access to Copilot Enterprise
Copilot Enterprise includes all the features of the existing Business plan, including intellectual property indemnification, but extends it with a...