Live data from Hacker News

Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

risingwave-labs.com

171–180 of 307 posts

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#171

Earlier quoted context omitted.

Be a bit more charitable. :) Brain-dumping is simply a way to iterate and figure out what works and what doesn't, quickly. After I do it I take the requisite time to emulate exhaustive pattern matching, and add tests that cover the functionality well. My problem with Rust, and I love the language a lot, is exactly this: I want to quickly find what would work. After that I'm very happy to take the proper time to go th…

Yes and then someone comes along and makes a change that breaks something seemingly unrelated and it’s less likely to be caught because there is no type system. And please don’t say tests solve that because they don’t. They help but they don’t solve it.

You won't catch me arguing with that. I work both with dynamic and static languages and usually I'll pick the static ones.

Dynamic languages are very valuable when you can afford to iterate and gradually find out the golden path. For the better or the worse, many businesses are of that type.

That being said, I just ended an Elixir contract and absolutely want to code Go or Rust for money again.

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#172
post #36

Earlier 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.

Can you give some examples of problematic C idioms in C++?

Manipulating C style strings and arrays, instead of the respective C++ standard library classes, calling malloc()/free() directly all over the place.

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#173

> 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)

#174

10 seasoned C++ devs could probably make a killing in the finance sector right now.

Can you elaborate?

They (finances, hft, hedges) pay significantly more than FAANG, mostly with plain cash too.

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#175
post #82

Earlier quoted context omitted.

See Orthodox C++.

In the context of this thread, why would somebody starting a new project be choosing between Orthodox C++ and Rust?

Tooling, existing ecosystem, built during 40 years of production deployment.

Rust is naturally safer than C++, however there are still many domains where a bit of yak shaving is required before actually coding what one cares about.

So it boils down to where to spend resources, and as note, I am definitly not a fan of Orthodox C++ ideas, rather having C++ improve its safety story as much as possible.

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#176

> 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.

This, this, and this again. Lots of patterns Rust enforces are sensible choices even with a garbage collector, because data races for instance are still a thing even if you have automatic memory management

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#177

Earlier quoted context omitted.

See this is what I’m scared about in my current job. We have some people who want to use dynamically typed languages and some who want to use static. I don’t think being able to brain dump code is a good thing and it leads to an unmanageable mess when you have a large codebase. Types are essential as far as I’m concerned, but I constantly have to get into arguments with the dynamic type fans because their “flow” Is b…

Be a bit more charitable. :) Brain-dumping is simply a way to iterate and figure out what works and what doesn't, quickly. After I do it I take the requisite time to emulate exhaustive pattern matching, and add tests that cover the functionality well. My problem with Rust, and I love the language a lot, is exactly this: I want to quickly find what would work. After that I'm very happy to take the proper time to go th…

I do appreciate that you write tests. I find it's like pulling teeth with most devs to get them to write anything but the most basic of tests.

I tend to think more than write code, so usually my first go is reasonably close to what I need. But there are always edge cases you just never think about. I'd rather have a strong debugger than a repl imo

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#178

Fascinating how defensive C++ lifers can be. Rust builds on the knowledge of decades of C++ programming. It’s basically a compiler enforced set of C++ best practices. It’s strange how hostile some in the C++ community are to Rust.

> 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.

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#179

I wonder why people don't use Ada Programming Language also ? It has Spark subset for formal verification also

Does Ada have strong concurrency support and compile-time data race freedom?

Haskell does have both

Re: Building a Cloud Database from Scratch: Why We Moved from C++ to Rust (2022)

#180
post #4

> 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.

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.

It does because it repays you with extremely fast and safe code. Prototyping and performance are two concepts that do not mix.

I've seen way too many half baked attempts at making prototypes fast that do end up in complete rewrites.

Post reply on HN