|
|
|
|
|
by Spivak
91 days ago
|
|
I was talking about the int being 32 bits and the pointer being 64 bits but go off. If you did a naive codegen of this without type checking where the compiler just said "yes ma'am blindly copying the value to &x" then you would clobber adjacent memory. That's the point I'm making, you rely on the type checker to make the types actually mean things and give you safety guarantees. It feels stronger is languages where you can't even produce a running program if type checking fails but it's conceptually the same. |
|
If you want to see a language which does not have types you want the predecessor of C, B.
Imagining into existence a variant of C where assignment causes arbitrary memory overwrites isn't about type checking, that's not a "naive codegen" it's nonsense. If that was your point then you didn't do a good job of communicating it and it's still wrong.