Hi everyone,

I got myself in a bit of a rabbit hole tonight, I wanted to figure out
how to have evaluated code give good backtraces.

So I started digging in (ice-9 eval), and I saw no debug information
coming from `memoize-expression'.

So I started digging in memoize.c, and I saw no debug information, and I
didn’t understand too much, and gdb was having a hard time with the
structs.

So I started digging the git log, and I saw this:

Andy Wingo, 2009 b7742c6b7132544b9d6cd9cb32c09e2084ad9e52
* libguile/memoize.c: New memoizer, which runs before evaluation,
  checking all syntax before evaluation begins. Significantly, no
  debugging information is left for lexical variables, which is not so
  great for interactive debugging; perhaps we should change this to have
  a var list in the future as per the classic interpreters. But it's
  quite fast, and the resulting code is quite good. Also note that it
  doesn't produce ilocs, memoized code is a smob whose type is in the
  first word of the smob itself.

The same commit mentions that it was made as part of the C-based
evaluator that was supposed to be only used for bootstrapping, but it
turns out that our scheme-based evaluator uses the same memoization.

So, what to do? I wasn’t there when it happened, and I’m probably
missing a lot of historical information. What was the plan?

Should it be that a new memoization is made in scheme to go with the
scheme evaluator, or that the existing memoization is adapted to keep
debug information?

Or am I completely off the mark?

Thanks,
Noé

Attachment: signature.asc
Description: PGP signature

  • Towards source in... Developers list for Guile, the GNU extensibility library

Reply via email to