libera/#sicl - IRC Chatlog
Search
4:45:31
beach
So I don't get the position of the last form being executed, but what I get is usually good enough.
4:46:12
bike
what i set up for clasp, and will shortly port to maclina, is a pretty conventional line table generated alongside the bytecode by the compiler. so if you know the bytecode IP, you can get the source location for it, and a correct set of currently bound variables.
4:47:20
bike
yeah, it's pretty cool. for the longest time clasp has only had parameters in backtraces, because extracting local variables from optimized machine code is terrible, so it's a nice change of pace
4:47:22
beach
So if we could get Maclina to take a CST and propagate the source information from there, without accessing it in any way, then that might work.
4:49:09
bike
the source location format might be a little bit of an issue. the format i have now is pretty brain-dead and also doesn't have end locations. i can try to come up with something more general, and in the meantime sicl isn't using the fasl format anyway, so there's more freedom in what i can have maclina process or not
4:49:33
bike
(fasls matter in that they mean i have to be able to come up with a portable encoding to bytes of this information)
6:05:27
beach
So I need to figure out the future of the AST-based compilation technique. I know bike has a plan to create intermediate representation from Maclina bytecodes, in which case the AST-based technique might no longer be needed.
9:12:04
beach
bike: I am about to take a break, but I am reading the Maclina code and I can't understand why things like SYMBOL-VALUE, BOUNDP, etc. are defined and used there.
11:24:54
bike
i'm not sure exactly what you're referring to. the bytecode has instructions to manipulate dynamic variables (binding, progv, symbol-value and (setf symbol-value)) so the VM needs some way to deal with those, and there are generic functions to customize that
11:27:18
bike
they don't use lexical environments since they're all about dynamic variables, but they do have to respect the dynamic environment
11:31:40
bike
they're exported so that outside code can refer to dynamic variables based on the VM client. for example in the compile-file implementation, maclina.machine:progv is used so that *compile-file-pathname* etc can be bound within the VM environment rather than in the host.
11:32:19
bike
and of course to make it easier to define the symbol-value etc functions in your environment
11:48:59
beach
The braino reminds me that I haven't defined SYMBOL-VALUE and BOUNDP properly for Maclina in the SICL bootstrapping procedure. Luckily, I don't think they are used for anything but global bindings.
11:50:38
beach
FBOUNDP, FDEFINITION, and FMAKUNBOUND are just functions, so why are they taken into account by Maclina?
11:52:06
bike
they aren't. i mean, there is an FDEFINITION instruction, but it operates on some kind of client-specific cell object rather than necessarily a symbol. the idea is that you can define a link procedure, and then the compiler will resolve whatever symbol in the source code to a cell, so it doesn't need to look up a symbol's fdefinition at runtime.
11:53:11
bike
oh and there's also an fdesignator instruction so that multiple-value-call can be done without a runtime fdefinition call
14:40:25
bike
I pushed changes to Maclina to fix most of the long instructions. Next I'm going to clean up the VM code and then I'll work on the debugging info.
14:55:10
beach
In phase 3, I ran into the first issue that would require the backtrace inspector. But I am now convinced that Maclina is what I will use now, and that I am better off improving the Maclina solution.
15:24:03
beach
OK, so I have a generic function that has &KEY parameters DOCUMENTATION CLIENT ENVIRONMENT.
15:27:20
beach
So it seems when a &KEY parameter has an initialization form, it is not "recognized".
15:28:02
beach
I can get around it by adding &ALLOW-OTHER-KEYS of course, but I don't think that should be required.
15:29:07
beach
The great thing is that it takes less than 6 seconds to get to the error, or to check that &ALLOW-OTHER-KEYS will remove the error. :)
15:36:38
bike
hm.. the tests cover that (e.g. ansi's lambda.25) so i'm not sure what would be going on there. how do you call it?
15:39:35
beach
(fun required-argument required-argument required-argument required-argument :documentation ... :client ... :environment ...)
15:46:39
beach
And I am pretty sure this one used to pass with the AST evaluator. And the AST evaluator turns it into a host function with a host lambda list, so SBCL didn't complain either.
15:52:06
bike
i made a bytecode function (lambda (a b c d &key documentation (client 7) (environment 19)) (values a b c d documentation client environment)) and called it with 1 2 3 4 :documentation 4 :client 9 :environment 2, and that seems to work ok. so i might need more context to figure out where the problem is.
15:54:00
bike
because of how argument checking works for generic functions, i would expect CLOS to produce method functions that basically have &allow-other-keys. since it's the generic function that checks keyword arguments.