Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Some of the “algorithms” libraries in C++ are very difficult to express in safe Rust and might require proc macros.

Most anything related to “intrusive linked lists” is difficult or outright impossible in safe Rust, but is commonly used in operating system code.





To be fair, one of the main reasons linked lists are used is that more advanced data structures are too hard at the OS level with C.

Intrusive linked lists have performance and robustness benefits for kernel programming, chiefly that they don't require any dynamic memory allocation and can play nice with scenarios where not all memory might be "paged in", and the paging system itself needs data structures to track memory statues. Linked lists for this type of use also have consistently low latency, which can matter a lot in some scenarios such as network packet processing. I.e.: loading a struct into L1 cache also loads its member pointers to the next struct, saving an additional step looking it up in some external data structure.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: