A new version of Crystal has been released, a compiled programming language with Ruby-like syntax, whose main features include a runtime with an 'embedded' event loop in which all input-output operations are asynchronous, support for multithreading (currently enabled with a flag at compile time), and an exceptionally simple and convenient way to work with C libraries.
Starting from version 0.34.0, the language officially begins its steady march towards its first real release (i.e., version 1.0).
In the new version of Crystal, the following changes and improvements can be noted in order of their importance:
A new logging library has been added to the API Log, which, unlike the old one, can direct messages to different backends and filter these messages differently depending on the 'source'.
Remnants from the world of development in C, Errno and WinError, previously used for input-output primitives, fade into the past thanks to the exception hierarchy IO::Error (however, no one has prohibited the use of Errno yet).
The automatic insertion of else nil from the case/when/elseoperator has been removed. This is done to exclude the accidental omission by the developer of one of the branches block when matching on deterministic cases like enums and traversing types from a Union. In simpler terms, such code will no longer work without specifying another block (when Char) or defining a else-branch:
a = 1 || 'x' || "foo"
case a
when Int32
# …
when String
# …
end
The compiler option disable_overflow is no longer available. For overflow operations, use the methods &+, &-, &*.
Array#fill now runs like a bullet, thanks to replacing the clumsy loop with a single simple memset;
The shard manager (packets), paradoxically named shards, now uses a faster and more efficient dependency resolution algorithm called Molinillo, borrowed from CocoaPods (Swift) and Builder (Ruby).
Support added LLVM 10, which should ideally give us some performance and stability improvements, etc.
… and many other, in my subjective opinion, less significant improvements.
It's worth noting that Crystal is a language built on LLVM, allowing you to write applications sometimes faster, simpler, and more concisely than with its interpreted "siblings", while still producing a fairly swift binary. It stands out against Golang with full OOP support, support for generics, and a very straightforward and understandable syntax. Its purpose is quite similar to Nim, but it is clearly aimed at practical application "here and now", which is why it has a wealth of well-documented, user-friendly, and high-quality tools in its API arsenal, supported by the language's developers, making it quite stable.
Source: linux.org.ru
