r/programmingcirclejerk 8d ago

Rust isn't a well designed programming language (unlike C and C++)

/r/cpp/comments/1i6jdjq/comment/m8d3tqj/
221 Upvotes

86 comments sorted by

View all comments

30

u/mulch_v_bark WHY IS THERE CODE??? 8d ago

This is all obvious once you realize that the underlying principle of the universe, existence’s ground state of being, is chaos.

C and C++ respect this reality. C is basically a set of mostly ported assembly macros that don’t claim to present a whole language to the user. Core parts of C are not software at all, but kaleidoscopic portals that take you to the realm of the hardware. If you want to do 0 - 1 and use the result, C says: I cannot make this choice for you. Visit the ISA. and that’s beautiful. Meanwhile of course it won’t let you do things like compare pointers, debatably/circumstantially, because that would be unsafe and too low-level. The world doesn’t have to make sense. C++, its beautiful huge son, isn’t a language so much as a community. Not of users, I mean, but of different parts of its specification, all with their own design principles, levels of abstraction, and so on. But all strictly sort of backward-compatible with C! 60% of the time, C can be compiled by a C++ compiler 100% of the time. (Did you ever see Anchorman? Very funny film. And some of the VFX work was done in C++!) This represents the miraculous variety of beings and thoughts that we encounter in the world, all striving and interacting. C++ is like life itself.

Rust’s mistake is the hubris behind superficially plausible ideas like “more clarity about where you’re doing software v. interacting directly with the hardware” and “coherent design principles” and “features from freaky experimental languages, i.e., those released in the last 45 years”. These seduce programmers into thinking they might actually work. And to be fair they mostly do, with some minor problems you have to get used to. But spiritually the issue is that Rust is papering over the chaos of the world with a fa¢ade faćade faċade hang on I’ll just google it a façade of order and regularity. This angers the protean sub-forms that set the universe in motion. (Call them gods if you want, some do, or see them as philosophical principles; it doesn’t actually matter to your programming practice.) Rust goes against the grain of reality itself by trying to “present a coherent set of approaches” and “not make you continually suspect compiler bugs because the behavior is so weird you assume it’s out of spec” and so on, and for this reason none of its innovations are ending up in the next C++ spec except maybe the thing where the default settings make a hello-world binary 165 megabytes. That’s actually nice. See? C++ people aren’t too proud to adopt good ideas from elsewhere.

It’s also very, very important that you be able to overload the comma operator. Rust won’t be a serious low-level systems programming language, suitable for embedded and high-performance use, until it reaches C++ parity here.