>>105870493>>105871188>>105876258>>105876529The thing that C makes nonintuitive is the storage of the type in the pointer itself, e.g. the fat that you can have an int*, char*, and all these different types of pointers, rather than just having one pointer type.
It would be better if every pointer acted the way a void* does. If you only specified type when dereferencing, it would make it much clearer that a pointer is just an address, which might point to meaningful data.
>b-but that's unsafePointers are inherently unsafe, there's a way to have strict type safety, it's called not using pointers. The only time you should ever be passing something by reference instead of value is when it's a data structure, in which case the behavior needs to be encapsulated in syntax that doesn't allow manually dereferencing.
The different types of pointers are not only needlessly complicated but an illusion of safety. You have no idea if it's safe to cast something at the address to that specific type. Basically any time you get the pointer of a variable (like with &) you should be bypassing type checking entirely and the language should support it as just raw dogging memory.