News for hackers. Stuff that matters.
Re:The Common Lisp Condition System – Upcoming Book by dmux on Wednesday July 15, 2020 @09:22AM (#23844811)
How would this work for something like an http server? Would a single response block until the issue was fixed?
Re:The Common Lisp Condition System – Upcoming Book by phoe-krk on Wednesday July 15, 2020 @09:44AM (#23845088)
If the server decides to escalate the issue to the programmer, e.g. by invoking the debugger, then yes, it would most likely hang until the programmer interactively resolves the problem (e.g. by issuing a proper restart), and only then execution would proceed.

However, that doesn't need to be the case; it is still possible to e.g. do the industry standard, which is to log all available information about the request and program state to some sort of log file or crash dumps, return a HTTP 500, and start waiting for another request. The possibility of interactive resolution of exceptional situations is a possibility, not a requirement.

It's also possible to block and invoke the debugger only in some cases, e.g. when some global debug variable is set to true. In all other cases, the system can behave automatically.

Re:The Common Lisp Condition System – Upcoming Book by dmux on Wednesday July 15, 2020 @09:59AM (#23845292)
Thanks for the reply.

>log all available information about the request and program state to some sort of log file

I've only dabbled with some Schemes, but given Lisp's homoiconic nature, I'm guessing it would also be possible to generate and persist a unit test based on the failing call too, right?

Re:The Common Lisp Condition System – Upcoming Book by phoe-krk on Wednesday July 15, 2020 @10:05AM (#23845368)
I think that'll be possible.

As long as you can persist all the state (which is easy if you are programming in a functional manner), then you will know exactly what sort of input caused a crash in your program. And when you have the data, you can write it in a manner that is later readable by the Lisp reaer.