Drew DeVault, author of the Sway user environment, the Aerc email client and the SourceHut collaborative development platform, published a programming language release Hare 0.26.0. Hare is presented as a systems programming language close to C, but simpler than C. The source code of the compiler and toolkit is distributed under the GPLv3 license, and the standard library code is under the MPL (Mozilla Public License).
The language is optimized for solving low-level problems, such as developing operating systems, compilers, network applications and system utilities, which require maximum performance and full control over execution. The language uses manual memory management and a static type system, in which each variable must be explicitly assigned a specific type.
A minimal runtime is supplied to run the application, and a standard library of functions is distributed for development, providing access to the basic interfaces of the operating system, as well as offering functions for working with typical algorithms, protocols and formats, including tools for using regular expressions and encryption. To develop graphical applications, the hare-wayland toolkit is being developed, as well as bindings for accessing the capabilities of GTK, Vulkan, OpenGL, SDL3 and libui.
In new version:
- Added the loop construction “for(…){…} else {…}” and the ability to use the loop as an expression for assigning a value to the variable “item = for(…){…}”. The value that will be assigned to the variable can be returned when the loop is interrupted with the expression “break value” or through the indication “yield default_value” in the “else{…}” block attached to the loop, which is called if the loop was not interrupted with a break. const item = for (let sample .. items) { if (item.key == key) { break item; }; } else { yield -1; };
- Added the ability to use assignment to the value “_” to ignore error handling (if an error occurs, an assertion will not occur). _ = os::remove(“/some/file”);