Hacker News new | ask | show | jobs
by jtchang 180 days ago
Fundamentally is there anything you can't write in rust and must write in C? With AI languages should mostly be transposable even though right now they are not.
2 comments

Why rewrite something with multiple decades of validation and bugs-now-depended-upon-features?

Word and Excel almost certainly have 30 year old C++ code that #must-not-be-touched, bugs and all.

So they're going to port Microsoft Edge web browser to Rust?

Are they going to upstream their changes to the Google Chrome-codebase?

Mozilla seems to be doing well after inveting rust and rewriting firefox using rust
According to https://4e6.github.io/firefox-lang-stats/ , only 12.3% of Firefox is written in Rust.
Security. I know it's boring for most, but important for those who need to handle cybersecurity issues.
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.