Drew Devolt announced the release of a new version of the programming language Hare 0.24.2. Devolt is the creator of the user environment of SWAY, ARC postal client, and the joint development of Source Hut.
Hare is positioned as a system of systemic programming, which is close to C, but much easier. The source code of the compiler and tools is distributed under the GPLv3 license, and the code of the standard library under the MPL (Mozilla Public License) license.
Here are the main changes:
- Now Hare supports the NETBSD platform, which expands the support of HARE platforms to all three main BSD displacements: NetBSD, OpenBSD, and FreeBSD, as well as Linux.
- An important addition to Hare 0.24.2 became For-Each cycles. The function allows you to more conveniently and easier to sort out the elements of arrays and slices. Now it is possible to iterate both by the elements themselves and by signs on them.
An example of filtering by the elements of the array:
let items=[1,2,3,4,5]; for (let item..items){ FMT::Println(item)!; }
- Now the functions in Hare can determine the default values for optional parameters. This is done for convenience and flexibility when calling functions. For example, the Example function can now take a second parameter with a default value:
fn Example(X:Int, Y:Int=34) VOID = {//…}; Example(12); // equivalent to call Example(12, 34);
- The Bufio module, designed to improve the productivity of input and output due to buffering, has received significant improvements. Many problems with copying of memory have been eliminated, which significantly increased performance. This is especially important for I/O-dependent HARE programs.
- Now REGEX:: supports a multiple alternative, which completes the implementation of Posix Extended Regular Expressions. The innovation allows you to use templates like (Ha|py|SH), doing work with regular expressions more flexible.
- To improve multiplyness and the interaction between the processes on UNIX, support for common memory structures was expanded. SHM_OPEN functions and compatible with LIBC for all supported platforms have been implemented, which allows the programs on HARE to use POSIX common memory for interacting with programs on C.
/Reports, release notes, official announcements.