Why use Rust? The economic reasons

8 views
Skip to first unread message

Gabor Szabo

unread,
Mar 8, 2024, 4:26:27 AM3/8/24
to rus...@googlegroups.com
Hi,

A few ideas why to use Rust for the people who mostly care about the money and don't understand much about technology.

  • Reduced total cost of ownership - the compiler being so strict results in a less buggy software and we know fixing a bug in production costs a lot more than fixing during development.
  • Saving time in QA and test writing due to the type checking and the strict compiler.
  • Avoid unexpected cost due to safety issues. (A catastrophic bug in a spaceship or a security breach in a trading software)
  • Free reusable building blocks. C++ has some 2,300 3rd party libraries, Rust has 140,000 crates.
  • Easily distribute on multiple platforms. (Out of the box cross compilation)

What do you think?

See my video in Hebrew:  https://youtu.be/OMz5ur3C4XI

Diego Iastrubni

unread,
Mar 9, 2024, 7:21:13 AM3/9/24
to rus...@googlegroups.com
  • > Free reusable building blocks. C++ has some 2,300 3rd party libraries, Rust has 140,000 crates.

Those numbers are misleading.


But, the problem with C++ is that it got no standard build system, nor package manager. For example CrazeEddiesGUI is not available on both. QtSingleApplication is available in vcpkg, and not in connan. More anecdotal evidence can be found easily.

I am not saying that Rust more packages than C++, I am saying that they are more accessible without fighting with the package manager to get them integrated into your program. C++ has much much more packages than Rust. By far, I would say 100 times more. The integration of those packages in C++ is a pain, and in Rust due to the superior tooling is trivial.

--
You received this message because you are subscribed to the Google Groups "rust-il" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rust-il+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rust-il/CABe4FJC-Bapdrf8DRdQY60aFyBKq1v%3DF8Ch1%2BXt%2BMEFzGRzAFw%40mail.gmail.com.

Gabor Szabo

unread,
Mar 9, 2024, 9:53:32 AM3/9/24
to rus...@googlegroups.com
I should have worded more clearly, I meant that in the largest 3rd party system, that is vcpkg, there are 2396 packages.
You say there are 100 times more packages in C++ hat in Rust? That means about 14,000,000 packages in C++?
 (Compared to Python that has 520,000 https://pypi.org/ and 2,704,954 for JavaScript in npm.  See http://www.modulecounts.com/ )

I've never used C++, so how can one find all those other packages?

regards
    Gabor

Diego Iastrubni

unread,
Mar 9, 2024, 11:42:07 AM3/9/24
to rus...@googlegroups.com
Well, C++ (and C) is a complete mess. Its a wild west - and not standarized. Thinking about "packages" in this concept does not make sense. The amount of software is vestly huge and very hard to find. In my previous workplace, I used a set of libraries/programs that were developed from the 80s. Still compiled and working.

There is no central place for C/C++ libraries. You will "have to trust me on that". Also, comparing this to NPN is meaningless, since NPM contains trivial things (like https://www.npmjs.com/package/foreach or https://www.npmjs.com/package/left-pad ) which many other standard libraries in "better designed languages" have.

Comparing the number of C++ packages to JavaScript packages is like comparing Oranges to ... nails. Just does not make sense.

Again, the quality of the ecosystem in Rust, and useness of the libraries out of the box - is by far superior to C++/C. Also the usability.

(Note: I don't program in Rust, but "almost finished the tutorial" and played with Go,C,C++,Python,NodeJS and some other things)

--
You received this message because you are subscribed to the Google Groups "rust-il" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rust-il+u...@googlegroups.com.

Shai Berger

unread,
Mar 9, 2024, 1:26:38 PM3/9/24
to Gabor Szabo, rus...@googlegroups.com
On my debian-testing machine, searching for packages which define
themselves as implemented in C++ gives 4961 results. Things which are
"implemented in C++ and a program" are 3712. This is all grossly
inaccurate, e.g Qt doesn't have the "implemented-in::c++" tag.

In case you're interested,

aptitude search "~Gimplemented-in::c++ ~Grole::program"

is the search for C++ programs. "~G" is shorthand for "has tag" in
aptitude search (for all C++, just drop the second term).

Personally, I think the only reason to start a project in C++ these
days is if you have a team that's already proficient. And that, BTW, is
also the major reason not to use Rust -- your team is probably not yet
proficient, and proficiency will take time.

Gabor Szabo

unread,
Mar 10, 2024, 8:34:52 AM3/10/24
to Shai Berger, rus...@googlegroups.com
Thanks for these numbers about Debian packages, It helps quite a bit, though it is about
programs and not libraries.

On Sat, Mar 9, 2024 at 8:26 PM Shai Berger <sh...@platonix.com> wrote:
Personally, I think the only reason to start a project in C++ these
days is if you have a team that's already proficient. And that, BTW, is
also the major reason not to use Rust -- your team is probably not yet
proficient, and proficiency will take time.


And I think this is the classic chicken-egg problem or bootstrapping problem.

You will start a project in rust only if your team already knows Rust or that you can hire people who know rust,
and many people will only learn Rust if there are already jobs out there that require rust.

How did other languages - most notably Python - overcome this?

regards
    Gabor

Josh Reuben

unread,
May 26, 2024, 1:50:35 PM5/26/24
to rust-il
Why Rust, besides perf:
1. ergonomics -> dev joy -> retention
2. compiler fidelity -> auto-train devs to be better
3. forced quality -> massively lowers regressions, increases velocity
4. attract top talent
5. hygenic macros with TokenStream -> TokenStream as 1st class citizen ❤️ https://github.com/jreuben11/RustOrBust/tree/master/macros

The flipside of learning Rust: coding in other languages makes you cringe when you know there is a better, saner way !

- dynamic languages with opt-in typing (Python, Typescript) - slow, no threading, no type-safety
- C/C++ - no thread safety or memory safety
- golang - an abomination
- Java / C# - run on a GC VM (leaky & wasteful pause the world), NullPointerExceptions

My working hypothesis: If you put in a few 100 hours of learning, you will save 10,000 hours of regression fixing, late stage refactors
Reply all
Reply to author
Forward
0 new messages