Does anyone know of languages that achieve this? I'm interested, I'm currently implementing a project in x86 assembly for this reason, and am happy to try a higher level language.
(Barring compiler bugs, of course.)
There are of course some higher-level features like trait-based generics, so it's not really as close to the machine as C, but it's a lot closer to C IMO than something like Java (or even C++).
Also trait inheritance exists, enforced via trait bounds, what Rust doesn't support is class inheritance.
Yes it does, if your concern is “how often do I encounter code where I can’t predict or control what it actually does on the hardware”.
https://ziglang.org/documentation/0.13.0/#Undefined-Behavior
Also it wasn't what the parent asked for, and I quote: "close to the hardware" language