published release of the programming language crystal 1.6 , the developers of which are trying to combine the convenience of developing Ruby with high application performance characteristic of the SI language. Crystal syntax is close to Ruby, but is not completely compatible with it, despite the fact that some Ruby programs are performed without processing. The compiler code is written in Crystal and is distributed under the license Apache 2.0. A clear indication of types of variables and arguments of the methods in the code. Crystal programs are compiled in executable files, with macros calculating and generating code during compilation. Crystal programs allow connecting binding written in SI. Code is parallelizing using the keyword “Spawn”, which allows you to start the background task in asynchronous mode, without blocking the main stream, in the form of lightweight flows called Fiber (Fiber)..
The standard library provides a large set of standard functions, including the CSV, YAML, and JSON processing tools, components for creating HTTP servers and supporting WebSocket. In the development process, it is convenient to use the “Crystal Play” command that forms web interface (by default Localhost: 8080) for interactive execution of the code on Crystal.
The main changes :
- changed The logic of overload – when overloading types of types are now considered before single types. For example, the execution of the code below will now display the value of True, and not ‘a’, as it was in past issues. Module Foo (T) End Class Bar1 Include Foo (Int32) End Class Bar2 Include Foo (Int32) End Def Foo (X: Foo (Int32)) ‘A’ End Def Foo (X: Bar1 | Bar2) True End Foo (Bar1 .New)
- For all platforms, the methods of #SYSTEM_ECHO and #SYSTEM_RAW are implemented, which allowed to convert the outdated macros FILEDESCIPTOR “COOKD_FROM_TC_MODE!”, “NoECHO_FROM_TC_MODE!” And “raw_from_tc_mode!”, And the methods #NOECHO! And #RAW! Now NIL is returned instead of libc.tcsetttr.
- Improved API File, which now returns the internal object (File: Info instead of Crystal :: System :: Fileinfo).
- Improved work in interpreter . To enable support for the interpreter, you can use the Make Interpreter = 1 command.
- The compiler and the standard library include new performance optimization.
- Improved support for Windows platform in the compiler, including Windows, the ability to assemble the interpreter and support MUTEX.
- Added support by Unicode 15.0 and implemented API to normalize sequences Unicode.