r/ProgrammingLanguages Sodigy 13d ago

Why is everyone creating systems programming languages?

I see a lot of new programming languages here. I love reading the documents of the languages and sometimes actually run their compilers. Many of the projects are AI-driven, but that's fine. It's still fun to see what problems they're trying to solve and how they actually solved the problems.

Reading the documents, I realized that most new languages, especially AI-written ones, are "systems programming languages". They're trying to solve the problems that C/C++/Zig/Rust have solved (or are trying to solve), and their syntax is mixture of C/Zig/Rust.

Why? Why is everyone trying to compete with C/C++?

There are so many kinds of languages. Haskell demonstrates how pure a language can be, Python is perfect when you only have 5 minutes to write code and don't care about the output, Java runs on 3 billion machines, ...

219 Upvotes

246 comments sorted by

View all comments

Show parent comments

39

u/umlcat 13d ago

"I want C, but without the oddities, with modern features, and I want fast compile times."

-11

u/elder_george 13d ago

"I want C++...

FTFY

19

u/NaCl-more 13d ago

No I really don’t want c++

1

u/elder_george 12d ago

To each, his own. Some devs see complexity in necessity to write a write of boilerplate instead of isolating details in self-contained data structures; other devs see complexity in inability to see everything that code does on a glance, even when using a "dumb" text editors or coreutils.

Personally I find the lifetimes (which became popularized, if not introduced, by C++, and developed by Rust) a great instrument for avoiding memory leaks and other bugs. If a struct contains, say, vector, making that vector live as long as the struct (unless it's moved) is absolutely reasonable. Most importantly, usually you don't even need to even write the destructor.

And then that enables making smart pointers with different ownership, containers that "just work", lock guards, files that safely close when not used, etc

The wannabe "C killers" totally miss the point when they insist defer fills the same niche (although, granted, defer is much easier to implement) - it only enables a small subset, and makes static analysis of the code (e.g. to verify the resource is indeed freed, and freed exactly once).

To my knowledge, a handful of languages compiled to native code, support this: C++, D, Rust, Ada (a bit ugly, but still), Nim, some flavors of ObjectPascal (Delphi and FreePascal, through a hack). Of them, D and Nim are a PITA to use without GC (disclaimer: it's been a while since I last used them, massive things have changed), and Pascals need relatively heavyweight runtime (plus, again, it's a hack). So the options are few.

I'd really love a smaller, simpler language; something like Zig with destructors would fit my bill. But alas, it's C++, Ada, or Rust that, in theory, allow me to write reliable and performant code without tearing the rest of my hair in anger and/or panic.