Re: The Case for Rust (in any system)

From: Yuri <yuri_at_FreeBSD.org>
Date: Thu, 12 Sep 2024 19:25:53 UTC
Hi Alan,



No, I don't think that Rust delivers on its promises.


I program all the time, on a daily basis.


Rust has many very serious shortcomings:


1. Rust doesn't have exceptions. In practice this means that the 
programmer needs to manually write a lot of code to handle all sorts of 
failure conditions in complex code. This leads to a lot more code being 
necessary to achieve the same project objectives. When in C++ an 
exception is simply thrown and caught, in Rust you have to write all the 
underlying checks manually. I know from practice that the number of bugs 
is roughly proportional to the amount of code.


2. The Rust code might not cause segmentation faults, but during error 
processing the programmer often has to write wrap() functions which fail 
with error messages practically equivalent to segmentation faults in 
C/C++. The end result is the same for the user - the process fails or 
aborts in the middle.


3. The code written in Rust is a lot less expressive. What can be 
expressed with a very short and elegant C++ code in Rust has to be 
written in a lot more explicit way with a lot more lines. I practically 
experienced this with the Rust Ratatui TUI library when everything takes 
a lot more lines compared to an equivalent FTXUI C++ TUI library.


The above 3 shortcomings makes Rust a no-go solution for me.


Not long ago I tried to write a TUI program using Rust and I found the 
hard way that it is simply a lot easier to achieve with C++ and FTXUI 
than with Rust and Ratatui.


There are nice things about Rust too. One nice thing is that Rust has a 
nice development ecosystem when all Rust packages are registered in one 
place, and are discoverable in the same fashion, unlike C++ packages 
that are all over the place.


Investors, especially fintech investors, get sold on Rust because they 
believe that the Rust code is a lot safer. But these investors are not 
engineers themselves, and they have no first hand experience with Rust. 
They simply rely on opinions of others. Fintech startups use Rust as a 
selling point for their enterprises. The more selling points they list - 
the more likely they get an investment. Everything helps when it comes 
to this.


Given the above shortcomings, Rust in practice is not a better language 
overall.


Please just put this idea to rest.


Thanks, but no thanks.



Yuri