Ask HN: What do you want to see in a systems programming language?
I am working on a new systems programming language, similar to C++ with syntax that somewhat resembles Go or LLVM in some ways. While it isnt quite ready (at least a month away from alpha release), I am curious what features are the most desired in a systems programming language. I'd like to get inspiration for new language features. Pain points with C++, Rust, C, Zig etc.. What you like, don't like, etc.
22 comments
[ 2.0 ms ] story [ 71.7 ms ] threadThat's more than just device-drivers, you have to work out a consistent interface between the 'system' and all of the peripherals, rather than looking at the individual interactions of the system with individual peripherals.
In a way, you need something like the UNIX concept of 'everything is a file'. (Only more so.)
My hobby is writing emulators for real machines from the past. Most of my effort is in emulating the peripherals interactions with the CPU and RAM.
I have recently been looking at minicomputers of the 1970s. They seem to have had the concept of the peripheral doing all the work, with the 'system' merely 'asking a limited number of code questions' and the system 'getting a limited number of answers' from the peripherals.
Maybe something as simple as:
That goes down into the bowels of the system, probably at the hardware level. And the architecture of the interface has to be part of the low-level system language otherwise it gets fragmented.But then again, I'm not a systems programmer so what I'm looking for may not be possible.
Systems programmers tend to demand a lot of visibility into what, when and how every line of code executes instead of abstracting that behind the language runtime. For example, a systems programmer might care that the data being received is transferred over DMA with zero copy.
As for features, honestly getting placement new without pointer shenanigans would be nice. C, C++ and Rust all make that (somewhat niche) use case more verbose and obtuse than it strictly has to be.
What is "systems programming"? Roughly, writing OSes and the programs that come with the OS - compilers, linkers, debuggers, databases, and so on. The distinction is between "systems" and "application" programming. Again, this is 1960s language.
These days, there is a FAANG take on this. If I understand correctly, Google thinks of their software infrastructure as "systems programming". That kind of tracks with the old definition if you think of the entire company network as "the machine", instead of thinking about only one computer.
Pointers cannot be escaped. They are how the computer actually works. Either you expose pointers to the user, and all the errors that can result, or you have an abstraction layer where the limited set of automatic transformations are known to be memory safe. Low level/systems languages operate at the pointer level, high level languages translate to pointers through a limited set of transformations that have been proven memory safe. Rust is a bit weird because it somehow figured out how to do manual memory management in a mostly safe way that didn't result in a huge amount of overhead. Basically Rust works like other systems programming languages that use pointers with the additional constraint that also you have to write "lifetimes" that formally prove to the compiler that your use of those pointers is safe. Think of it as writing C++ but also having to write a proof that your code is correct.
- functions that are called from a different language, like how parts of NumPy are written in C
- code that runs in kernel space
- code that runs on tiny little devices that don't really have an OS at all
In theory almost any language can do those things, but for a variety of reasons in practice we only use a small set of languages to do them.
Clear semantics for dealing with threads and multiple cores.
Static type checking
Native integration with Datalog.
Many times, I find myself working on a program and I realize that what I need is a database. But having a database, even sqlite3 or Berkely DB, would be an overkill. If I could just express my data and the relationships between them, then I would be able to query what I need in an efficient way.
Any homepage of your project @OP to check for the alpha?