4 ms·
You would be incorrect. Languages with proper type systems tend to have a much simpler specification when compared to C.
by dependenttypes 7y ago
You would be incorrect. Languages with proper type systems tend to have a much simpler specification when compared to C.
- enriquto 7y agoI mean a language that checks your arbitrary pointer arithmetic when the compiler is able to, otherwise it is not a valid program.
- kragen 7y agoI think you're probably right. I think it may be difficult to design a dependent type system that ⓐ easily checks common pointer arithmetic idioms, ⓑ rejects programs predictably rather than unpredictably, and ⓒ upon rejecting a program, offers clear guidance on how to modify the program so that it can pass (perhaps at the cost of adding an impossible error case or a redundant run-time check). But I'm no expert, so I could be wrong about that. However, C has quite a bit of ugliness in its own definition, and it might be possible to remove a lot of that.
- dependenttypes 7y agoI don't mean anything different. Right now the C specification is nearly 700 pages long. In the meanwhile you can easily define a dependent type system within two pages.