4 ms·
C is itself Modula-2 with (exactly) C syntax. It is hard to imagine a definition of modern that would include Modula-2.
by ncmncm 5y ago
C is itself Modula-2 with (exactly) C syntax. It is hard to imagine a definition of modern that would include Modula-2.
- pjmlp 5y agoOn the contrary, it doesn't do bounds checking, strong typing, modules, co-rotines, explicit unsafe, exceptions, objects, garbage collection for GC types. C is completely unlike the original Modula-2, and even less so when compared with the extended standard from the late 80's. As for an actual definition, Zig is one of those that come to mind.
- ncmncm 5y agoMy Modula-2 book doesn't mention most of those things. The Modula-2 it describes was about equivalent to C with syntax modernizations and a nod to modules. I suspect you may be conflating it with a later effort, maybe Modula-3.
- pjmlp 5y agoTime to update your Modula-2 book past 1978 first ISO standard, here Extended ISO Modula-2: https://modula2.awiedemann.de/manual/comp3.html https://modula2.awiedemann.de/manual/comp3.html Which alongside Modula-2+, served as influence to Modula-3. Stuff C definitely doesn't have, even when compared with 1978 Modula-2 standard: - Proper strings with bounds checking - Proper arrays with bounds checking - Type safe enumerations - Set types - Arrays with enumerated types as indexes, flexibility to set lower and upper bounds - Explicit unsafe code - Reference parameters - Nominal types - Subranges - Explicit casts for several cases where C would do implicit casts or type promotions - Co-routines