Live data from Hacker News

Why we develop EloqDB mainly in C++

eloqdata.com

11–20 of 94 posts

Re: Why we develop EloqDB mainly in C++

#11
From my experience no language bitrots and degrades worse than a C++ codebase.

The language standard has changed so much, the tooling, trendy libraries and the established conventions... It takes a herculean effort to keep a given source tree up to date.

Dive into a C++ repo started even 10-15 years ago and it can be a revolting experience, let alone one from back in the 90s.

And then from company to company conventions and expectations just vary dramatically.

When I was at Google we had a large committee of very smart people who applied monorepository wide modernizations across the whole repository, introduced amazing tooling and analysis tools, and imposed a very strict style guide that kept people fairly disciplined. But that was a herculean effort which most other organizations can't afford.

Rust has all sorts of problems (including specific ones for DB internals or OS development). But what's amazing when I read these articles is they don't actually seem to mention those specific problems that I've encountered in my last 3 years of professional Rust work. Instead they read like rationalizations by people who have a certain hammer they've gotten really skilled at using, and don't want to give it up.

That's fine if it keeps your organization productive, but I see no reason to publish about it?

If I were to make a list of gripes about Rust for this kind of work it would primarily emphasize the continued lack of acceptance/conclusion of the allocator-api (or competing) proposals, and the rather chaotic and unprofessional (and potentially insecure) nature of the way Cargo project dependencies explode into a hard-to-reason-about mess.

But the list they make? io_uring, mimalloc, and performance oriented networking are... not problems to use in Rust, not complicated at all. I assume the same (or better) for Zig.

Re: Why we develop EloqDB mainly in C++

#12
It sounds like the rationale is that existing database technology is already written in it, and they want to re-use some of it. That's reasonable, but I do think that it only makes sense with the assumption that the flaws in C++ aren't large enough to be worth using something else, at which point there isn't really much need to justify using C++ at all. If someone is concerned about the flaws in C++, the benefit of relying on existing C++ libraries isn't going to seem as compelling to them for the exact same reasons they don't want to use C++ for their own code.

At the end of the day, the choice seems to be a bit circular; if you don't have concerns about C++, you'll find plenty of reasons to use it, and the arguments against it aren't going to be compelling. If you have concerns about it, the reasons to use it won't be compelling, and you'll likely agree with the arguments against it. I have to imagine that whether someone agrees with this choice will be entirely consistent with their existing opinions of C++; it doesn't seem like there are any new arguments left to make on this topic, so debates on the topic will inevitably rehash existing arguments (regardless of which side they come from) and only appeal to the people who already have formed their opinions based on finding those arguments compelling to begin with.

Re: Why we develop EloqDB mainly in C++

#14
post #9

Earlier quoted context omitted.

The "I drive an H-pattern manual transmission" of programming language discussions.

Is this like a dig? Does anyone disagree that manual is much more fun?

20 years ago, sure. Now if you want fun torque you drive electric and blink with confusion at manual-snobs.

I learned on stick and I still feel a nostalgic appeal, sure. I test drove a used hothatch Volvo C30 T5 Polestar edition last fall before ultimately settling on an electric performance car (Polestar 2) to feed my midlife indulgences. And I have to admit a certain ... thrill... from the turbo lag and the process of shifting.

But it all seems a bit silly when compared to instant torque at any RPM.

Re: Why we develop EloqDB mainly in C++

#15
> Over the past several years, the EloqData team has worked tirelessly to develop this software, ensuring it meets the highest standards of performance and scalability. One key detail we’d like to share is that the majority of EloqKV’s codebase was written in C++.

This is a very interesting approach to marketing a new database

Re: Why we develop EloqDB mainly in C++

#16
post #9

Earlier quoted context omitted.

The "I drive an H-pattern manual transmission" of programming language discussions.

Is this like a dig? Does anyone disagree that manual is much more fun?

I think you can over examine metaphors like this but yeah, driving manual is more fun when you’re going on a fun drive. When you’re commuting in start stop traffic… less fun.

(and in this scenario you’re also usually sharing the car with other people so driving automatic would make everyone’s lives easier)

Re: Why we develop EloqDB mainly in C++

#17
post #9

Earlier quoted context omitted.

The "I drive an H-pattern manual transmission" of programming language discussions.

Is this like a dig? Does anyone disagree that manual is much more fun?

I suspect the H pattern they mean is where the gear shift is on the steering column, not on the floor. I long ago owned a 1945 Dodge truck with that shifting setup.

Re: Why we develop EloqDB mainly in C++

#18
post #8

One thing I like about Rust is that it prevents you from doing stupid things on the compiler level. I write a little bit of C/C++ and Rust. If you don't do C++ on a daily basis, you will silently introduce problems in the code that are very hard to spot. You just need to have a very good mental model of how to write good C++. It requires constant exercising. For Rust, you just have to fight the compiler. This is espe…

Honestly after 6 months to a year of constant Rust development you don't even fight with the compiler anymore. Instead it's mostly just your friend.

There are still logical holes in the borrow checker, but they're mostly irrelevant.

Re: Why we develop EloqDB mainly in C++

#19
post #9

Earlier quoted context omitted.

The "I drive an H-pattern manual transmission" of programming language discussions.

Is this like a dig? Does anyone disagree that manual is much more fun?

Not fun in San Francisco rush hour traffic on Russian Hill.

Re: Why we develop EloqDB mainly in C++

#20
post #8

One thing I like about Rust is that it prevents you from doing stupid things on the compiler level. I write a little bit of C/C++ and Rust. If you don't do C++ on a daily basis, you will silently introduce problems in the code that are very hard to spot. You just need to have a very good mental model of how to write good C++. It requires constant exercising. For Rust, you just have to fight the compiler. This is espe…

> If you don't do C++ on a daily basis, you will silently introduce problems

Even if you do, you still will. Just less often.

> I actually have no idea how big teams work on large C++ codebases... You can change one part of the code, and it will introduce bugs in the whole project because of how the memory is handled

Part of it is lots of tests, sanitizers, assertions, etc.

Part of it is keeping things modular and avoiding spooky action at a distance to the extent possible.

Part of it is unavoidable, and that's why people are moving to safer languages.

Post reply on HN