freenode/#clasp - IRC Chatlog
Search
16:18:16
Bike
signal handlers can be per thread, so that's nice, except since mps uses sigsegv we can't just control the handler ourselves, probably
16:26:08
Bike
sbcl also makes it seem like posix systems are kind of all over the place with important details, so that's pretty unfortunate
20:40:59
karlosz
wouild i have to resort to adding new instruction types on the MIR level to take advantage of specializing?
20:43:38
karlosz
as in system provided functions don't need to go through fdefinition and computed funcall
20:44:15
karlosz
ie. clisp compiles (lambda (x) (funcall (fdefinition '1+) x)) the same as cleavir compiles (llambda (x) (1+ x)) right now
20:44:44
karlosz
whereas (lambda (x) (1+ x)) in clisp compiles to a shorter instruction sequence since 1+ is in a specialized 'funtab'
20:50:18
karlosz
does clasp just lookup C++ functions in a table to determine whether to produce the C++ all ast node?
20:52:15
Bike
Like, the function-info for 1+ or whatever has an AST, and that AST is the foreign call thing.
20:54:31
Bike
So I guess you'd write a definition like (declaim (inline 1+)) (defun 1+ (n) (system-call 177 n))
20:56:22
karlosz
clisp already has a function that queries whether a function is 'system'. so i could just ask the function and convert the appropriate ast node during cst to ast conversion, right?
20:57:54
karlosz
i.e. convert function calls differently to ast depending on whether they are system or not during cst->ast
21:02:11
Bike
if you want it to generate typeq you'll need to provide a definition for typep that uses typeq.
21:04:03
Bike
so the ast doesn't have a function call, just the eq ast, which is converted into the eq instruction.
23:21:50
Kevslinger
Google cloud now has a machine you can rent out with 160 virtual CPUs and 3.75 TB of RAM.
0:30:33
karlosz
still not quite sure what i should be subclassing. in function-info, if i make an instance of global-function-info with :inline set, should i return an subclass of fdefinition-ast, maybe system-fdefinition?
0:32:29
karlosz
well, i don't want to start redefining things like eq and 1+ and declaring them inline in order to get specialized system call HIR nodes
0:33:01
Bike
you don't have to redefine them, just have function-info return an fdefinition-ast without actually redefining the class
0:35:37
karlosz
then how are system functions distinguished from normal functions? or are you saying that theres no need to distinguish them at the AST level?
0:37:12
Bike
what i'm saying is for 1+, you return a function-ast with a body consisting of your custom syscall-ast or whatever you want to call it
1:47:04
karlosz
i was able to make the ast by faking up another function and replacing its node with the node i want, but when i graph it it seems like its not inlining properly
2:01:28
karlosz
well cst-to-ast didn't complain when i didn't have a method on cleavir-env:declarations
2:03:31
karlosz
and generate-ast is also complaining about a method for cleavir-ast:chilren not being defined on my new node
2:26:07
karlosz
when i compile to stack machine bytes i just treat assignment instructions as alising stack locations
2:27:04
Bike
setq also turns into an assignment instruction, so you probably have to actually do something at runtime
2:29:13
Bike
in this case, the ast inlining generates assignments to match the parsing of the lambda list of the function being inlined.
2:29:46
Bike
i've spent a fair bit of time trying to figure out a way to generate less, but i haven't come up with much.
2:31:56
karlosz
yeah, but even when there was no inling, just things like using a lexical location to a function would have to go through an assign instruction