News for hackers. Stuff that matters.
Re:Ask HN: What do you want to see in a systems programming ... by simonblack on Wednesday November 15, 2023 @04:37PM (#38282903)
A quick and easy way to add peripherals.

That'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.

Re:Ask HN: What do you want to see in a systems programming ... by rpnx on Wednesday November 15, 2023 @05:03PM (#38283211)
I'm not sure that that is much related to systems programming, that sounds like a pretty high level library feature.
Re:Ask HN: What do you want to see in a systems programming ... by simonblack on Wednesday November 15, 2023 @08:24PM (#38284812)
I don't see it like that. I see it as the system having only one interface with all peripherals. Or conversely, all peripherals get treated exactly the same way.

Maybe something as simple as:

     "Are you ready to send me data?"
     "Send me data"    (Some predefined size of data, maybe an 8-bit byte, maybe a 32-bit word, but only one defined size of data.)
     
     "Are you ready to receive data?"
     "Receive this data."

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.

Re:Ask HN: What do you want to see in a systems programming ... by AlotOfReading on Thursday November 16, 2023 @01:27AM (#38286339)
There's quite a lot of details that go into something like that and it's often not possible for the code to know all of them. Languages will sometimes abstract similar things out (e.g. have a function call run on some other processor across a network/bus and get the results), but it's quite a high level feature.

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.

Re:Ask HN: What do you want to see in a systems programming ... by rpnx on Thursday November 16, 2023 @01:49AM (#38286446)
The main distinction between systems languages (e.g. C, C++, Zig) and non-systems languages is that in a systems language you can interface directly with the OS/hardware or at least a very lightweight runtime. If you need to talk in a language other than what the hardware speaks, you would need a layer inbetween the programmer and the hardware. Systems programming languages are what we use to create abstractions for non-systems languages, in particular runtimes. E.g. Java's JVM is written in C/C++. A defining characteristic of a systems programming language is that 99% of the runtime could be written in said systems programming language (maybe with some assmebly in the last 1% for system calls). That isn't possible in Java for example, you can't have a garbage collector that needs a functional garbage collector to exectute. Systems languages compile directly to machine code, and have enough features that can be used to interface with drivers and hardware. Systems languages have a very close association between what you write and how the computer works under the hood. Deviating from that von neuman model to make it do whatever you want is possible, but then it's no longer a systems programming language.
Re:Ask HN: What do you want to see in a systems programming ... by tomcam on Thursday November 16, 2023 @05:33PM (#38296583)
That is an operating systems thing, not a language thing