top | item 18686506

(no title)

mmirate | 7 years ago

And also wonderfully devoid of error-handling, too. It's the most common way for beautiful-looking C code to look beautiful.

discuss

order

caf|7 years ago

A compiler is in the happy position where there is little point in continuing to run after encountering an error, so it can bail right out with exit(2) after reporting the error to the user. This means that the contract on parse(), for example, can be that if it returns, it has succeeded.

vlovich123|7 years ago

Except of course LLVM has proven the value in not assuming this pattern & building your compiler as a library of which the executable entrypoint is but one frontend.

cheez|7 years ago

Unless the programmer uses the null object pattern in which case everything is hunky dory. For example, an empty "Program" would probably do the job.