News for hackers. Stuff that matters.
Re:Building a Cloud Database from Scratch: Why We Moved from... by hamilyon2 on Friday February 10, 2023 @07:41AM (#34738903)
Is rust code heavily seasoned with unsafe keyword really that hard to prototype in?

Is it meaningfully harder than c++ in this regard?

Re:Building a Cloud Database from Scratch: Why We Moved from... by spoiler on Friday February 10, 2023 @08:12AM (#34739206)
I assume they didn't mean compared to C++. If anything, saying prototyping in C++ is easier than Rust is beyond ludicrous even if you're a seasoned C++ developer.

I'd have an easier time prototyping in Rust than C++, and I've been writing C++ for 10 years and Rust for a little over a year.

However, prototype in something like Ruby (or even TypeScript, and some people mentioned Elixir) is in a different universe compared to C++ or Rust.

Like, it's not even a "fair fight" to compare it meaningfully.

Re:Building a Cloud Database from Scratch: Why We Moved from... by cozzyd on Friday February 10, 2023 @03:30PM (#34745371)
Well there are C++ repls available. Maybe there are rust ones too?
Re:Building a Cloud Database from Scratch: Why We Moved from... by GuB-42 on Friday February 10, 2023 @09:22PM (#34748925)
What makes Rust better at rapid prototyping? Cargo?

I find that modern C++ "kitchen sink" approach to features makes it good for rapid prototyping, a bit like Perl on the dynamic side. It won't force you into a specific approach, pick the one that gets you there the fastest. Use raw pointers and malloc(), or use fancy smart pointers and RAII, your choice, you can also do both, you have exceptions, you have goto, you can write(), printf() and cout, you have classes and lambdas and (multiple) inheritance and traits. More options are better for rapid prototyping.

Also, C++ is the most popular language for competitive programming, you can't get more "rapid" than that.

Re:Building a Cloud Database from Scratch: Why We Moved from... by craftit on Friday February 10, 2023 @08:14AM (#34739221)
From what I've experimented with so far the biggest barrier to using rust was having a mature ecosystem of libraries to use. This is changing though!
Re:Building a Cloud Database from Scratch: Why We Moved from... by oconnor663 on Friday February 10, 2023 @09:00AM (#34739655)
If I wanted to just blast out something quick and dirty, I don't think I'd reach for `unsafe`. It's syntactically inconvenient, with lots of `(*foo).bar` and `MaybeUninit`. And I don't think I could be happy with a prototype that's blatantly full of UB, so for me it would take more effort rather than less.

Now that I say that, I guess someone could write an "unsound helper functions" library that helps you write code full of UB conveniently. It could be an interesting thought experiment. But I don't think the community would be very happy about it...