Ask HN: What less-popular systems programming language are you using?

50 points by fuzztester a day ago

Less popular or less commonly used ones.

By that, I mean, not including the usual suspects, such as C, C++, Rust and Go (I know the controversy about the last one being a systems programming language or not).

I'm asking this because I used C for both application programming and systems programming, early in my career, before I moved to using other languages such as Java and Python.

And of late, I've been wanting to get back to doing some systems programming, but preferably in a more modern language (than C) which is meant for that.

pyjarrett a day ago

Ada

The open source tooling has significantly improved since I started using it in the last five years.

giancarlostoro a day ago

Every now and then Freepascal with Lazarus but the same bug being in the IDE for ten years plus kind of annoys me. If I save a new project and I move any files around it does weird stuff, or if I rename a module.

Theres also D but finding libraries for whatever I want to work on proves problematic at times as well.

  • Froedlich a day ago

    On the other hand, the Ultibo OS for the Raspberry Pi is written in FreePascal.

kevlar700 20 hours ago

Loving Ada without using exceptions or inheritance on embedded and desktop. Some love Ada full OOP tagged types. I love Ada procedural style with privacy and abstract data types. I wish Flutter was written in Ada but atleast Dart is better than JavaScript atleast for procedural code without it's oop boiler plate. You don't actually need OOP for widgets.

Jtsummers a day ago

Not presently, but not long ago, Fortran and Ada. I still like Ada better than the alternatives, especially as it's changed this past couple decades. I find it hard to miss Fortran, though. I'd consider it for scientific computing and that's about it, which isn't my present domain.

  • quanto a day ago

    How would Fortran be used other than numerics/scientific computing?

    • AlexeyBrin 19 hours ago

      Modern Fortran has ISO C bindings in its standard library. You can call any C library from Fortran and wrap it in a Fortran module if you want to make it easier to use.

      Despite its history it is a pretty modern language if you enable all warnings, set implicit none and ignore the old style of coding (a la FORTRAN 77 of older).

    • Jtsummers a day ago

      This was in an embedded systems context, I came on later but it was what most of the core system was written in. It's been used in a lot of avionics systems over the years.

    • fuzztester a day ago

      not a direct answer to your question, but the use in the domain you mentioned itself, is huge.

      from the Wikipedia article about Fortran, under the Science and Engineering section:

      https://en.m.wikipedia.org/wiki/Fortran

      Although a 1968 journal article by the authors of BASIC already described FORTRAN as "old-fashioned",[58] programs have been written in Fortran for many decades and there is a vast body of Fortran software in daily use throughout the scientific and engineering communities.[59] Jay Pasachoff wrote in 1984 that "physics and astronomy students simply have to learn FORTRAN. So much exists in FORTRAN that it seems unlikely that scientists will change to Pascal, Modula-2, or whatever."[60] In 1993, Cecil E. Leith called FORTRAN the "mother tongue of scientific computing", adding that its replacement by any other possible language "may remain a forlorn hope".[61]

      It is the primary language for some of the most intensive super-computing tasks, such as in astronomy, climate modeling, computational chemistry, computational economics, computational fluid dynamics, computational physics, data analysis,[62] hydrological modeling, numerical linear algebra and numerical libraries (LAPACK, IMSL and NAG), optimization, satellite simulation, structural engineering, and weather prediction.[63] Many of the floating-point benchmarks to gauge the performance of new computer processors, such as the floating-point components of the SPEC benchmarks (e.g., CFP2006, CFP2017) are written in Fortran. Math algorithms are well documented in Numerical Recipes.

  • fuzztester a day ago

    Interesting, thanks.

    Did you ever check out Eiffel for systems programming work?

    I had been checking it out some years ago, and apart from the general points about it, one use of it that I found interesting was in an article about using it for creating HP printer drivers. The author had mentioned some concrete benefits that they found from using it for that purpose.

    Edit: I searched for that article, and found it:

    Eiffel for embedded systems at Hewlett-Packard:

    https://archive.eiffel.com/eiffel/projects/hp/creel.html

    • Jtsummers a day ago

      I learned it once long ago, but never used it for anything other than that learning experience. I did like its concepts, though the language itself didn't quite stick with me.

mkovach 17 hours ago

Free Pascal, but I am interested in Ada and will be learning it more this year. I love the readability of the syntax, and on the outside looking in, the community seems good.

I have also moved back hard to using TCL as my scripting language. I like it too much, and bouncing between Python, Go, and such for DevOps glue tires me out.

For systems, I love using plan9 (9front) to solve problems, which grounds me to C, awk, sed, and the rc shell.

gw2 a day ago

