News for hackers. Stuff that matters.
Re:Stop Writing Dead Programs (Transcript) by dclowd9901 on Tuesday October 18, 2022 @10:38PM (#33256847)
In web, I’d kill for a way to debug an error by replicating user’s state and play back actions and requests while stepping through an uncompiled version of the application running. I think I could solve bugs into infinity if I had that kind of power.

This kind of thing shouldn’t even be difficult, yet I have never been anywhere that has this kind of live code retrospection.

Re:Stop Writing Dead Programs (Transcript) by grzm on Tuesday October 18, 2022 @10:52PM (#33256943)
Fulcro (a library for Clojure/ClojureScript web applications ) has a way of doing this, and I'm sure it's not unique in this aspect: I just don't do enough work in this space to be familiar with the other offerings. This type of feature is valued in the Clojure community, so I wouldn't be surprised if reagent has something like this as well. And this type of thing isn't unique to Clojure, either.

* https://book.fulcrologic.com/#_install_fulcro_inspect

* https://reagent-project.github.io

Re:Stop Writing Dead Programs (Transcript) by geokon on Thursday October 20, 2022 @01:48AM (#33271264)
Ironically one of my major annoyances in debugging Clojure is that stack traces don't come with a program state that can be inspected (as you get in ELisp or GDB)
Re:Stop Writing Dead Programs (Transcript) by grzm on Thursday October 20, 2022 @01:51AM (#33271279)
Agreed. Having a proper condition system in Clojure would be really great.
Re:Stop Writing Dead Programs (Transcript) by jackrusher on Thursday October 20, 2022 @02:10PM (#33278484)
. Sadly, the JVM unwinds the stack before returning the exception, which makes doing the right thing very hard.
Re:Stop Writing Dead Programs (Transcript) by geokon on Friday October 21, 2022 @12:26AM (#33284498)
I'm probably missing some subtlety. I'd think you could have some "debug mode" layer where the Clojure runtime catches exceptions. Basically wrapping every exception in Clojure with a try/catch, and doing a try/catch on every interop call

It's not ideal having two different modes (like a C++ Release/Debug) - but it'd be better than the current situation

Maybe this is what CIDER's debug macro is actually doing - I always forget to play around with it :) I'll need to try it in the future.

btw, thanks for your work. I really appreciate the stuff you've shared and it's nice to know someone else also uses thing/geom :))

Has the highly decoupled "mini-library" thing/geom architecture influenced Clerk? I'm been meaning to try it out - but notebooks always feel like they come with some ecosystem lock-in (esp if it's a company trying to make money - ie. Nextjournal). It'd guess it's part of why everyone reverts back to plain text. With thing/geom I just pick and choose and tweak the pieces I need - and then swap them out when I want to change to something else entirely (mostly for building GUI applications in CLJFX)

Re:Stop Writing Dead Programs (Transcript) by sfink on Thursday October 20, 2022 @04:53PM (#33280538)