Programming

Apple presents an open source programming language: Pickle or Pkl

Apple presents an open source programming language: Pickle or Pkl

Apple has historically kept much of its software closed and proprietary. However, in recent years, Apple has shown a growing interest in opening its source code and contributing to the world ofopen source. In 2014, Apple introduced the programming language Swiftfor iOS and macOS app development, making it open source in December 2015.

The core of the operating system macOS is called Darwin and it is based on UNIX: part of it is open source. Also WebKitthe web browser rendering engine, opened in 2005.

Today Apple announced Street vendors (Pickle“cucumber” in Europen), an open source configuration management language that appears to be another move in the same direction.

What is the Pkl (Pickle) programming language and what is it for

Pkl, short for Pickleit’s new programming language open source developed by Apple for configuration management. It adopts a declarative syntax and promotes type safety, improving readability, reducing errors and enhancing configuration safety.

It is a language designed to simplify settings management, such as your phone’s brightness, your WiFi password, or the rules of a game. Rather than resorting to step-by-step instructions typical of imperative languagesPkl uses a key-value format similar to JSON.

The idea is to focus on defining desired states rather than defining specific actions, making configuration files easier to understand and maintain, especially for those who are less familiar with the scripting syntax.

At launch, Pkl supports JSON, XML, and YAML property lists to generate static configuration files.

Why does Apple focus on something that is apparently “niche”?

Reading the introduction to the use of the Pkl language, it is immediately clear that Apple technicians had already been using Pkl for several years internally within the company. Now, the company is open to community contributions and provides basic plugins for editors like Visual Studio Code e Neo’swhich offer syntax highlighting and code-level suggestions.

Not only. Pkl can already integrate with Java, Kotlin, Swift and Go right now. There is also the idea of ​​supporting other languages ​​in the future. The goal is to simplify configuration operations: from the smaller ones to the more extensive ones, from the simple to the more complex ones, from the “ad hoc” ones to repetitive activities.

The development team also states that Pkl wants to be more than just a support in the programmer’s workflow, at least when it comes to software configuration. Pkl can stand on its own as a configuration librarysafe, easy and pleasant to use“.

In short, Apple created Pkl because it believes that configuration activities are easier to express and manage using a mixture of static language and general purpose programming language. “The cucumber” wants to combine the best of both worlds, providing a declarative and simple to read and write language, enriched with features borrowed from general-purpose languages.

Those who use Pkl can therefore use features typical of traditional development languages: classes, functions, conditional statements and loops. You can share code in the form of packages, handle various configuration needs, produce static configuration files in any format, and runtime embed code as you would any library in another application.

Credit immagine in apertura: Microsoft Bing Image Creator.

Leave a Reply

Your email address will not be published. Required fields are marked *