Now, the expander does have a copy of racket/fasl. It also expects two new bindings from a lower layer: current-compile-machine-target and compile-machine-target?. To avoid duplication in Pycket, you should be able to initialize the current-compile-machine-target parameter to #f and have compile-machine-target? always return #f (so that there’s no valid alternative to #f for the parameter). Then, the built-in fasled-linklet path will always be used. Pycket will still need to bind the linklet read and write functions, but they will never be called.
@mflatt I’m a bit confused. With that setup, it sounds like the expander will do itself what pycket is currently doing. But how does the expander serialize the result of compile-linklet?
It doesn’t. It calls compile-linklet only just before instantiating.
Ok. For various reasons, we might be better off keeping the current approach. In particular, Pycket does some transformations after compile-linklet (assignment conversion, A normalization), and avoiding doing them repeatedly would be good.
If we want to do that, what values should current-compile-machine-target have?
It looks like it should be 'pycket and compile-machine-target? should be (lambda (e) (eq? 'pycket e))