Skip to content

Conversation

@jpco
Copy link
Collaborator

@jpco jpco commented Dec 7, 2025

The esdebug script is a cool and useful bit of es, but it has been broken for a while.

This PR makes changes imposed by language drift over time so that esdebug can again be run like before.

  • Replace #! /bin/es with #!/usr/local/bin/es, reflecting the standard install location today
  • Replace line call with %read
  • Replace return with result where the exception behavior isn't necessary
  • Replace $&while with a lexically-captured while
  • Replace dispatch param to %interactive-loop with dynamically-defined fn-%dispatch
  • Handle exit's change to an exception

The script is still pretty old and crufty, though, and there's quite a bit more that could be done as a follow-up to clean this up and make it more useful if we wanted to actually, say, distribute it with the shell.

  • Use lexically-bound %seq and if to get rid of the primitive madness
  • Lean on lexical binding harder in order to better isolate debugger state
  • Improve behavior around settor functions and trap/trace/watch
  • Test it and fix the bugs that are still too easy to run into
  • Document it, since debuggers tend to be complicated to use

Because I can't leave well enough alone, here are also some fancier things that could be done if runtime support were added:

@jpco jpco merged commit 64bbf54 into wryun:master Dec 12, 2025
1 check passed
@jpco jpco deleted the es-debug branch December 12, 2025 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant