New languages ​​for cloud computing – from configuration management to Python dialect

Programming languages ​​are growing like mushrooms after rain – the more tasks a programmer has, the greater the need for new tools. The authors of these languages ​​strive to rethink the status quo or create specialized languages ​​designed to solve specific problems. Today we have prepared a compact selection of promising tools focused on working with cloud technologies.

Cloud languages ​​allow you to effectively manage distributed resources, taking into account the need to process large volumes of data and ensure scalability without loss of performance.

Clio

Clio is a functional, parallel and distributed programming language that compiles to JavaScript. By default, it divides tasks between several processor cores and can work with network resources, so it’s easy to run code on clusters and in the cloud.

If we talk about Clio's capabilities, it supports lazy or deferred calculationsand also pure functions. At the same time, the language is several times faster than JavaScript. Thus, the performance of Clio when searching for prime numbers by enumerating divisors is 139 operations per second, while for JS this parameter is 41 operations per second. At the same time, on the task of calculating the thousandth Fibonacci number, the speed of Clio is comparable to the C language.

Clio implements a consistent typing system, where some variables are strongly typed while others remain untyped, and errors are caught at runtime. Checking occurs using the @check decorator. Decorators in Clio can also be useful for documenting functions in a JSDoc style.

In general, one can note the minimalistic and beautiful syntax of the language, for example, the intuitive use of the -> symbol to describe the nesting of functions. Thus, the construction h(g(f(a))) in the context of Clio can be written as a -> f -> g -> h. For example, parallel calculation of the Fibonacci series can be done as follows:

fn fib n:
  if n < 2: n
  else: (fib n - 1)
      + (fib n - 2)
export fn main argv:
  [39 40 41 42]
    -> * [await] |fib|
    -> * (console.log @item)

At the same time, some developers called compilation in JS a disadvantage. In their opinion, compiling into binary format would expand the scope of the language, especially in the context of high-performance applications.

Ecstasy

Programming language for cloud computing, co-authored by a former Oracle vice president. The project is distributed under the Apache 2.0 license, and its latest version at the time of writing (v.0.4) was released in 2022.

Ecstasy belongs to the C family of languages ​​and will be understandable to developers writing code in Java or C#. Those who work with Kotlin, Erlang, Elixir or Ruby will also have no difficulty understanding it. For example, classic Hello World on Ecstasy looks like this:

module HelloWorld
    {
    void run()
        {
        @Inject Console console;
        console.println("Hello, World!");
        }
    }

As you can see, Ecstasy does not handle I/O operations directly. Instead, it relies on third party dependencies such as the Console interface. The @Inject Console console line provides access to the console, allowing console.println(“Hello, World!”) to print text to the screen.

The project developers focused on security, scalability and code portability. Ecstasy uses a type-safe modular system that minimizes incidents due to program changes. The project also implements a container model that protects the environment from the code running in it.

Among the advantages, users note such functions as currying and automatic narrowing of types.

Wing

A cloud-oriented programming language that began as a fork of the AWS Cloud Development Kit (CDK) project. Distributed under the MIT license. According to the authors, Wing allows developers to focus on writing code rather than setting up cloud infrastructure. Once compiled, Wing generates a package of artifacts ready for deployment to the cloud provider.

The project is based on several products. Wing Console is an editor for writing code, debugging and testing, Wing SDK is a set of tools for cloud and local development, and Wing Cloud Library is a library that allows you to write code portable to the cloud.

Wing code is cross-platform compatible using the CDKTF library, which allows you to describe infrastructure using high-level programming languages ​​and then translate that code into Terraform configurations. In general, for the same purposes you can use frameworks in JavaScript or Python – Pulumi and Shuttle.

The advantages of PL include clear documentation that can be found in the repository.

KCL

KCL is a functional language introduced by the Cloud Native Computing Foundation (CNCF). Designed for configuration management in cloud and scale-out environments. Distributed under the Apache 2.0 license. The latest version is v.0.9, released in 2022.

Language offers many tools for formatting, testing, documenting and managing packages – IDE extensions, multilingual SDKs for Rust, Go, Python, Java and Node.js. KCL easily integrates with various languages, formats and cloud tools.

For example, the kcl vet tool validates Terraform plan files, and import generates KCL schemas from various sources.

This is what generating a Kubernetes manifest might look like:

apiVersion = "apps/v1"
kind = "Deployment"
metadata = {
    name = "nginx"
    labels.app = name
}
spec = {
    replicas = 3
    selector.matchLabels = metadata.labels
    template.metadata.labels = metadata.labels
    template.spec.containers = [
        {
            name = metadata.name
            image = "${metadata.name}:1.14.2"
            ports = [{ containerPort = 80 }]
        }
    ]
}

For those who wish to become more familiar with the syntax, the developers have prepared sandboxin which you can run your program on KCL. And in repositories There are several code examples for setting up cloud configurations.

Pycopy

Pycopy is a lightweight alternative to CPython designed to work on microcontrollers and embedded systems, but can also be used to work in the cloud.

The principles of the language are simplicity, minimalism and lightness. The project is distributed under the MIT license.

Pycopy implements all Python 3.4 and async/await syntax from Python 3.5, and also provides basic data types (e.g. bytes, tuple, list, dict). It can execute scripts either as text source code or from precompiled bytecode.

The Pycopy core, built in C, provides a set of built-in modules. Further expanding the Pycopy ecosystem is the pycopy-lib library, which is adaptable for various platforms. It supports separate modules that can be used independently. Many libraries in Pycopy are prefixed with u (for micro), indicating that they are simplified versions of their CPython counterparts and are suitable for resource-constrained environments.

Chapel

Chapel is a programming language designed to simplify parallel computing. Suitable for running programs both on a PC and on clusters in the cloud and supercomputers. Was developed Hewlett Packard Enterprise and is licensed under the Apache 2.0 license.

Chapel is built on a multi-resolution philosophy. It allows you to write code from high-level abstractions and add detail as needed. This approach speeds up prototyping and simplifies code reuse, similar to Python or MATLAB, while achieving the performance of lower-level languages ​​(such as C or Fortran).

Simple program Hello World in Chapel it looks like this:

chapel
writeln(«hello, world»);

Also Hello World can be written in a more structured style by explicitly defining a module, a configuration constant, and a main() procedure.

module Hello {
  config const message = "Hello, world!";
  proc main() {
    writeln(message);
  }
}

One of the projects written in Chapel is a search engine Search. It is designed for full-text file search and supports advanced search features such as fuzzy matching, regular expressions. Chearch is optimized for working with large codebases or text data sets.

Chapel is quite powerful and can change the landscape of parallel computing.


Cloud services free for 2 months – get access to a reliable virtual infrastructure and launch services in the MWS cloud without startup costs.

Similar Posts

Leave a Reply

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