4 ms·
In Common Lisp, at least, it's pretty typical for the compiler or interpretter to have packages for interacting with its internals. For example, `sb-c`, `sb-vm
by jlarocco 2y ago
In Common Lisp, at least, it's pretty typical for the compiler or interpretter to have packages for interacting with its internals. For example, `sb-c`, `sb-vm`, and `sb-ext` packages in SBCL; and the `ccl` package with Clozure Common Lisp, etc.
That ability also shows up in the inspector - it's possible to inspect types, classes, functions, etc. and inspect the internal data structures the compiler uses to represent them.
With SBCL it's even possible to modify the "virtual ops" the compiler uses, and emit assembly code that SBCL doesn't support out of the box.
It's a really convenient feature, and it would be nice if to see other languages pick it up.
- johnisgood 2y agoAre there any examples?
- phoe-krk 2y agohttps://pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/ https://pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-co...
- johnisgood 2y agoThank you! Looks useful. "The Common Lisp Condition System" is a great book, by the way, thanks. :)
- phoe-krk 2y agoThanks! I hope it serves you well.
- lisper 2y agoHere is a little code snippet for CCL that changes the compiler to accept a Scheme-like ((...) ...) syntax. https://flownet.com/ron/lisp/combination-hook.lisp https://flownet.com/ron/lisp/combination-hook.lisp
- johnisgood 2y agoThank you! If you have any SBCL-related snippets as well, let me know!