Live data from Hacker News

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

risingwave-labs.com

241–250 of 307 posts

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

#241
post #82

Earlier quoted context omitted.

Not allowing these in PRs is a thing?! Wow. Genuinely surprised.

See Orthodox C++.

Having seen C++20, anything less is just subpar.

Orthodox C++ can be safely ignored by any sane developer.

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

#242

Earlier quoted context omitted.

Yeah, sadly it is. With e.g. Elixir I can literally get into a REPL and prototype my solution in minutes, right there on the spot, and then just copy a few lines from it and have the solution be 90% done (minus tests, of course). With Go and Rust I have to make a dedicated function somewhere and then have it be called after starting the program. Ain't exactly rocket science but the difference in time to do it and the…

The Rust tendency toward “golfing” is why I don’t like it. It’s not even lifetimes, but the way traits are setup. And the lack of unified function call syntax. Sometimes it’s a function, sometimes a method — that distracts a lot from the problem at hand IMHO.

You can call any method as a function, if you'd like.

  foo.bar(baz)
becomes

  bar(foo, baz)
Though you may also need to add in some &s and/or *s, because method call syntax autoref/derefs, and function call syntax does not.

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

#243
post #15

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

i don't think joelonsoftware points apply here. - Their product is still relatively new (7 months of coding isn't that much) and not even released, - they picked a technology specifically designed for the problems they've identified on their existing codebase. - they completed the rewrite (and weren't stuck having to maintain the old codebase), and are happy with the result.

Agree.

The risk is losing the current user base.

For this particular software: No users, no market penetration, no risk at all doing a rewrite.

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

#244

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…

The part about the Rust evangelists being really toxic mirrors my own experience.

I like the language. I really don't want to deal with their community.

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

#245

Earlier quoted context omitted.

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

OOP is not C++ best practice these days. For me C++ best practice is: - Smart pointers - auto and const references all over the place - RAII - Pure data structs - Free functions - A little bit of templating but not too crazy Modern C++ reads a bit like JavaScript strangely!

> Modern C++ reads a bit like JavaScript strangely!

I yield to your comment.

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

#246
post #191

Earlier quoted context omitted.

C++ modules....

Has support for these gotten any better? Last time I was reading about it compiler support was under baked at best. If they get it fully working and stable I agree modules should go a long way to getting rid of it (entirely if you are willing to wrap old header files in modules yourself).

Yes in what concerns VC++.

All my hobby coding in C++ uses modules nowadays.

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

#247
post #197
post #35

Earlier quoted context omitted.

Betting against Postgres all the time, since the .com age I have mostly used Oracle and SQL Server, and Postgrest only in a single projec that was alive during 4 years. There was also Informix, SYBASE and DB2, but those hardly matter nowadays.

Why doesn't DB2 matter?

It still does, however it is mostly for IBM customers on Aix, IBM i and z/OS, not was widespread as it once was.

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

#248
post #115

Earlier quoted context omitted.

I would love to hear more about "fsync saga" if you have any references. I know that PostgreSQL had "problems" with fsync(), but they never ended. They just accepted defeat, but so would everyone else who relies on filesystems to store their data. It's even more ingrained than that. The way hardware works, and, especially, the communication protocols around it (eg. SCSI or NVMe) are structured, fsync() is always goin…

See this chain of articles: https://aphyr.com/posts/284-jepsen-mongodb The mongodb organization repeatedly poo-pooed the issues with data loss, and only after repeated public exposure of the issues did they do anything about it. I don't know why people aggressively deny this when anybody can just google it and judge for themselves.

No one denies anything or that the company handed it well. But this was never a real-world issue.

All of the clients set safe defaults and the documentation was very clear about default fsync behaviour.

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

#250
post #178

Earlier quoted context omitted.

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.

> 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. Does this, to you, look like a response that is welcoming to C++ devs? I gave careful and impassive reasons, and you strike back with literal ad hominem attacks. This sort of reply is what makes Rust, as a community, look shallow-minded and tox…

[deleted]
Post reply on HN