Writing about threads

I am one of the few people here who knows both BeOS/Haiku and their style of C++, as well as Rust. Rust deeply tracks ownership of memory in a way C++ cannot do. It basically enforces good programming practices that have to be manually enforced in C++. Rust prevents data races and multiple threads accessing the same data at a core level.

Of all the operating systems, Haiku offers the most hope in doing threading in C++ with minimal errors, because the style of the API and structure of applications requires a message-passing style. It is still possible to screw up. Threaded programming is hard.

Haiku won’t ever become a Rust operating system. I like Rust, but it is really complicated, almost to the level of C++. If you want a Rust OS, check out Redox: https://www.redox-os.org/

As I said in the recent Rust thread here in the forums, I think Rust could have a place on Haiku. It could be a great system to write some really robust servers (in the sense of app_server and media_server, not web servers.) I think that long term Rust (and other languages) should become first class citizens for making Haiku apps.

But I don’t see the kernel being switched, nor large portions of Haiku being rewritten in Rust. It just isn’t worth it. But for cross-platform development of really fast applications, Rust is a better choice than C++ in my opinion. I intend to get our Rust port (we do have one) updated, and see what I can to start integrating it with some of the Haiku Kits. But this may take me some time.

5 Likes