Commit Graph

7 Commits

Author SHA1 Message Date
Matthew Flatt
b9fdb503c1 raco demodularize: adapt to CS
Really, `raco demod` is adapted here to work with any linklet-based VM
by compiling modules to machine-independent form, which is essentially
a wrapper around linklet S-expressions. The BC-specific implementation
remains in place, and it has the advantage of being able to work with
existing module compilations, while the implementation based on
machine-independent form must recompile all modules before attempting
to combine them (but that recompilation is easily cached).

Use `--work <dir>` to use `<dir>` as a cache for multiple
demodularizations.

Getting `raco demod` to work involved several incidental improvements:

 * make `racket/linklet` work with machine-independent forms;

 * add `linklet-body-reserved-symbol?`;

 * fix schemify for linklets that have unexported definitions (which
   the expander never generates, but the demodularizer does);

 * add `current-multi-compile-any` to expose CM's multi-target
   compilation mode programmatically; and

 * repair a bug in CS JIT mode.

The demodularizer could be a lot smarter to prune demodularized code
before sending it off to the compiler. Of course, the compiler should
be able to figure out improvements itself, but sending a smaller chunk
of code to the compiler can avoid the hybrid interpreter--compiler
mode that is used for large linklets and that prevents optimizers like
cp0 from doing much to prune definitions.

The demodularizer has a lot in common with the expander's flattener
that is used for bootstrapping, and a smarter demodularizer would have
even more in common. It would be nice to have one implementation
instead of two.
2021-04-10 08:13:29 -06:00
Matthew Flatt
727cd1ca9f raco demod: report that it works only on BC
Closes #3706
2021-03-07 07:58:32 -07:00
Matthew Flatt
59ef254318 switch to a new, Racket-implemented expander & module system
This commit merges changes that were developed in the "racket7" repo.
See that repo (which is no longer modified) for a more fine-grained
change history.

The commit includes experimental support for running Racket on Chez
Scheme, but that "CS" variant is not built by default.
2018-02-26 13:19:53 -07:00
Sam Tobin-Hochstadt
eec3684dbd Add recompile option to raco demod. (#1373)
Originally by @bdj in racket/compiler#7.
2016-08-19 07:09:49 -06:00
Sam Tobin-Hochstadt
74723e3e95 Move to correct directories. 2016-05-27 17:20:35 -04:00
Matthew Flatt
1920ac59ab move some test & doc collections out of "racket-" pkgs to new pkgs 2013-10-15 17:50:32 -06:00
Sam Tobin-Hochstadt
3ad009070e Move most of the compiler collection to compiler-lib. 2013-07-01 12:08:42 -04:00