
Ask HN: Low-level programming besides C and Rust - ansible
I&#x27;ve been thinking about porting &#x2F; rewriting a Minix-like operating system to a new CPU.<p>I&#x27;ve been programming in C (and to a lesser extent C++) for a long time, so there&#x27;s always that.<p>I&#x27;ve looked briefly at Rust here and there.  I have previously tried to wrap my brain around Haskell, with limited success, and never really got comfortable with it.  It seems like really grokking Rust will be a similar effort.<p>Is there anything else in the low-level embedded space that might be suitable?<p>I&#x27;m mostly concerned about simplicity and safety.  I&#x27;m willing to trade some verbosity for tight and efficient generated code.<p>Edit: I also also add I&#x27;m thinking I should stay away from garbage-collected languages, since this is intended for low level operating system development.  I don&#x27;t know if adding in real-time requirements is a good idea, but I wouldn&#x27;t want to close off that possibility either.
======
softinio
How about:

[https://dlang.org](https://dlang.org)

or

[https://nim-lang.org](https://nim-lang.org)

~~~
ansible
I had previously looked at D a while back, before I was thinking about this
project. It did seem an improvement upon C, but not enough of one to make it
worth the switch. Also, for this project, I'm looking for something without
garbage collection.

I hadn't really looked closely at Nim before, but it is garbage-collected too,
so I don't think that's going to work.

~~~
dom96
You can use Nim without a garbage collector. I've seen it running on plenty of
micro-controllers in this way.

~~~
ansible
> _You can use Nim without a garbage collector. I 've seen it running on
> plenty of micro-controllers in this way._

That's interesting.

Nim compiles to C, so it doesn't look like it would require much in the way of
porting. I'll take a closer look at that too.

------
dozzie
Ada?

~~~
ansible
Probably not Ada itself, but I'll a little more closely into SPARK, which is
based on a subset of Ada and is intended for high assurance applications.

[https://en.wikipedia.org/wiki/SPARK_(programming_language)](https://en.wikipedia.org/wiki/SPARK_\(programming_language\))

