logoalt Hacker News

ueckertoday at 9:43 AM2 repliesview on HN

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.


Replies

pjmlptoday at 9:50 AM

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.

show 4 replies
FooBarWidgettoday at 10:27 AM

> 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.

show 1 reply