freenode/#sicl - IRC Chatlog
Search
14:59:27
Bike
which could be different from the definition, e.g. a let with bindings on different lines would have a different location for each variable, but the enter-instruction only has one origin
15:05:22
beach
And I think of those locations as resulting in special HIR instructions to mark the start of the evaluation and the end of the evaluation of an expression.
15:06:34
beach
So the defining instruction for a particular lexical location is somewhere in such an interval.
15:12:19
beach
So I guess there is no such thing as a unique intrinsic location associated with a particular datum the way there is with an instruction.
15:13:52
beach
But that might not be the defining place, where I use `define' as in compiler theory.
15:14:33
beach
So I guess if you absolutely want one single location, the initial binding would be it.
15:16:06
beach
I am thinking of a GUI where the programmer hovers the pointer over an occurrence of a variable.
15:16:42
beach
And all possible defining occurrences turn red, whereas all using occurrences turn green, taking into account UD and DU chains that it.
15:16:47
Bike
here's why i'm actually asking: llvm lets me associate a variable with one source location. a file and a line. so the binding seems the most natural to me. However, I've never actually wanted to jump to the source of a lexical variable or anything before, so I'm not sure about the use case.
15:17:59
Bike
for some cases I do understand, like for a special variable I'd want slime M-. to go to the defvar or defparameter.
15:18:59
Bike
well maybe it's not actually... that's just the point where lisp is told it's a special variable, and a binding is where it's told something is a lexical variable
15:21:00
Bike
for a use def chain it might make more sense to reconstruct the information from context rather than record it at every location? i don't know
15:22:12
beach
I am thinking like I think you do, i.e. figure out the instructions that define and use the location.
15:25:01
beach
I am only at the very beginning of my ideas, but it did seem wrong to me to just propagate locations from ASTs to HIR. It was when I discovered that a particular value of the program counter can correspond to several source locations that I started rethinking stuff.
15:27:10
beach
When I contemplate stuff like that, I try to start with the kind of things that the programmer might do when he or she is running the debugger on some code, and by "debugger", I mean much more than staring at a backtrace when things go wrong.
15:30:11
beach
But if you have little experience with using good debuggers, it is hard to imagine such use cases.
15:30:31
Bike
i suppose that's the problem, that's the most i've ever used a debugger for, really. backtrace and occasionally evaluating an expression in context
15:33:04
beach
I was pretty good with GDB at the time, and even though it is an excellent debugger, it did not teach me anything about the visual feedback that can be given to the programmer when a GUI is used.
15:35:01
beach
You are in good company. What passes for a "debugger" in #lisp is exactly that, i.e. staring at backtraces when things go wrong.
15:36:57
beach
I would like to say things like "Stop in MAKE-INSTANCE when an attempt is made to create an instance of class <mumble> and the initarg <mumble> is not given.
15:39:38
beach
I often find myself wanting to do that, only to discover that my tools are letting me down.
16:02:14
scymtym
something like that can often be accomplished with non-standard extensions to TRACE, but it is rarely worth the trouble