Zag-Research / Zag-Smalltalk

Smalltalk VM Written in Zig with methods stored as type-annotated ASTs
MIT License
132 stars 6 forks source link

JIT Documentation #13

Closed JanBaig closed 10 months ago

JanBaig commented 1 year ago

I've compiled the JIT documentation points from memory and the few notes I have taken during meetings. I have a question section that I may delete after I receive the answers. Thank you!

dvmason commented 11 months ago

Most of these comments talk about the Pharo AST. The only ASTs in a running Zag image are Zag ASTs. To export code from a Pharo image, we do have code (ASPharoCompiler) that produces Zag ASTs, and we have code (ASZigCompileObjectOutput) that can linearize any object (including a Zag AST) to a Zig form that we can compile into a static object that can be accessed at runtime and compiled either into a threaded form or LLVM JIT'ed (in both cases in a freshly, dynamically allocated object). Either compilation will use an internal "outputter" that will allocate to an internally allocated object (this is parallel to ASZigCPSOutput and ASZigThreadedOutput).

dvmason commented 10 months ago

Thanks, I merged them, rather than holding them out there.