freenode/#sicl - IRC Chatlog
Search
13:39:35
beach
Once we start generating native code, we are going to need a disassembler. That would be a thing that I could subcontract.
13:40:09
beach
Also, it would be good if it didn't just generate x86 assembly instructions, but also some intelligent comments.
13:41:15
beach
Such comments would require additional information, but we already have some of those. For example, the call site information relates an unconditional jump to a named callee.
13:42:06
beach
It would seem that some debugging information could also be used to generate such comments.
19:50:00
karlosz
Bike: you also have examples of one module (code compiled together) having multiple components, like in (flet ((f (x) x)) (g (y) y))) (setf (fdefinition foo) #'g) (setf (fdefinition bar) #'f))) where you can split up the code into 3 components (top level, component containing #'f, and component containing #'g)
19:52:05
karlosz
so the sbcl source has this as the toplevel comment for components: https://paste.gnome.org/pqhz31znh
19:53:44
karlosz
the memory usage and being able to reclaim individual components made a lot of sense in '85, but you can still get some memory issues even now
19:54:54
karlosz
yeah, having the flow graph be small for flow analysis purposes is pretty important
19:56:30
karlosz
currently though it doesn't really seem like the Cleavir front end is built for block compiling multiple top level forms
19:57:02
karlosz
it seems like the front end pipeline really just operates on one top level form at a time
19:58:02
karlosz
but being able to separate the actions of top-level form processing/minimal compilation from actual compilation will enable block compilation stuff
19:58:07
Bike
I think you'd pretty much have to have an alternate CST-to-AST going. you'd have to do stuff like recognize defuns rather than just blindly macroexpand them, right?
19:59:01
karlosz
well, it just means that you need defun to side effect the compilation environment during compiler processing
20:00:06
Bike
well i mean, for example, with block compilation we'd want (defun foo ...) (defun bar ... (foo ...) ...) to be a local call, right? it's a different thing from just inlining it. the compilation environment doesn't have that kind of info now.
20:00:10
karlosz
how it works in Python is that all the top level forms are read in and ir1 converted into initial ir1 data structures with the names resolved properly
20:01:00
karlosz
and then that set of initial ir1 functions gets compiled together, split up into components, and local call analyzed
20:02:54
karlosz
the idea is that all the toplevel forms being block compiled get processed in the same namespace associating names to ir1 leaves (which we half have a concept of in bir)
20:03:23
karlosz
'leaf' structures are the things that can get referenced in ir1, like how we have constants and variables and load-time-values represented right now
20:06:33
Bike
certainly a better way of dealing with function calls would be nice. i think beach already hit some messiness there relating to the sicl loading procedure.
20:07:01
Bike
also the way we do them now means (let () #'asdkfj) doesn't signal an error, which is pretty bad...
20:07:07
karlosz
since we don't have forms get translated directly into bir, (which is what is the closest thing to ir1, with its suprafunction level container) like sbcl does, but rather have 2 intermediate "irs" (cst and ast) it will be more involved to do the same thing
20:07:48
karlosz
yeah, a lot of the messiness in the irs right now (including load time hoisting and stuff like that) comes fomr not having a supra-function level container structure
20:08:07
karlosz
things like modules and components obviate the need for complicatged hoisting procedures for load time value code
20:10:14
karlosz
otherwise you'd do something wasteful like putting stuff that logically belongs into the module/component into the static environment because you don't have anywhere else to put it
20:12:59
Bike
i suppose a good step would be to separate the regular-code part of cst-to-ast from the toplevel form processing stuff
20:13:16
Bike
i've kind of wanted to do that for a while but haven't thought hard enough about how to do it
21:09:15
karlosz
i found it became so much easier to do optimizations once the data structures became a bit more organized and less ad hoc