Ask HN: What system programming language do you use and why?

11 points by MichaelAza ↗ HN
I've been reading up on C lately and noticed a lot of languages that position themselves as "C replacements".

Off the top of my head, those would be C++, D, Rust and Go.

Any others I've missed? Which do you use? Why?

16 comments

[ 1.6 ms ] story [ 51.3 ms ] thread
None, because I'm not writing an OS, and my time is worth more than the computer's.
We use both C and C++. C for our kernel module, and 8051 code. C++ is preferred for network messages (zeromq + protobuf), configuration (from ui or file), and mostly for the heavy math that produces our output. We use value semantics almost exclusively, and heavy on the generic implementations of our math because we support 1-bit, u8, u16, float and double precision outputs. Yet we still can provide template specializations to utilize low level processor intrinsics for SIMD optimization.
Well it depends the various OS' tend to different languages for systems programming. PR1MOS used FORTRAN and PL1/G as a system programming language PICs will use PIC machine code?

Which systems are you interested in? You do understand what is meant by "systems" programming as opposed to general programming using a particular system?

And all systems programing will usually have some Assembler usage.

Ps for the younger readers PR1MOS is descended from the ur hackers OS ITS

I'm trying to be OS agnostic here but we can assume some kind of Unix/Linux system.
why? Linux isn't the only OS in the word you know - and in that case its C or Assembler or possibly C written in C++
Well, Unix and Windows systems are the most widely used OSes and Windows is, currently, of less interest to me.

If It's C hands down in Unix systems, what are the use cases for D/Rust/Go?

I seem to recall that go is meant for massively parallel systems - which reminds me must have a play with it.
Yep. Junior z/OS sysprog here. A little Assembler and some C.
I use C++. For user applications, not "systems".

-Momentum. I am already familiar with it.

-RAII and smart pointers

-Generics

-Best supported for cross-platform mobile phone use.

Python. A lot of the things that need to be done in a systems programming language, outside of kernel modules and device drivers, can be done easier in Python. And the part that needs a raw barebones language can be done in C and integrated using Python's ctypes library. As for distributed software, the UNIX process model still works and multiple Python processes can thumb their noses at the GIL and get real work done just by leveraging signals, pipes, fork, etc. And perhaps some ZeroMQ as well because some new things are really good. GOroutines are just yet another implementation of the actor model that Erlang popularized, and Erlang used the UNIX process model as its core, although they did extend it and switch to using green threads which are more lightweight than even Linux native threads.
C# for backend mainly c++ for fast response / near realtime needs js on the front and java mixes in somewhere lol
I like ATS a lot (http://www.ats-lang.org/). It's unfortunate it doesn't have much of a community.
I heard that programming in ATS is as hard as hell and when Haskell is hard to learn but joy to use, ATS is just hard to use.

Can somebody who actually programs/programmed in ATS elaborate on this?

The type system is tough to get a grip on. I would say it's a challenging language to get started in, but it has a combination of features that nothing else really has, so it's arguably worth it. I understand ATS2 improves things but I have only programmed in ATS1 so far.
Depends what you are doing but Python or Perl can make great systems programming languages.

Of course if you are doing Linux kernel hacking, you'll need C. Go and D are probably also modern examples of what could be used for systems programming as well.