21 ms·
Pascal doesn't have half as UB as C, or possibilities to memory corruption. Pascal here meaning compilers people actually use, not ISO Pascal from 1976, people
by pjmlp 2y ago
Pascal doesn't have half as UB as C, or possibilities to memory corruption.
Pascal here meaning compilers people actually use, not ISO Pascal from 1976, people love their C extensions after all.
A for C's simplicity, one just needs to organise a pub quiz, using ISO, and key extensions as source of inspiration.
- Rochus 2y agoWhen refering to Pascal, I mean something like Turbo, Vax or Apple Pascal, i.e. the version used at the height of popularity. Original Pascal has much less degrees of freedom. And I have no reason to assume that Turbo or Apple Pascal have less possibilities for memory corruption, or are better specified.
- pjmlp 2y agoStarts by having proper strings and array types with bounds checking instead of pointers, followed by memory allocation with types instead of sizeof math, less scenarios for implicit conversions, reference parameters reducing the use cases where an invalid pointer might be used instead.
- uecker 2y agoUB has nothing to do with complexity. In any case, from about 87 UB in the core language, we eliminated 15 in the last meeting, and already have concrete proposals for 10 more. C2Y will likely not have any trivial UB and hopefully also optional safety modes that eliminate the others.
- pjmlp 2y agoIt certainly has, as proven by recent talk at BlueHat 2024, on Windows kernel refactorings, as not everyone is knowledgeable of ISO C minutia and how optimisers take advantage of it, and still think they know better than analysers.
- uecker 2y agoMaybe you can explain this better. People not knowing about footguns is also not the same complexity, it is just having footguns and people not knowing about them.
- pjmlp 2y agoIt is a matter of wording, doesn't change the trap is on the path. Nonetheless, it is good to see efforts to reduce UB on the standard. My complaints apply to C++ as well, naturally.