> <i>To complete the list of things that C might provide but doesn't: It has no storage management, like Pascal's new function</i><p>Pascal is essentially just the abandoned prototype for more grown-up designs like Modula-2.<p>The Modula-2 language an allocation mechanism more similar to malloc and free. And, actually, early versions of that were broken: there was a way to ask how much memory remains before trying the memory allocation request, with no way to know whether it succeeded.<p>Guess what? This was fixed in the ISO standard.<p>See here, the ISO function reference on modula2.org:<p><a href="http://modula2.org/reference/isomodules/isomodule.php?file=STORAGE.DEF" rel="nofollow">http://modula2.org/reference/isomodules/isomodule.php?file=S...</a><p><pre><code> PROCEDURE ALLOCATE (VAR addr: SYSTEM.ADDRESS; amount: CARDINAL);
(* Allocates storage for a variable of size amount and assigns the address of this
variable to addr. If there is insufficient unallocated storage to do this, the
value NIL is assigned to addr.
*)
</code></pre>
So ISO Modula 2 has an allocator that pretty much exactly like malloc and free. (It's worse: DEALLOCATE needs to know the size!)<p>If Pascal's way was better, it would have survived into Modula-2.<p>Also, Modula-2 has I/O functions that you try first, and then check the result. Streams are called "channels":<p><pre><code> PROCEDURE ReadRestLine (cid: IOChan.ChanId; VAR s: ARRAY OF CHAR);
(* Removes any remaining characters from the input stream cid before the next line mark,
copying to s as many as can be accommodated as a string value. The read result is set
to the value allRight, outOfRange, endOfLine, or endOfInput.
*)
</code></pre>
More like C, again. None of this business of knowing whether we are at end-of-file or end-of-line without trying any input.