HackerTube

Debugging Lisp: fix and resume a program from any point in the stack - how Common Lisp stands out.

vindarel1 HN recommender · recommended in 1 month, 2023–2025
YouTube
demo · intermediate · evergreen · 2023–2025 on HN

A five-minute demo of the Common Lisp debugger fixing a bug, recompiling a single function, and resuming execution from the failed stack frame. It shows how to avoid re-running long computations.

HN Lisp fans repeatedly link it as a short, concrete demonstration of Common Lisp's interactive debugging advantage.

12 comments from Hacker News

@vindarel2023-11 · in “Interactive Common Lisp Development”

To really discover what interactive, image-based CL development is about, my pointers: - ▶ this video (5min) my demo to show how to resume execution of a long running program, from the stack frame right before the bug, after having fixed and recompiled the function, without quitting the debugger hence without stopping the program, thus without restarting everything from zero. - link (20min)showing what saving and restoring an image does, differences between SBCL and LispWorks. - link developing a 3D graphics software. - link - debugging CL tools: link - and no: while we could deploy a ball of mud to production, we can also not and use traditional tools and techniques: build an executable from scratch, restart the app, reload state. But we can do everything in between too (inspect the running app, change it a bit, change it a whole lot (while staying in sync with local source code), use images to speed-up development etc).

Recommends View on HN
@vindarel2025-05 · in “A simple Common Lisp web app”

false premises, false conclusions, and bad good ideas in-between. > I was surprised by the absence of a quickstart page to help me set up a simple server what about link ? Also I think that the READMEs of Mito (ORM) and Djula (templating) and easy-routes (routing) are very good. Heck, Djula's documentation is excellent. Double heck, even Caveman's README, which the author uses, has a good and sufficient getting-started page. Oh, I understand, the author uses Clack/Lack… where Hunchentoot is much better documented. there are of course more blog posts, some videos. I invite any blogger to consolidate community resources. More recent: link ps: > ;; If the template is not already compiled, it is compiled, and stored in TEMPLATE-REGISTRY . won't that prevent the template to compile changes? I suggest to follow Djula's doc. > I would add a way to invalidate the cache automatically if a template changes. yeah. So don't do that ;) (also +1 to Jach's remarks and explanations) > I created a macro that ensure the table gets created correctly hummm… I'd suggest to leave the migration step explicit. > some database helpers to perform a few CRUD actions on the db. I felt the need for CRUD helpers too when defining Mito classes. However those four ones are only similar functions with same parameters but another name :] (defun db-add (instance) "Inserts a model instance into the database." (insert-dao instance)) > I would say that there are better languages for developing modern web apps

@vindarel2024-06 · in “Ask HN: 30y After 'On Lisp', PAIP etc., Is Lisp Still "Beating the Averages"?”

> all the other languages have kept picking up nearly everything once-cutting-edge about Lisp not all of them have CL's set of features: excellent long-live REPL, image-based development, compiling to binaries, the condition system, the interactive debugger and excellent developper tools (resumable stack frames, never re-run a long operation from zero [1]), the whole language at compile-time, stable syntax, extensible syntax, stable ecosystem, fast implementations, numeric tower, first-class interop to Java (LispWorks, ABCL), commercial support, mobile platforms delivery (LispWorks)… New CL implementations get created (CLASP, CL on C++ with LLVM or NPT, in C) and CL compilers and libraries evolve too [2]. SBCL is now callable as a shared library, it got a SIMD module, rumors say a bear party after ELS 2024 escalated and that they are adding coroutines soon. ECL is targetting WASM, all other major implementations had new releases. New libraries unlock new possibilities (Coalton: Haskell-like typing on top of CL), companies still pick CL today (CL is all the rage in quantum computing?), the community creates more resources and more tools such as, last but not least, new editor plugins o/ link (VSCode, Pulsar, Jetbrains, Sublime, Jupyter… Lem of course etc) [1]: ▶ this video [2]: link

@skydhash2024-06 · in “The Functional Programming Hiring Problem”

When you redefine a function in CL, every function that use this function is notified of the change and pickup the new version. And because it's functional and you're not supposed to modify the state outside your function, everything will keep churning. The issue with emacs is the sheer number of variables. And the fact they're global. That leads you to do stuff you shouldn't do. But the principles are essentially the same. And in CL, you can snapshot the current state of your program to a file. Then restart later, instead of reloading the environment from the code. A quick demo: ▶ this video

@trealira2024-06 · in “The plan-execute pattern”

> the code that is currently executing can be manipulated live Typically when people say this about Lisp, they mean that they can redefine functions and objects live, having all the code adapt to use the new definitions, or when their code hits an error, they can not only redefine functions and objects live, but also examine the state of the call stack and change the values of variables live, and then let the code run again. This[0] is a clear explanation that I found. There's also a video[1] that shows the same thing. However, I don't know if those apply to Scheme. Also, I am pretty sure it is unrelated to Lisp being homoiconic, and that it's more about it being dynamically typed and interpretable. [0]: link [1]: ▶ this video