site banner

Culture War Roundup for the week of March 18, 2024

This weekly roundup thread is intended for all culture war posts. 'Culture war' is vaguely defined, but it basically means controversial issues that fall along set tribal lines. Arguments over culture war issues generate a lot of heat and little light, and few deeply entrenched people ever change their minds. This thread is for voicing opinions and analyzing the state of the discussion while trying to optimize for light over heat.

Optimistically, we think that engaging with people you disagree with is worth your time, and so is being nice! Pessimistically, there are many dynamics that can lead discussions on Culture War topics to become unproductive. There's a human tendency to divide along tribal lines, praising your ingroup and vilifying your outgroup - and if you think you find it easy to criticize your ingroup, then it may be that your outgroup is not who you think it is. Extremists with opposing positions can feed off each other, highlighting each other's worst points to justify their own angry rhetoric, which becomes in turn a new example of bad behavior for the other side to highlight.

We would like to avoid these negative dynamics. Accordingly, we ask that you do not use this thread for waging the Culture War. Examples of waging the Culture War:

  • Shaming.

  • Attempting to 'build consensus' or enforce ideological conformity.

  • Making sweeping generalizations to vilify a group you dislike.

  • Recruiting for a cause.

  • Posting links that could be summarized as 'Boo outgroup!' Basically, if your content is 'Can you believe what Those People did this week?' then you should either refrain from posting, or do some very patient work to contextualize and/or steel-man the relevant viewpoint.

In general, you should argue to understand, not to win. This thread is not territory to be claimed by one group or another; indeed, the aim is to have many different viewpoints represented here. Thus, we also ask that you follow some guidelines:

  • Speak plainly. Avoid sarcasm and mockery. When disagreeing with someone, state your objections explicitly.

  • Be as precise and charitable as you can. Don't paraphrase unflatteringly.

  • Don't imply that someone said something they did not say, even if you think it follows from what they said.

  • Write like everyone is reading and you want them to be included in the discussion.

On an ad hoc basis, the mods will try to compile a list of the best posts/comments from the previous week, posted in Quality Contribution threads and archived at /r/TheThread. You may nominate a comment for this list by clicking on 'report' at the bottom of the post and typing 'Actually a quality contribution' as the report reason.

7
Jump in the discussion.

No email address required.

Rust is clearly the systems language of the future. It can be just as fast as C++ and has a much nicer syntax/doesn't have weird idiosyncracies (ok, the last point is debatable).

I'm not completely sure I buy this vision of the future. Rust has some very good ideas, but there is so much quantity behind legacy C/C++ systems that it has a quality all of its own. And it's not the first time claims like this have been made: I'm old enough to remember Java being sold as "just as fast as C++" and safer (debatably true for some workloads today, less true at the time), but it hasn't displaced C or C++ despite major efforts. And despite the supposed memory safety, I have actually encountered java.lang.NullPointerException in the wild (production code) plenty of times. C# also promised a brave new garbage-collected world. If I were older, I'd probably point to Ada, which was originally developed for the DoD to write safe, modular programs in the late 1970s (IMO an underappreciated language, to be honest) and still gets some use today.

Rust has some good ideas, but fundamentally it seems to be pretty similar to C++ in terms of what the languages want to be. My loose prognostication is that the sheer Borg mass of the C++ ecosystem will learn to interoperate with, embrace, and extend. The C++ committee is clearly steering this direction, and it seems only a matter of time until the base version of the language offers, say, a borrow checker. There has already been plenty of (slow, but steady) motion towards that sort of thing since C++11 (shared_ptr, more recently span). It seems to me only a matter of time before someone posts a patchset for GCC or Clang that adds -Wborrow-checker.

There's something to be said that the current backwards-compatible syntax for modern C++ will get unwieldy, but there has already been public discussion of attempts to make breaking revisions to it: see Sutter's proposal for cppfront. This sort of thing isn't unheard of: early C++ was implemented as a generator for C code. Javascript has all sorts of code compatibility tools, including CoffeeScript, which seems to have fallen out of favor since the JavaScript ECMAScript standards committee decided to start publishing again and making real updates. I just can't see full rewrites in Rust of major application code, but I could find it plausible that the backend object models of the languages will converge until they interoperate fairly seamlessly. Or that C++ absorbs all the good ideas and Rust remains around in a vestigial, nostalgic fashion like Perl or PHP in 2024.

"just as fast as C++" and safer (debatably true for some workloads today, less true at the time), but it hasn't displaced C or C++ despite major efforts

Well, this was a lie, it's not possible to match speed with dynamic compilation and garbage collection. Sun corp. did benchmark cheating. Rust tried to be a better C

And despite the supposed memory safety, I have actually encountered java.lang.NullPointerException

Well, in this part they didn't lie, it's possible to have exception, but unlike C/C++ it is guaranteed to be caught and safely processed. Some C implementations (at least for MS-DOS0 reversed some space to check for null ptr dereferences, the program at exit checked it and if changed, printed error message.

"Within C++, there is a much smaller and cleaner language struggling to get out"

One problem with C++ is that it inherited most of C, which means that the syntax for doing stuff the (unsafe) C way is usually short. Compare a C array declaration to a std::array declaration, for example.

With regard to the borrow checker, I don't think it will be that easy to port to C++. (If it was that easy, people probably would not have invented Rust in the first place.) I am not a Rust programmer, but I think that Rust's system of allowing explicit lifetime annotations might not be that easy to reproduce in C++ (at least without horrible template syntax).

(If it was that easy, people probably would not have invented Rust in the first place.)

C++ is bad not only in memory safety, but also has ugly grammar, no modules, slow compilation speed (and ugly binary operator priority).

There's something to be said that the current backwards-compatible syntax for modern C++ will get unwieldy, but there has already been public discussion of attempts to make breaking revisions to it: see Sutter's proposal for cppfront.

And I think the other main one currently would be google's Carbon, which is an experiment from the google LLVM/clang crowd, from their frustration with the c++ committee's hesitance to do breaking changes. They're trying to use good ideas from Rust and others, in a way that's interoperable with c++ files & libraries. Although I haven't heard much about it lately.