"The STL library lacks support for some modern programming tools, for example, native co-routine support. As a result, developers must rely on many community projects, and most lack long-term support." I couldn't agree more with this comment. As great as the community is, there's a lot of projects that are just not maintained. I wish this was different.
Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
31–40 of 307 posts
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#32> But as more and more engineers joined us, some shortcomings > of C++ came to bite us: unreadable coding style, memory leak, > segmentation fault, and more. * unreadable coding style: This is not a C++ problem. * memory leak: Memory leak is an old C++ problem, since C++11 there is no reason for not using smart pointers. The only point that could be attributed to C++ is the segfaults perhaps, due to its lack of safet…
Sadly there is, lack of security culture and plenty of devs won't allow them on a PR.
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#33> But as more and more engineers joined us, some shortcomings > of C++ came to bite us: unreadable coding style, memory leak, > segmentation fault, and more. * unreadable coding style: This is not a C++ problem. * memory leak: Memory leak is an old C++ problem, since C++11 there is no reason for not using smart pointers. The only point that could be attributed to C++ is the segfaults perhaps, due to its lack of safet…
> since C++11 there is no reason for not using smart pointers There are many reasons for not using smart pointers, first amongst them for me being performance. Smart pointers do allow you to remove a large class of memory bugs from your code (albeit not memory leaks) in the same way that Rust's safe references do. However C++ smart pointers impose a run time performance penalty on your code, whereas in Rust the check…
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.
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#34"The STL library lacks support for some modern programming tools, for example, native co-routine support. As a result, developers must rely on many community projects, and most lack long-term support." I couldn't agree more with this comment. As great as the community is, there's a lot of projects that are just not maintained. I wish this was different.
Boost ASIO has some coroutine support. I would not call it a hobby project either.
Also seastar comes with coroutine supports[1], and incidentally it was written for a very high performance C++ database implementation.
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#35Building a database is brave or stupid or both. Over the last 15 or 20 years I’ve tried lots of databases of all flavors and every time come back to Postgres. What can’t it do. And like Linux it’s written in C. Not that means much. “Never bet against Postgres”.
There was also Informix, SYBASE and DB2, but those hardly matter nowadays.
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#36Author quoted C/C++, I immediately knew what conclusions I’d find. If on the other hand they had seasoned C++ devs (instead of C/C++), they might have had a different outcome.
I bet most candidates to C++ job offers end up discovering the hardly reality of existing code.
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#37Forget unique pointer or smart pointers. People had been coding in C++ far before that without fearing memory leaks by following RAII principals.
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#38- Seasoned devs but they never heard of clang tidy/format - Memory leaks on a new db codebase where each component should have clear ownership of data or pass to the next pipeline/stage - you dont even need smart poirters here, just a half decent design. - I am not even going to mention sanitizers, probably rocket science for them
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#39Building a database is brave or stupid or both. Over the last 15 or 20 years I’ve tried lots of databases of all flavors and every time come back to Postgres. What can’t it do. And like Linux it’s written in C. Not that means much. “Never bet against Postgres”.
Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)
#40"The STL library lacks support for some modern programming tools, for example, native co-routine support. As a result, developers must rely on many community projects, and most lack long-term support." I couldn't agree more with this comment. As great as the community is, there's a lot of projects that are just not maintained. I wish this was different.
C++20 comes with coroutines, no?