C#. While a popular language, it is criminally overlooked for high-performance programming. Obviously, you can't use it for embedded or kernel development. For other use cases though, it can almost reach the performance of C/C++/Rust when written with proper care.

  • graboid a day ago

    I sometimes write C# in my day job. But I think I don't know much about how to write really fast C#. Do you have any recommendations for learning resources on that topic?

    • gw2 a day ago

      Sure. Here are some resources:

      * Span<T>: https://learn.microsoft.com/en-us/archive/msdn-magazine/2018...

      * C# now has a limited borrow checker-like mechanism to safely handle local references: https://em-tg.github.io/csborrow/

      * Here is a series of articles on the topic: https://www.stevejgordon.co.uk/writing-high-performance-csha...

      * In general, avoid enterprise style C# (ie., lots of class and design patterns) and features like LINQ which allocate a lot of temporaries.

      • graboid 21 hours ago

        Thank you. I once read a bit about Span<T>, but some of this reference stuff is very new to me. Interesting, definitely. C# really is a big language nowadays...

        • neonsunset 20 hours ago

          Spans are just a slice type, but those which any type based on contiguous memory can be coerced to (usually). I’m sure you’re already using them somewhere without realizing that. Their main use case in regular code is zero-cost slicing e.g. text.AsSpan(2..8).

      • xigoi a day ago

        C# is specifically designed for enterprise-style OOP, so if you want to avoid that, why use C# at all?

        • gw2 21 hours ago

          > C# is specifically designed for enterprise-style OOP

          Then why would they add Span<T>, SIMD types and overhaul ref types in the first place?

          • xigoi 20 hours ago

            Because some people wanted to use C# for low-level programming, so they added these things as an afterthought.

            • neonsunset 20 hours ago

              You’ve clearly never used it and have no idea what you are talking about.

              • xigoi 20 hours ago

                I have used it a few years ago and the enforced OOP boilerplate was too much for me.

                • neonsunset 20 hours ago

                  Trying to write it as if it was a different language instead or, for whatever reason, copying the worst style a team could come up with does happen and must be avoided, but that’s user error and not a language issue. Also the tooling, especially CLI, is excellent and on par with what you find in Rust, far ahead of Java and C++.

                  If you link an example snippet of the type of code that gave you pause, I’m sure there is a better and more idiomatic way to write it.

      • neonsunset 20 hours ago

        LINQ is fine (but enterprise style never is, yes), it’s a matter of scale and what kind of a domain the code is targeted too. C# needs to be approached a little like C++ and Rust in this regard. Having standard performance optimization knowledge helps greatly.

        Also can recommend reading all the performance improvements blog posts by Stephen Toub as well as learning to understand disassembly at a basic level which .NET offers a few convenient tools to get access to.

docandrew a day ago

Ada for bigger projects, D for quick one-offs and more “scripty” work.

  • fuzztester 8 hours ago

    I had played around with D some time ago, and wrote some small programs in it for fun and learning. I both liked and disliked things about the language.

    there was some Russian dev running a systems tech company, I forget his name, living in Thailand, like in koh samui or similar place. he used D for his work, which was software products. came across him on the net. I saw a couple of his posts about D.

    one was titled, why D, and the other was, D as a scripting language.

    I thought both were good.

ajdude a day ago

I almost exclusively work in Ada for my hobby projects these days; It's great for doing both high level and low level programming.

  • alok-g a day ago

    Where does tooling and platform support stand for Ada? Could one develop desktop, mobile, web apps, too using Ada? Thanks.

lopatin a day ago

I started using Idris a few years ago because the idea is fascinating. Such as state machines in your type system, the size of a list being defined in the static type system, even if the list size changes over time (pretty mind blowing), etc..

But ultimately I realized that I’m not writing the type of software which requires such strict verification. If I was writing an internet protocol or something like that, I may reach for it again.

xigoi a day ago

Nim, I love its “make simple things simple and complex things possible” philosophy.

  • blashyrk 13 hours ago

    I absolutely adore Nim.

    That said, the edges are still (very) rough when it comes to tooling (generics and macros absolutely murder Nimsuggest/lsp) and also "invisible" things impacting performance such as defect handling (--panics:on) and the way the different memory management schemes introduce different types of overhead even when working with purely stack allocated data.

    But even with all that it's still an extremely pleasant and performant language to work with (when writing single threaded programs at least)

Froedlich a day ago

The only true "system programming" I've done was in Microsoft Macro Assembler, a product I grew to hate with a passion.

A non-answer, but tangentially relevant:

I once fiddled with Forth, but never actually accomplished anything with it.

Several OSs are written in Lisp; in some of them the difference between OS and application is a bit vague. At the time none of them were available to me to play with.

I discovered Oberon and fell in love. My first real programming language was Pascal, and Oberon is part of the same family. Oberon consisted of a compiler, operating system, user interface, application software, and tools, all self-hosted on Oberon. There was even an Oberon CPU at one time. But Oberon turned out to be just an academic curiosity, and wasn't available for any hardware I had access to anyway.

anta40 a day ago

Pascal.

