What, again?
Posted May 2, 2007 18:29 UTC (Wed) by
ncm (subscriber, #165)
In reply to:
What, again? by schaueho
Parent article:
The Rise of Functional Languages (Linux Journal)
Yes, Common Lisp, like C, has access to file handles and sockets. However, as in C, you cannot abstract management of them. To be very precise, if you put a socket in some larger data structure, you must explicitly call some cleanup function to ensure it gets closed in a timely fashion. You cannot automate this management. You cannot write a library which invisibly embeds a socket without exposing to the user a need to call your own cleanup function. ("Finalization" is no help, and in real systems has proven actually harmful.)
Without the ability to automate such management, exception handling facilities are a cruel joke, unable to concentrate error handling in a few well-tested spots. Instead, you get "finally" clauses, hundreds or thousands of separate snippets of error handling code scattered throughout one's program, as hard to exercise as error-code returns, and as likely to be wrong.
The true cost of most languages' failure to provide the rudiments of resource management is hard to bound. It ends up touching everything.
(
Log in to post comments)