3 ms·
>C has stopped being a high level Assembly for quite a while now. ...No, not especially. It may not expose CPU-specific functionality in the spec, which is why
by qwertyuiop924 10y ago
>C has stopped being a high level Assembly for quite a while now.
...No, not especially. It may not expose CPU-specific functionality in the spec, which is why it is somewhat portable, but it still is effectively good at the same things asm is good at. That's why C is sometimes dubbed "portable assembly"
>Also the pile of UB patterns that C compilers have accumulated throughout the years, and the differences between compilers, makes it actually easier to reason about code at the Assembly level than looking at C code.
Well, yeah. Asm is rigorously defined. It's perhaps the only language that has absolutely zero UB in practice (many languages CLAIM to have no UB, but if you're on multiple architectures, it's almost unavoidable, although few have as much as C): because it's totally unportable, it doesn't have to lean on UB the way C does for optimization.
>Only now almost 30 years later has C++ surpassed C in many use cases, but it still carries C with it.
Yeah, but C++ has... other problems.
>C could have been made so much safer with a few tiny changes, like having optional bounds checking and not decaying arrays into pointers.
Now that's something I wish happened.