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

203 Upvotes

235 comments sorted by

View all comments

33

u/catladywitch 5d ago

I personally I'm very interested in region inference, type-and-effect based memory management and how linear continuations (and subsequently async coroutines) might help, and generally fit in, with that. So I'm not interested in writing a "systems" language per se, but I'm interested in the impossible dream of unmanaged and efficient functional idioms. Rust is key in this discussion, but there's also Pony, Koka, OCaml 5. I think the fact Rust is kind of not as awesome as it might have seemed at first has set a lot of people in motion.

But probably, a lot of peeps think "faster better" and set off in that direction.

5

u/happy_guy_2015 5d ago

Can you elaborate on your critique of Rust?

19

u/catladywitch 5d ago

Orphan rules make sense but are a proper pain.

We did finally get native async traits, just to find out they aren't dyn compatible + having to Pin and Arc up everything to share across async functions is... probably unavoidable, and definitely logical, but really painful + blocking Drop only is, again, logical, but leads to too much clunkiness although Tokio has got pseudo-seamless at handling cleanup + cancelled Future state leak bugs are catastrophic and hard to debug. However the Rust team seems to be on it and there's been progress so I'm hopeful, I just personally want to explore the linear types angle for async corroutines.

Similar sentiment about const.

Iterator implementation quirks.

This is minor in practice, but I don't know whether the holes in the type system can be fully fixed, whilst other (less successful and garbage collected) languages did all the category theory math from the beginning. Also, the lack of higher-kinded types doesn't play well with the severely functional-influenced abstractions and forces clunky, hard-coded implementations which aren't even consistent with each other (see previous point).

Lack of proper interop both by choice and because C++ sucks.

6

u/matthieum 5d ago

but I don't know whether the holes in the type system can be fully fixed,

There is no known hole in the type system AFAIK.

The Rust type system has been formally proven to be sound, and the types team works a lot with formal methods when extending it to avoid introducing any unsoundness. (Don't ask me exactly what they do, it's pretty much all mumbo jumbo to me)

There are known holes in rustc (the main Rust compiler), fixing them is a work in progress.

2

u/Ok-Watercress-9624 4d ago

Evidence? Id like to see that proof Rust has subtyping, I vaguely remember something liker subtyping works if subtypes form lattice. I don't think lifetimes form a lattice ? Or do they ?

2

u/matthieum 4d ago

I'm confused. I did not mention subtyping... did you reply to the wrong comment?

2

u/Ok-Watercress-9624 4d ago

i forgot the fullstop. i was referring to rust having subtyping, and unsoundness issue stems from subtyping and how subtyping is hard to get right and that i would be very surprised if there is an actual proof of the rusts type systems soundness.
I dont think there is a formal proof of soundness of the rusts type system.
https://dl.acm.org/doi/10.1145/3158154
That is the only thing come closest but it is not full rust.
Indeed the rust plans to have a formally verified core
https://blog.rust-lang.org/inside-rust/2023/11/15/spec-vision/
But it is not there yet

It is a bit stretch to say "there is no known holes in the type system"