Crystal 0.34.0 released

A new version of Crystal has been released, a compiled programming language with Ruby syntax, the main features of which are runtime with a “built-in” event loop, in which all I/O operations are asynchronous, support for multithreading (as long as it is enabled by a flag during compilation) and extremely simple and convenient operation with libraries in C.

Starting with version 0.34.0, the language officially begins to move towards its first real release (i.e. version 1.0).

The new version of Crystal includes the following changes and improvements in order of importance:

  • A new logging library has been added to the API log, which, unlike the old one, can send messages to different backends and filter these messages differently depending on the “source”.

  • Rudiments from the world of C development, Errno и WinError, used for I/O primitives, are becoming a thing of the past thanks to the exception hierarchy IO::Error (however, no one prohibits using Errno yet).

  • Removed automatic substitution of else nil from the operator case/when/else. This is done in order to prevent the developer from accidentally skipping one of the branches. When when matching on deterministic cases like enums and passing through types from Union. That is, simply put, this code will no longer work without specifying one more When (when Char) or tasks else-branches:

a = 1 || 'x' || "foo"
case a
when Int32
#...
when String
#...
end

  • Compiler option disable_overflow no longer available. For overflow operations, use the &+, &-, &* methods.

  • Array#fill now flies faster than a bullet, thanks to replacing the stupid loop with one simple memset;

  • Manager of shards (packages), called, paradoxically, shards, now uses the faster and more efficient Molinillo dependency satisfaction algorithm found in CocoaPods (Swift) and Builder (Ruby).

  • Added support LLVM 10, which in theory will give us some increase in productivity, stability, etc.

... and many other, in my subjective opinion, less significant improvements.

I would like to note that Crystal is a language built on LLVM, which allows you to write applications sometimes faster, simpler and more concisely than on its interpreted “brothers”, and at the same time get a fairly fast binary as a result. Compared to Golang, it stands out due to its absolutely full-fledged OOP, support for generics, and a very simple and understandable syntax. Its purpose is largely similar to Nim, but at the same time it is clearly focused on practical use “here and now”, thanks to which it has in its API arsenal many well-documented, convenient and high-quality tools, supported by the language developers and therefore very stable.

Source: linux.org.ru

Add a comment