Hacker News new | past | comments | ask | show | jobs | submit
Not every high-level language gives you byte-level access to the representation of memory objects.

But it is also wrong to reduce a language to what is in the spec.

Many do, contrary to what many C advocates talk about.

Apparently reducing the language to what is in the spec is only a thing when talking about C and to some extent C++.

When other languages have compiler specific extensions beyond the spec, it is a failure in their design.

Yet when C and C++ devs have to reach out to compiler specific extensions, it is not a design failure like it is pointed out to others, rather an advantage.

It is also wrong to not apply the same measure when it doesn't suit the message.

_You_ do that. All the time. And then you fight these strawmans.
loading story #49257043
Lot of stawman arguments.
loading story #49255824
loading story #49255927
"When other languages have compiler specific extensions beyond the spec, it is a failure in their design."

This one of the failures of Linus T. with the linux kernel: he was not able to keep the assembly source code with plain and simple C code you can compile with a small and alternative C compiler (same failure for the glibc devs I think).

I don't blame him, he is already keeping the linux ABI stable, and pulling that off is something.

loading story #49256904
> Not every high-level language gives you byte-level access to the representation of memory objects.

Any code that ventures anywhere near that territory is 99% Undefined Behavior. It's almost impossible to write proper C/C++ code that isn't UB while touching byte-level representations.

This is certainly not true. Accessing bytes of objects is well-defined in C.
loading story #49257299