libera/#clasp - IRC Chatlog
Search
13:44:09
drmeister
I've been thinking about this for a while - should we move to Discord - or is that a terrible idea?
13:46:36
Bike
discord has some nice features, but you have to sign up in a way you don't for irc, and it's run by a company rather than a nonprofit. also i don't think we actually need multiple channels
13:46:42
drmeister
I need to travel to ThirdLaw today, where my x86 MacBook Pro is (athena) and then I'll disable the something-something-security-system-protection mac thing so I can do proper profiling on it.
13:46:55
Bike
maybe if we get more users, if you're expecting a major influx of people who aren't familiar with irc
14:14:09
drmeister
Is the lexical valu/closure optimization pass being written as part of the compiler? It looks like it from the source code.
14:37:52
drmeister
I mean - I was just looking for confirmation that it was being implemented as a pass of the compiler. I see the `fixup` class and and `link-function`. Are those part of the lexical variable/closure variable optimization?
14:43:31
Bike
We compile the code by generating bytecode for each function in a module, with placeholder labels instead of actual labels. Linking puts all the function bytecodes in the same module, and resolves all links into actual offsets
14:43:57
Bike
The "fixups" are needed because labels can be variable length (like you can have 1-byte labels, 2-byte labels, or 3-byte labels) which means some adjustments need to be made for that
14:44:16
drmeister
Ah - I was looking for something that replaced MAKE-CELL with NOPs and then closed holes - or something like that.
15:44:20
Bike
i just noticed something i don't understand with the bytecode. if i check the bytecode-module/bytecode of some code, it looks too junky to run, even though it does run
15:44:41
Bike
starts with the sequence 29 1 15, which should be PUSH-VALUES CONST 15 and thus crash if there are not that many constants
16:02:53
karlosz
i think what i'll do next is try to iron out the fixup and label stuff even more by adding the cell optimization
16:03:51
Bike
exit is supposed to return values similar to how return does right? like if there's nothing on the stack leave the mv register alone, otherwise fill it up from the stack frame?
16:06:08
Bike
i thought the pop instruction was for facilitating this. well, ok, so how does it work then? in vm.lisp it looks like it's just passing up a single value?
16:07:03
karlosz
and in vm.lisp the function call to VM returning has nothing to do with the value passing semantics
16:08:32
karlosz
so if you did (return-from (f)) it just works, because (f) puts its values in MV and then exit just does the control transfer and the stack actions
16:08:57
karlosz
we needed pop because if you did (return-from x) then we'd have no idea how many stack frame slots to pop
16:09:38
karlosz
so for RETURN its the same thing: we can get rid of the gather logic there so its faster
16:11:21
karlosz
also, i think the branch instructions need to be updated for label offset being pointed at the start of the instruction?
16:12:49
karlosz
also sorry that i haven't been updating the c++ vm along with changes to the cvm, i just figured we might reduce any potential merge conflict this way
18:35:39
drmeister
I have an x86 Macbook Pro on the thirdlaw VPN that can do profiling. I could profile the bytecode interpreter once it works with cvm.
18:48:08
yitzi
I think that removing application.config and project_headers.h has made it easier to add an extension that doesn't use clbind. I tried to make a non-clbind version of lila before and I was getting all kinds of weird syntax errors when it tried to compile anything that used project_headers.h. With this method it likes it was pretty easy and no errors yet.
18:49:20
drmeister
Bike, karlosz: If you do get cvm compatible with the bytecode interpreter at the end of the day - tell me and I'll do some profiling.
18:50:17
drmeister
I could sort them based on inheritance. We don't use multiple inheritance so it should be a simple matter of sorting the headers based on the precedence of classes
18:50:54
yitzi
It could be. I don't really know for sure since I was not able to fix the problem. I was getting all kinds of weird errors from templates. This new method seems to work out of the box.
18:53:10
yitzi
I am letting it run the workflow tests. Everything seems to work but just making sure. I have already tested with boehm and boehmprecise. I am gonna run the static analyzer at some point just to be extra sure that I haven't broken anything.
19:37:26
drmeister
(setf (fdefinition 'fib) (compile-to-vm::bcompile '(lambda (n) (if (eql n 1) 0 (if (eql n 2) 1 (+ (fib (- n 1)) (fib (- n 2))))))))
19:44:00
Bike
also, sidenote, since you made entry points funcallable, you can actually just use compile-to-vm::compile