What's often neglected is the excellent tooling around Rust, that alone is reason enough to switch from C++, where you have a really fragmented tooling ecosystem and you're often required to deal with complex Makefiles or build config as well as download dependencies manually. Most of that just disappears with Rust, unless you're developing code that interfaces with existing C/C++ libraries.
Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
181–190 of 307 posts
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#182Earlier quoted context omitted.
That is the current issue with most C++ codebases nowadays, I only see modern C++ on conference slides, when I look into codebases even from ISO C++ members, it is always C++ full of C idioms no matter what. I bet most candidates to C++ job offers end up discovering the hardly reality of existing code.
That's a fundamental C++ problem. That and all the other idioms it supports. C++ is really like 10 languages and you always have find a mentor to show you the specific one you're working with in a codebase.
How many styles do we now have on C#11, Java 20, Python 3.11, PHP 8.2,....?
This is why static analysis and linters are so relevant for keeping teams into a specific way of doing things, it is not like we can always justify start from scratch into simpler languages.
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#183What's often neglected is the excellent tooling around Rust, that alone is reason enough to switch from C++, where you have a really fragmented tooling ecosystem and you're often required to deal with complex Makefiles or build config as well as download dependencies manually. Most of that just disappears with Rust, unless you're developing code that interfaces with existing C/C++ libraries.
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#184> Rust is easy to learn. For seasoned C++ programmers, Rust is easy to learn. When they first start out, Rust learners usually spend most of their time making sense of ownership and lifetime. Even if they don't explicitly express these concepts in code, experienced C++ engineers always keep these two concepts in mind when programming in C++. Finally somebody understands this.
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#185Earlier quoted context omitted.
> However C++ smart pointers impose a run time performance penalty on your code. i'm not sure if this is the case. unique_ptr doesn't really do much other than use the type system to ensure that only one instance of the pointed-to value exists at once. as far as i understand, it doesn't strictly do anything at runtime.
I'm honestly not sure: can unique_ptr be used in place of a T* pointing to a stack-allocated object?
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#186As a hobby software engineer who mostly writes ETL jobs in Python the biggest selling point of Rust is Cargo. I usually use a lot of .clone() in my code and most of my fields are Strings which would make a seasoned Rust/C++ laugh at the code. However, the performance of novice Rust beats 10+ years of experience Python by a factor of 10 (favouring Rust). With Cargo I can build code that just runs. With Python it is al…
It sounds like you'd be better off with higher-level Haskell for these tasks.
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#187What's often neglected is the excellent tooling around Rust, that alone is reason enough to switch from C++, where you have a really fragmented tooling ecosystem and you're often required to deal with complex Makefiles or build config as well as download dependencies manually. Most of that just disappears with Rust, unless you're developing code that interfaces with existing C/C++ libraries.
There is plenty of C++ tooling for GPGPU, game engines, IDE, GUI programming, HPC,... that Rust still lacks.
In what concerns cargo, vcpkg and Conan are good enough, and support binary libraries, no need to compile everything from scratch.
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#188> Rust is easy to learn. For seasoned C++ programmers, Rust is easy to learn. When they first start out, Rust learners usually spend most of their time making sense of ownership and lifetime. Even if they don't explicitly express these concepts in code, experienced C++ engineers always keep these two concepts in mind when programming in C++. Finally somebody understands this.
Hot take, I feel like people that complain Rust is hard typically write bade code in other languages. Rust is just preventing you from making common mistakes or using patterns that make your code hard to reason about and debug later.
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#189Earlier quoted context omitted.
I disagree. Rust is not difficult because of lifetimes, it just gets in the way of freely prototyping what you want. This situation is slowly improving with the compiler getting better and better. Then there is some annoying macro usage. Some Rust code looks truly alien.
Rust isn't a prototyping language.
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#190Earlier quoted context omitted.
> It’s basically a compiler enforced set of C++ best practices. It’s strange how hostile some in the C++ community are to Rust. Well, the syntax is alien and new, it doesn't do OO the way 9 out of 10 working developers expect it to, almost all C++ popular design patterns have to be rejected, many of the claims("fearless concurrency") are exaggerated and the Rust evangelists are really really toxic when referring to C…
I've seen an order of magnitude more people complaining about Rust evangelists as I've actually seen Rust evangelists, and they've been significantly more hostile and toxic. The majority of Rust programmers I know were C++ programmers in the past. Many, including myself, use both professionally.