lineiform icon indicating copy to clipboard operation
lineiform copied to clipboard

Ahead-of-time compilation mode

Open chc4 opened this issue 2 years ago • 0 comments

Ok, maybe this is a dumb idea, but it'd be nice to be able to do a JIT compilation of a script and then have Lineiform dump a snapshot to disk. Then running the snapshot executes the "JIT" compiled closures immediately, without having to parse + emit closures + JIT compile, giving you ahead-of-time compilation of scripts (while still having the full range of language features like eval).

Lisp and Smalltalk have "images" that do this. I'm not entirely sure how you handle rebasing the JIT compiled closures, tho, if we're inlining pointers from the closed environment and stuff. Maybe you just don't have ASLR in the snapshotted executable lol.

chc4 avatar Sep 12 '21 23:09 chc4