3 ms·
- DuckDB is written in C++ - SQLite is written in C I wouldn't consider any of those written in a memory safe language. Although SQLite has been battle hard
by de6u99er 3y ago
- DuckDB is written in C++
- SQLite is written in C
I wouldn't consider any of those written in a memory safe language. Although SQLite has been battle hardened over many years, while DuckDB is a relatively new project.
That being said, has been efforts of reimplementing SQLite in a more memory safe language like Rust.
e.g. https://github.com/epilys/rsqlite3 https://github.com/epilys/rsqlite3
- deleted 3y ago[deleted]
- kristjansson 3y agoAt the level of engineering of SQLite, the choice of language is almost immaterial. Suggesting a low effort transpilation is a competitive peer seems unserious and vaguely disrespectful.
- forgotpwd16 3y ago>Finally, one of the best written software paired with one of the best writable programming language‽ Fearless and memory safe, since the uncountable amount of unsafe {} blocks makes you not care anymore. Plus it seems project is a parody of the RiiR trend.
- ttfkam 3y agoThe CVE list would dispute that assertion. There's a reason Microsoft is rewriting parts of the Windows kernel in Rust, and it isn't trendiness or because the kernel is at a trivial level of engineering. It's the same reason Torvalds refused to have C++ anywhere near the Linux kernel but is not accepting patches in Rust. The advantage of C is its transparency and simplicity, but its safety has always been a thorn in the industry's side. RiiR has become a bit of a parody of itself, but there is a large grain of truth from where that sentiment was born. Life is too short for segfaults and buffer overruns.
- paulddraper 3y agoto be clear, OP said > I just don't understand why someone would start something in a memory unsafe language these days. It takes a lot of time and testing to iron out all the bugs. Not impossible. Just takes a lot of time and testing.
- golergka 3y agoC has known memory footguns. C++, due to it's complexity, has footnukes.
- cmrdporcupine 3y agoNo, I actually think the opposite. In most C++ environments you will have std::string, STL vectors, unique_ptr, and RAII generally. Cleaning up memory via RAII discipline is standard programming practice. Manual frees are not typical these days. std::string manages its own memory, and isn't vulnerable to the same buffer overflow/null terminator safety issues that C-style strings are. While in C you will be probably using null-terminated strings and probably your own hand-rolled linked list and vectors. You will not have RAII or destructors, so you will have manual frees all over. Perhaps the big difference is that due to the nature of the language, C developers on the whole are probably more careful.
- ttfkam 3y agoI started coding professionally in C++ back around 2000. Many things have improved in C++ such as the items you list above, but C++ remains a viciously complicated language that requires constant vigilance while coding in it, especially when more than one thread is involved. CloudFlare is not lacking in good engineers with tons of both C and C++ experience. They still chose Rust for their replacement of Nginx. Now their crashes are so few and far between, they uncover kernel bugs rather than app-level bugs. https://blog.cloudflare.com/how-we-built-pingora-the-proxy-that-connects-cloudflare-to-the-internet/ https://blog.cloudflare.com/how-we-built-pingora-the-proxy-t... > Since Pingora's inception we’ve served a few hundred trillion requests and have yet to crash due to our service code. I have never heard anything close to that level of reliability from a C or C++ codebase. Never. And I've worked with truly great programmers before on modern C++ projects. C++ may not have limits, but humans writing C++ provably do.
- cmrdporcupine 3y agoI'm not sure who you're arguing against, but it's not me, or it's off topic completely. The discussion and my reply was not between C/C++ and Rust, but between C and C++. I'm a full-time Rust developer FWIW. But I also did C++ for 10 years prior and worked in the language on and off since the mid-90s. Nobody is arguing in this sub-thread about Rust vs C++, nor am I interested in getting into your religious war.