As far as I can tell, modern C++20/23 is as safe (if not safer) than rust. So much of rust compares itself to C++99, where modern C++ doesn't use exceptions, has smart pointers (RAII), improved casting and array management, and has an extensive suite of checking tools and flags. The conversations I've seen at my company for using rust tend to be "well it would be tun to do something different", which just aren't very…
Why we develop EloqDB mainly in C++
41–50 of 94 posts
Re: Why we develop EloqDB mainly in C++
#42I guess the Rust workforce is tiny, opinionated and mentally demanding.
Re: Why we develop EloqDB mainly in C++
#43Earlier quoted context omitted.
They do list specific reasons in the article... One, C/C++ interop is a priority since they will interoperate with a large variety of C/C++ APIs (sounds like one of the main points of their project is to integrate things that are largely implemented in C/C++). Two, they say their aim is "building a lasting system that will support decades of continued improvements." You want confidence that 99.9% of the code you writ…
The list of reasons is very weak and no point is actually prohibitive against the usage of Rust.
Re: Why we develop EloqDB mainly in C++
#44Re: Why we develop EloqDB mainly in C++
#45Re: Why we develop EloqDB mainly in C++
#46It sounds like the rationale is that existing database technology is already written in it, and they want to re-use some of it. That's reasonable, but I do think that it only makes sense with the assumption that the flaws in C++ aren't large enough to be worth using something else, at which point there isn't really much need to justify using C++ at all. If someone is concerned about the flaws in C++, the benefit of r…
Another factor to consider is that, if one is indeed trying to reuse code from existing databases (regardless of the reason for doing so), code from projects like Sqlite and FoundationDB is simply far less likely to contain serious bugs than any newer Rust-based option. There are way more mistakes one can make when writing a database than just memory safety mistakes, and the mistakes tend to be extremely subtle. Code having been run in production for long periods of time under significant amounts of load is basically a fundamental prerequisite for it to make any sense to trust the data of your users to it.
Re: Why we develop EloqDB mainly in C++
#47Earlier quoted context omitted.
The list of reasons is very weak and no point is actually prohibitive against the usage of Rust.
It's really not clear on what basis you brush away their reasons. Just calling them "very weak" with nothing to support it doesn't mean much.
Rust interop to the libraries they list is not an issue.
If you are good at c++ and want to continue building software in c++ it is fine. Just be honest about it.
Re: Why we develop EloqDB mainly in C++
#48> memory unsafeness, can be significantly mitigated when developing with a certain modern subset of the C++ language. Right. > Most existing and popular databases are developed in C/C++, providing a wealth of resources and innovations we could leverage. Right. But two rights can make one wrong. How are you enforcing 'good part of C++' when you're interoperating with others' code?
Encapsulation. This is our code. That is their code. Depend only on the interface of their code and not the implementation. You can look at their code for curiosity but don't depend on the implementation of their code in our code. Then you don't care what subset of the language their code is written in.
Re: Why we develop EloqDB mainly in C++
#49Re: Why we develop EloqDB mainly in C++
#50As far as I can tell, modern C++20/23 is as safe (if not safer) than rust. So much of rust compares itself to C++99, where modern C++ doesn't use exceptions, has smart pointers (RAII), improved casting and array management, and has an extensive suite of checking tools and flags. The conversations I've seen at my company for using rust tend to be "well it would be tun to do something different", which just aren't very…
Running sanitizers and such is quite expensive too. It burns a lot of cycles to run msan, asan, tsan, valgrind, etc.
Whereas catching these bugs at compile time saves everyone a lot of time and money.
TBH I don't find the reasons in the article particularly compelling. Rust has a lot of industry backing now and is pretty clearly the way forward to systems programming. Writing Rust wrappers over the various libraries they use is largely a one-and-done issue, and they can publish them to Cargo and share the load of keeping them updated. If ISO or various governments get their act together with a real software liability regime or cyber security requirements, companies with big legacy C++ code bases will be in a tough spot. Second best time to start writing safe code in your project is now.