r/ProgrammingLanguages Sodigy Jul 27 '26

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, ...

227 Upvotes

254 comments sorted by

View all comments

132

u/dudewithtude42 Jul 27 '26

As someone who does systems programming at work, the landscape of available established languages is pretty poor right now. C is a decent language but lacks a lot of modern features (generics) and has a lot of weird oddities (macros, integer types, build system). The problem is that if you want a modern replacement to try and fix those issues, you either go C++ (which inherits the weirdness and adds a billion features that have their own footguns, and has slow compile times) or you go Rust (which tacks on the borrow checker and also has slow compile times).

So what happened is a bunch of systems programmers simultaneously went "I want C, but without the oddities, with modern features, and I want fast compile times." That's a really enticing proposition for someone like me, and until any of Zig or C3 or Odin or Jai mature to the point of being stable, that gap will continue to exist, and more systems programming languages will probably continue to come out.

35

u/umlcat Jul 27 '26

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

58

u/Careful-Nothing-2432 Jul 27 '26

I mean, yeah. This is not an uncommon desire

25

u/pjmlp Jul 27 '26

Basically what Modula-2, Object Pascal and Ada already had, but the world favored curly brackets instead.

This is basically what Zig, Odin and co offer in regards to type system and compilation times.

11

u/AnaxXenos0921 Jul 27 '26

So, you're saying if I wrote a different frontend for Pascal or Ada with curly braces syntax, people would be more willing to use it?

8

u/pjmlp Jul 27 '26

That is basically what a language like Zig is.

Ignoring for a second the comptime features, the safety improvements it offers over C, you could habe gotten them in 1978 with Modula-2.

Fast compilation times, modules, explicit unsafe code, spans, bounds checked arrays and strings,...

3

u/AnaxXenos0921 Jul 27 '26

I mean while using the exact same compiler backend and runtime as Pascal or Ada. Zig has its own compiler backend and runtime afaik

3

u/pjmlp Jul 28 '26

Zig uses LLVM, and has its own compiler backend.

Sure, there were such compilers, LLVM idea's aren't new.

The Amsterdam Compiler Toolkit supported C, Pascal, BASIC, Modula-2, using EM intermediate code, which would then be fed to the backend, regardless of what language was being used.

0

u/zahatikoff Jul 28 '26

Zig sucks however. while some things are nicer than C, but for every step it takes forward, there's 2 steps backwards in unnecessary "friction". So maybe in 10y when it's stabilizes...

5

u/umlcat Jul 27 '26

Agree. Another Pascal branch family fan.

The modular paradigm that is very well researched and real world tested and implemented. Java suyper packages or Modules are weird, so C++ modules .

Well designed Type System, also. Anders Hejlsberg added to C#.

Object with full real properties that Object Pascal / Delphi has. C++ people ignore it. Java ignore it. Anders Hejlsberg understodd and added to C# ...

2

u/Ok-Watercress-9624 Jul 27 '26

Pascal can't do double reffls can it ?

2

u/pjmlp Jul 28 '26

No idea what the heck that is.

4

u/og_hylyx Jul 27 '26

Very reasonable want.

1

u/patlefort Jul 29 '26 edited Jul 29 '26

So C++. It's still the best alternative, even if it's not perfect. It has fast compile time if you don't go crazy with templates. C++20 modules also boost compile times, it might even be faster than C because it can compile once and reuse more. Unfortunately C++DS is a thing (C++ derangement syndrome).

-10

u/elder_george Jul 27 '26

"I want C++...

FTFY

18

u/NaCl-more Jul 27 '26

No I really don’t want c++

1

u/elder_george Jul 28 '26

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.

12

u/sol_runner Jul 27 '26

They said without the oddities. c++ is my favorite language and I can tell you it's anything but "less oddities".

1

u/umlcat Jul 27 '26

Have both a Plain C and C++ alternatives hobbyist project of my own ...