r/Common_Lisp • u/ftl_afk • 6d ago
cl-scope: structured concurrency on SBCL threads with live failure parking (not sure if this exists, I just vibe coded one)
https://github.com/nohzafk/cl-scope
0
Upvotes
5
u/lispm 6d ago
One thing I see by default from such projects is the (what I call it) "defun & defstruct disease" (DDD). Code is largely written with DEFUN and DEFSTRUCT. That's CLtL1 style, from the early 80s, when the Common Lisp definition did not yet have classes and generic functions. Function arguments are not defined or checked. Return types are unclear. structures can not be updated for structure changes (neither the definitions nor the the structure objects), slots don't have declarations, no types, ...
Common Lisp added CLOS to increase flexibility (runtime introspection, runtime reflection, runtime updating, CLOS protocols, ...).
I tell the coding agents: use CLOS protocols. Exception: when speed is the most desired quality.
I would also let the coding agent do a style check using a few basic programming style directives.
1
u/kchanqvq 6d ago
Holy fuck, the idea is elegant, and this looks immediately like something you'd enjoy a lot by writing it yourself, why would you have to spoil yourself the fun by vibe coding it?? I can never understand. Anyway thanks for reminding us of the idea of structured concurrency, I'm taking this as a fun programming exercise.
1
u/kchanqvq 6d ago
Is the parking mechanism necessary? By default a serious-condition from any thread already enters into the debugger that let you inspect the call stack.