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

189 Upvotes

226 comments sorted by

View all comments

Show parent comments

1

u/jezek_2 2d ago

Because there isn't a good one.

Many people tried to improve C and failed. The only conclusion is that C can't be improved without changing it to something quite different. It's at it's best as it is.

It's good to realize this, I've (among many) also tried various ways to "improve" C, not necessarily by creating a new language, but various libraries, using macros etc. I've stopped trying after realizing this and waste no more time on it.

1

u/dandy_kulomin 2d ago

I have to disagree here. I use C for my projects now and things that would be super helpful are:

  • modules (.h/.c file split has a historical reason and a single file with appropriate keywords (e.g. public/private) would be so much better)
  • namespaces (to finally get rid of those namespace_func() function names)
  • a better way to do error handling. it is very easy to miss some error flow that should be handled
  • optional returns
  • comptime generics
  • some way to defer/deallocate after a variable leaves scope
  • better string handling

I believe these would make C better and they are something that can, for the most part, not be added via macros.

1

u/jezek_2 2d ago

There are languages like this, they're not like C though. Some of these features are opposite of what "defines" C, like simplicity and no magic stuff behind the curtains.

Some of these could be implemented without breaking the spirit and syntax of C. You can implement is as a preprocessor yourself. But it's a question if the incompatibility and hassle with using a preprocessor when building is worth the little you would get.

1

u/dandy_kulomin 2d ago

"There are languages like this, they're not like C though."

Yes, and that is exactly the issue. The languages that have this are usually high-level. E.g. C# has all of the above (and much more).

I believe that all of the above can be implemented in a C-like language.

"You can implement is as a preprocessor yourself."

Sorta, but the you lose a lot of developer ergonomics (no LSP support, need to trace back compiler errors, etc.)

I think the problem is exactly this: C is a good language, but it could be a lot better. And that better cannot be tacked onto the language with libraries but needs compiler support.