this post was submitted on 13 Oct 2025
21 points (100.0% liked)

programming

276 readers
1 users here now

  1. Post about programming, interesting repos, learning to program, etc. Let's try to keep free software posts in the c/libre comm unless the post is about the programming/is to the repo.

  2. Do not doxx yourself by posting a repo that is yours and in any way leads to your personally identifying information. Use reports if necessary to alert mods to a potential doxxing.

  3. Be kind, keep struggle sessions focused on the topic of programming.

founded 2 years ago
MODERATORS
 

I get dizzy looking at C-like languages, they just feel incredibly hard to follow compared to an S-expression.

Everything this just so verbose and there's so much negative space between the lines. To be fair, this course is making us program using Java so maybe it has to do more with that.

you are viewing a single comment's thread
view the rest of the comments
[โ€“] Tomorrow_Farewell@hexbear.net 2 points 1 week ago (1 children)

I'm curious about a couple of points:

including changing function definitions

Is one forced to do it with the standard CLI REPL, or can one edit the code more selectively like how it's done with text editors?

and select a restart to call (or just restart from a specific stack frame)

Do I understand it correctly, that the following scenario is possible:

  • Some function is called
  • Somewhere during its execution a break is evaluated
  • A programmer redefines the function
  • The programmer resumes the program's execution from the point where the problematic function (which is now redefined) was called
    ?
[โ€“] lilypad@hexbear.net 2 points 1 week ago

Is one forced to do it with the standard CLI REPL

In emacs, you interact with the image in a smoother fashion than typing at the repl; you write your code in a file like any normal project, and then you can load either that file or a single top level form into the image. While this happens using the repl (or the slynk/slime equivalent) it is done with a single keystroke. So youre working in the files and sending definitions to the image.

Do I understand it correctly, that the following scenario is possible:

  • Some function is called
  • Somewhere during its execution a break is evaluated
  • A programmer redefines the function
  • The programmer resumes the program's execution from the point where the problematic function (which is now redefined) was called?

Close. You cant restart from within a function; if you redefine a function you have to restart from that functions call point in the function that called it. Normally instead of doing this programmers establish restarts (a thing that says how to restart from a certain point, which should handle any cleanup thats needed, etc.). But resuming execution is exactly what happens.

  • condition is signalled (through error, signal, break, etc.)
  • search for an applicable handler and if found, call it. This means the handler is called below the condition signalling function on the call stack, and has access to the entire dynamic extent. Handlers can search for restarts and invoke them, return to a specific point, etc.
  • if one isnt found, invoke the debugger (which can be customized).
  • in the debugger the programmer can inspect stack values, functions and their arguments, and just really tear into all the available information. The programmer can also evaluate code still, and even beyond this they can evaluate code within a specific stack frame (tho this is only really useful for getting local variable definitions that havent been compiled away).
  • make decision on how to fix the issue (generally either invoke a restart (such as "abort to toplevel" or e.g. "retry http request" if working with webdev) or restarting from a specific stack frame or returning a specific value from a specific stack frame).