Why Rust for safe systems programming?

RazvanN razvan.nitu1305 at gmail.com
Wed Jul 24 08:24:45 UTC 2019


On Wednesday, 24 July 2019 at 07:54:54 UTC, IGotD- wrote:
> On Wednesday, 24 July 2019 at 03:45:45 UTC, zoujiaqing wrote:
>> Why Rust for safe systems programming:
>> https://msrc-blog.microsoft.com/2019/07/22/why-rust-for-safe-systems-programming/
>>
>> Can DLang be disabled for GC, or is it necessary to disable 
>> it? Of course, many people do not like betterC.
>
> "Rust provides the performance and control needed to write 
> low-level systems, while empowering software developers to 
> write robust, secure programs."
>
> I have tried to write low level programming with Rust and this 
> is the part where Rust is absolutely awful. Rust is fine for 
> application programming in an existing OS but for low level 
> stuff it is a dead end.
>
> Low level programming, system programming, OS programming or 
> whatever you want to call often requires another way of 
> programming. Intrusive algorithms are common in order reduce 
> memory fragmentation. Pointer tricks are common. Look at Linux, 
> loads of pointers pointing around to different structures, 
> often in a circular manner. Here Rust will be totally lost. You 
> can do raw pointer programming with Rust but then the borrow 
> checker is out of commission and you have to manually track the 
> memory, then the point of Rust is pretty much gone.
>
> I tried to write a few algorithms in Rust that I usually use in 
> embedded system. It was incredible difficult, even more 
> difficult and less verbose than C++. I gave up on Rust. I tried 
> the same algorithms in D and it was very easy in comparison, 
> even more easy than C++ and I'm not even good D programming.
>
> I don't really care about the memory management in Rust, as 
> memory management is very specialized in embedded systems 
> anyway. What is for me much more important are the bounds 
> checking.

If you are interested in low level programming in D, me and Edi 
Staniloiu
had a bachelor student port a linux network driver (virtio-net) 
in D ...
and it worked. The improvements were: (1) bounds checking and (2) 
using templates instead of void* thus making this particular 
driver @safer.

You can check out the implementation [1] and also the student's
talk at Dconf [2].

Cheers,
RazvanN

[1] https://github.com/alexandrumc/linux/tree/initial-poc
[2] 
https://www.youtube.com/watch?v=weRSwbZtKu0&list=PLIldXzSkPUXWORGtUrnTo2ylziTHR8_Sq&index=14



More information about the Digitalmars-d mailing list