News for hackers. Stuff that matters.
Re:From Zero to Main(): Bare Metal Rust by cyphar on Tuesday December 17, 2019 @10:04PM (#21821390)
> In C the cost of everything is very explicit, in Rust it’s very easy to end up with an inefficient binary.

I will admit when I first picked up Rust, I struggled with feeling as though the code I was writing was too abstract and I had no idea what the compiled code would look like. But if you actually look at the performance characteristics of things such as Rust's default hashmap you find it's more efficient than most hashmaps in C code (because AVL trees are easier to write correctly in C, but B trees are faster and in Rust users can be sure they're using them safely).

> unsafe blocks seem to defeat the purpose of Rust. It’s like building a proof on top of lemmas that are just random guesses.

Not really, (using your analogy) unsafe blocks are more like human-checked proofs while everything else is machine-checked proofs. Obviously the humans doing the checking of the unsafe blocks can make mistakes (hence why you should minimise it), but unsafe blocks still must obey Rust's memory model.

> Clean builds of my test project are very slow.

Yeah that is still a noticeable problem. But to their credit, they have been slowly improving compile times for several years now.

Re:From Zero to Main(): Bare Metal Rust by tick_tock_tick on Wednesday December 18, 2019 @02:40AM (#21822721)
For the first point it's more that a single instance of panic! in your code will balloon your binary size
Re:From Zero to Main(): Bare Metal Rust by cyphar on Wednesday December 18, 2019 @12:39PM (#21827239)
Am I missing something -- shouldn't "panic = <some_c_func>" (in Cargo.toml) solve that problem?