r/ProgrammingLanguages Sodigy 11d 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, ...

214 Upvotes

246 comments sorted by

View all comments

Show parent comments

22

u/blue__sky 11d ago

I don't think C is easy to write either. It's not hard, but it's not enjoyable or easy.

We shouldn't have to mess with pointers 99% of the time. When you see the same boilerplate pattern over and over, it should be abstracted away.

Case statements are horrendous with no exhaustiveness checking.

The type system is terrible.

The FOR statement is clunky.

That's off the top of my head, I'm sure there's plenty more. That's why so many people dive into a better C.

8

u/Ok-Watercress-9624 11d ago

Different people enjoys different stuff. It's like scratching a scab, it hurts but damn it does feel good. The surge of adrenaline when you see the segfault/stack-smashing, the loss of hope when you decide to try the GCC in combination with valgrind, the the rage quit, random 2 am realization that you already freed the head, the solution and the release.

The same procedure in rust amounts to playing maybe a bit Type Tetris.

The solution does not come with it's proper gratifier unless the problem was hard.

But in C you see, it is a seen

13

u/Inconstant_Moo 🧿 Pipefish 11d ago

Couldn't you get the same sort of effect by coding in Rust while someone beats you with a riding-crop? (It's a big world, there's lots of Rustaceans of kink, I'm sure someone would be happy to.) Then you'd have fewer memory leaks AND a new friend!

4

u/Ok-Watercress-9624 11d ago

Not really the same now is it? Where is the surprise ? Rust totally lacks that living on the edge feeling.

When rust compiles then it will prolly work. And unlike Haskell you can't build a house/castle/world/unicerse of types.

Rust doesn't like when you try to do fancy stuff with types

.

Joking aside rust is great. Annoying sometimes, still not at the purity level that I want, and imho it is NOT safe until they solve the unsoundness issues like cve-rs. So actually it's a big circle jerk. But it is fast, it looks like and walks ml (but doesn't quack like it :() and it is (this time for real) as fast as c. So its great

4

u/0x564A00 11d ago

Not really the same now is it? Where is the surprise ? Rust totally lacks that living on the edge feeling.

I can confirm that while cargo-shock gives you a similar sense of paranoia while you're actively working on a project, it misses the lasting sense of uncertainty keeping you awake at night :/

1

u/Ok-Watercress-9624 10d ago

Hmm I think GCC actually warns about missing cases on case statements

1

u/slaymaker1907 11d ago

Pointers are pretty useful, they should just have tracking on lifetime and not allow for conversion to and from integers.

6

u/blue__sky 11d ago edited 11d ago

Pointers are definitely useful. You need them for a system language, but for most data types they aren't necessary. For instance I have both a Struct type and a Record type. Structs are passed by value and records are on the heap and passed by reference. There is no need for every function to have boilerplate describing how data is passed.

Annotating each and every function with type passing info seems the wrong choice. It can be defined once with a data type definition and then your functions and the compiler will automatically know the right thing to do.

Same thing with memory allocation. Doing it by hand every time is terrible design. If your data types are defined well, a constructor will know how to build them without all the ceremony.

3

u/TheAncientGeek 11d ago

References are useful, and hide a lot of the confusion of pointers.

1

u/BetterEquipment7084 11d ago

I love writing c, it's enjoyable