Hacker News new | ask | show | jobs
by zigzag312 233 days ago
If you consider Go as a low level language, you might want to try C# which can be as low level as Go while having a lot of high level features. NativeAOT compiler allows you to statically link native libraries or create native shared libraries (.dll/.dylib/.so) that can be consumed from other languages. It's kind of 2-in-1 language, but the ecosystem is primarily focused on the high level part, so you can only depend on small portion of it.

If you are OK with less popular languages you can check any of these: Nim, Hylo (formely Val), Vale, D, or Zig.

I haven't tried any of these yet, but they all have piqued my interest. Nim is probably the easiest one.

4 comments

You can get very low-level in C# but at the point you start using unsafe the nature of the language changes very suddenly.

Unsafe C# is the most unsafe language I've ever worked with. Really terrifying stuff.

Fortunately, there have been a lot of improvements to low-level C# since v7 that make unsafe unnecessary in a lot of situations. E.g. ref structs, ref local variables, ref returns, stackalloc improvements etc.

There's an interesting comparison of these C# features with Rust: https://em-tg.github.io/csborrow/

Recently created a smart card reading n writing tool for internal use.

Manipulating bits with c# was very pleasant. Building the UI was incredibly quick and easy.

Can recommend.

Would also recommend. We've integrated many different hardware devices with an app, and the process has consistently been very straightforward.
Patriots of Pascal language family are expected to prefer Oxygene over C#
Last time I checked, NativeAOT was only for console apps, i.e. didn't support any GUI frameworks.
Avalonia and Uno both support NativeAOT:

https://avaloniaui.net/

https://platform.uno/

I was even able to statically link native dependencies during NativeAOT compilation of Avalonia app to produce a single binary. It's not the default mode for AOT compiled Avalonia, but it's possible.

ImGui.Forms is another one that supports NativeAOT.