Hacker News new | ask | show | jobs
by shrimp_emoji 1162 days ago
Yep.

You think C is "low level", but it was once considered "high level", and the compiler does many things you don't want, and the standard's ambiguously-worded, and implementers have their own interpretations about the ambiguity, and also bugs in their compilers, and you eventually arrive at:

"If you really want those instructions to happen in this function, without fear of magic, write them in assembly."

2 comments

Then you realize that your CPU has hardware bugs, and you go design and manufacture your own CPU :).
“I don’t get much programming done these days, what with all the goat herding…”
You mean atom moving?

I just move atoms until the program I desire is on the computer.

Obligatory xkcd https://xkcd.com/378/
> but it was once considered "high level"

C's position in the "low- vs high-level" hierarchy arguable hasn't changed much since it was created. There were already higher level languages in the 60's (e.g. languages which abstracted the underlying hardware much more than C, but those weren't useful for writing an operating system in).

From what I have seen, there are two “contending” definitions for what is high-low level languages: one considers anything above assembly languages high-level, the other is less concrete, and would put for example managed languages into the high level category/towards that end of the spectrum, while C, Rust, C++ would be on the lower end, assembly even lower.

I prefer the latter definition, as the former is, while objective, quite useless. The second definition could be expanded by a partial order between languages by “feature X can be emulated in it” with some caveats[1], and then we might even get Rust/C++ beat C for low-levelness, since C don’t have any way to force vectorization (compiler-specific intrinsics don’t count!).

[1] since most languages employ FFI/linking, not even this definition is too specific — would probably have to write it as the “idiomatic language can emulate feature”