Just noticed that their website says support for Haiku is planned!
I think itâs worth mentioning some progress is being made there.
https://harelang.org/documentation/install/#supported-platforms
Latest release:
New to Hareâs list of supported platforms is NetBSD, thanks to the hard work of Mallory Adams â who is now counted among the upstream maintainers of Hare to ensure this target remains in good working order for the foreseeable future. This expands Hareâs platform support to include all three major BSD derivatives â NetBSD, OpenBSD, and FreeBSD â and Linux.
Can anyone find the license terms to any of either Hare or the QBE backend it uses? It doesnât seem to be posted anywhere on the c9x.me webpage.
EDIT:
The Mac version on GitHub lists the license terms.
From a casual âFrequently Asked Questionsâ browse -
Can I use multithreading in Hare?ď
Probably not.
We prefer to encourage the use of event loops (see unix::poll or hare-ev) for multiplexing I/O operations, or multiprocessing with shared memory if you need to use CPU resources in parallel.
It is, strictly speaking, possible to create threads in a Hare program. You can link to libc and use pthreads, or you can use the clone(2) syscall directly. Operating systems implemented in Hare, such as Helios, often implement multi-threading.
However, the upstream standard library does not make reentrancy guarantees, so you are solely responsible for not shooting your foot off.
Doesnât say what the issues would be. C doesnât have a lot of intrinsic support for threads, but I donât think a C authority would say âprobably notâ to that question. I would expect problems if thereâs a runtime that handles memory allocation etc., but it sounds like it doesnât have that. I donât know. Anyway, thatâs the main reason Iâm drifting away from Ocaml lately, because while it can run the Haiku interface window threads, it canât really run them fully concurrently because they need exclusive access to the runtime while running Ocaml code. So it can get stuck in one thread, and then windows donât get redrawn etc.
There sure are a lot of languages in the works these days.
I think most C standard libraries are re-entrant, though it may require some OS specific support. Newlibc (used for embedded C) requires a bit of work to get re-entrancy supported for things like the print functions and memory allocation, but itâs pretty easy to do. For newlibc you have a few different options, their docs suggest you carry some state around in each thread and add some code to your scheduler, but you can also just override all the memory allocation functions with re-entrant ones from your RTOS and replace the printf family with one that doesnât do heap allocation for float printing.
Personally I would hesitate to learn a new language that doesnât support multi threading⌠but itâs always good to see new development on haiku!
The QBE (MIT licensed) backend that Hare uses may be worth more than the Hare language itself. It implements static single-assign architecture (SSA) like LLVM but doesnât have âkitchen sink disorderâ feature lists like LLVM has. There are some patches in QBE that will allow it to use 32-bit processors as well as 64-bit soon whenever they clear the backlog of 30+ proposed patches in the patch list.