mflatt
2018-11-23 12:52:07

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.


samth
2018-11-23 19:34:30

@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?


mflatt
2018-11-23 19:35:39

It doesn’t. It calls compile-linklet only just before instantiating.


samth
2018-11-23 19:48:00

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.


samth
2018-11-23 19:48:17

If we want to do that, what values should current-compile-machine-target have?


samth
2018-11-23 19:52:39

It looks like it should be 'pycket and compile-machine-target? should be (lambda (e) (eq? 'pycket e))