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