Sure these days not many folks write OS kernel in Pascal, but there are some, e.g: https://github.com/torokernel/torokernel

I once want to try Forth (perhaps there's a Unix clone in Forth?), but seems like most folks using it are embedded/hardware devs.

  • fuzztester 10 hours ago

    I had read somewhere that some of the early Apple (not Mac) software, i.e., systems, application or both, was written in some Pascal variant.

ghfhghg a day ago

F# and Haxe. Love both of those languages

dismalaf a day ago

Odin. It's just too easy and fun.

  • fuzztester a day ago

    Why is Odin easy for you? Because it is non-OOP (I think, have not confirmed that) or some other reason?

    • dismalaf 18 hours ago

      Build system, module system, simplicity of C but much nicer, clearer syntax, lots of batteries included, it just does a lot of stuff to make life easier versus Zig or C/C++.

      I personally don't think programming paradigms like OOP, procedural or functional make anything easier/harder necessarily, just talking QoL stuff.

      And obviously "easy" is relative: Odin is still a low level language where you need to manage your own memory.

yamapikarya a day ago

visual basic. i learned a lot from this language because i'm able to create a system from scratch without import a library.

neonsunset 19 hours ago

C#, to match the performance of reference implementations in C and Rust, and completely crush the performance of those in Go :)

  • fuzztester 11 hours ago

    what do you mean by reference implementations, in this context?

    • neonsunset 10 hours ago

      All sorts of algorithms for processing data useful in high-load scenarios: checksum calculation, text searching/analysis/transformation, data compression, networking (request analysis, routing, filtering), interop with other C ABI dependencies, etc.

fuzztester 11 hours ago

commenting after seeing multiple comments here, after about a day.

first of all, thanks, guys, to all who replied. that's a wealth of info to follow up on.

referring to the comments seen so far:

I considered mentioning (Free) Pascal, but thought of not doing it, because I thought it is nowadays too niche, even though it is one of my early programming language loves (forgetting that the title of my post says "less popular languages" :)

and I also didn't think of Ada at all, somehow, although have been interested in it, too, lately, and have been checking out websites and blogs about it, and also have been searching hn.algolia.com for posts about it.

so it was cool to see multiple mentions of Ada here, by people who like and use it.

atemerev a day ago

D and Crystal always fascinate me. And if Go is a system language, Erlang and Common Lisp are even more so.

artemonster a day ago

Tried trying zig, but was baffled by all the allocator dance you need to do and asking nicely to access a list (catching potential exceptions?) Tried odin, but the tooling is very raw. Tried rust, didnt want to try to please borrow checker that distracts me from my thoughts.

Idk, if someone just reinvents clean C without the nonsense garbage with some modules and package manager this will be a huge win. Let me access my null pointers, let me leak memory, just get the hell out of my way and let me program and hold my hand only where I want it to be held - sane types that give me refactoring, code completion and code understanding, modules with imports. Let compiler give sane error messages instead of this cryptic c++ garbage. Is this too much to ask?

  • gw2 a day ago

    D's "Better C"[1] mode looks like what you describe. Has syntax similar to C with a real module system, metaprogramming, slice types etc.,

    1 - https://dlang.org/spec/betterc.html

  • flowerthoughts a day ago

    I also had a brief look at Zig for writing a WASM module, but settled for Rust. I had no real gripes with the language, but the spartan documentation made making progress into a slog.

    I wouldn't mind a "better C" that could use an LLM for static code analysis while I was coding. I.e. be more strict about typing, perhaps. Get out of my way, but please inform me if I need more coffee.

  • acheong08 a day ago

    Allocation in Zig takes some getting used to but it's actually really nice. It took me a few weeks but I honestly believe you should give it another chance and more time

  • feelamee a day ago

    looks like zig is exactly what you want. Difference only in std. C prefer global allocator, while zig ask it explicitly.

    So, if only there is std with implicit allocators?

netbioserror a day ago

Nim. Fantastic choice for modern headless software. Simple obvious type system, preference for immutability and referential transparency. Dynamic collections are by default managed by hidden unique pointers on the stack. So the default RC isn't necessary unless explicitly invoked for a ref type.

Currently solo managing a 30k line data analysis application I built for my company. Easily fits in my head given the obvious pyramidal functional-like structure. Maybe two lines of memory semantics anywhere in the entire thing, and only one module that's OO with a constrained scope. Lots of static data files (style sheets, fonts) slurped up as const strings at compile time. Incredible performance. Invoked by our PHP server backend, so instead of doing parallel or async in the analysis, the server gets that through batch invocation.

Working stupid well for our product, plus I can easily compile binaries that run on ARM and RISC-V chips for our embedded team just by invoking the proper gcc backend.

Replaced an ailing and deliberately obfuscated 20 year old jumble of C and PHP designed to extort an IP settlement from my company. Did it in a year.