Live data from Hacker News

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

risingwave-labs.com

301–307 of 307 posts

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

#301

Earlier quoted context omitted.

I guess it depends on your point of view. For me, having Rust catch issues even when prototyping makes me enjoy prototyping more. I absolutely hate (even when prototyping) when I try to run something, it chugs along for a bit, and then hits a runtime error due to some stupid typo. In fact I like Rust for prototyping precisely because I don't yet have tests, and the extra compiler diligence frees me to focus on the pr…

> and then hits a runtime error due to some stupid typo. I don't think that the parent comment implied prototyping in dynamic languages but rather in statically compiled ones. FWIW in C or C++ you don't have to do as much code gymnastics to satisfy the compiler so consequently prototyping is both faster and easier when compared to Rust.

Again for me personally, I find the opposite true. With C and C++ I'll find that once in a while, quick sloppy coding gets me something that seems to work for a bit and then fails in subtle and hard to debug ways. That's a time sink that just doesn't exist when I whip something together in Rust.

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

#302

Earlier quoted context omitted.

> ...it has a much better user story around build & package/module/library management Cargo sure does, but support for rust outside of cargo is much, much worse than equivalent support for C and C++. It doesn't matter for self-contained projects like simple Makefile ones, but at large scales, moving everything to cargo doesn't seem reasonable right now. Maybe eventually?

This is the one issue I personally have with C++. How do I `pip install boost`?

Use your OS's package manager.

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

#303
post #283

Earlier quoted context omitted.

Think you're misunderstanding the OP. Do you think rust is hard to use?

The OP is crapping on people who find Rust hard to learn by broad-brushing them into the "bad programmer" bucket. It's a hallmark of Rust zealots, and one reason why the Rust community has such a bad name. Which is a shame because the language is decent and useful.

Fair enough, it's an elitist attitude!

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

#304

Earlier quoted context omitted.

Can you point me to any significant primarily rust codebase that runs sanitizers? I've never heard of that. Unless you mean miri.

Not miri. I mean the actual ASAN, UBSAN, TSAN, MSAN and LSAN sanitizers that are also commonly used in C and C++ codebases. Descendant is the same: LLVM [1] > Can you point me to any significant primarily rust codebase that runs sanitizers? I've never heard of that Not sure what do you mean by that, surely there are. At least the ones who are serious about the development. Sanitizers are part of official documentatio…

No idea what is your point.

The compiler is happy to compile without sanitizers enabled. Why should it require to implement a null check when deallocating when it doesn't when dereferencing?

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

#305

Earlier quoted context omitted.

Note that a lot of the pip projects are implemented in C++. You install packages for the environment you are targeting. A lot of folks use Conan or vcpkg for pure C++ dev.

Sorry, I was using `pip` as an example of an easy build system to use to get stuff working. Is it as simple as `conan install boost` within a projects dir?

It's more or less as easy and hard as pip dependency management, yes. Including deducing sets of valid version ranges and so on.

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

#306
post #80

Earlier quoted context omitted.

Yep. The one big beginner “mistake” I see people make in rust is overusing Box / String / Vec. Rust code that allocates everywhere can be even slower than javascript. The reason? Malloc is slower than you think. Slower than short allocations in V8 or Go. If you want performance, make friends with &str, &[], >, bumpalo, SmartString and SmallVec. (Or similar crates). Removing allocations from the hot path can improve p…

Does anyone know of any guide/tutorials/books about how to avoid common Rust performance issues. Like real world examples, "instead of doing X, do Y". I am maybe beginner to intermediate in Rust, but I think I'm still very susceptible to those things.

The Rust Performance Book - https://nnethercote.github.io/perf-book/.

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

#307

Earlier quoted context omitted.

Absolutely not. The last time I have tried Haskell it was failing some pretty basic tasks. The JSON library required to be re-compiled for some reason and it used 20+G of RAM when the build crashed. The community is flat out hostile towards Mac users and a basic request was closed with a comment that Mac is a broken platform and it should not be used. I do not have time for these, Rust offers a much better experience…

> The community is flat out hostile towards Mac users and a basic request was closed with a comment that Mac is a broken platform and it should not be used. Have you got a link to that request?

It was years ago, I try to dig up the link on Github but can't even remember which project I was trying to compile. It was about static linking on Mac.
Post reply on HN