Although commit 5b0f0cee23 was sufficient to make `rename-in` expand
to `rename` with srcloc for the original name, it turns out it did not
address a similar issue with `only-in` renaming.
Do so by supplying the original (not renamed) identifier syntax as the
`orig-stx` for `make-import`.
Now specifies that the ftype pointer parameter types - `(* ftype)` and
`(& ftype)` - actually require an `ftype-name` (i.e., the syntax
requires an identifier in that position). This clarifies the problem
encountered in issue cisco/ChezScheme#557 (although further examples
would be helpful, of course).
When a negative bignum is shifted right by a multiple of the bigint
bit size (which is 32), when a shifted-off bit is non-0, and when the
result would be a sequence of bigints with all 1 bits before rounding
to deal with the dropped bits, a carry that should have been delivered
to a new high bigint was dropped.
Closes#3794
The current output for `--help` is quite messy and hard to
navigate.
I added some indentation and spacing to make the document
easier to read. For example,
File and expression options:
-e <exprs>, --eval <exprs>
Evaluate <exprs>, print results
-f <file>, --load <file>
Like -e '(load "<file>")' without printing
The new layout is longer, but at least it is readable. It
might be better if we could move all the options to a man
page and only select a few common ones to put in `--help`.
Currently `(make-readtable #f #\a 'dispatch-macro)` produces the error
message
```
; make-readtable: expected procedure argument after symbol argument
; given: 'dispatch-macro
```
which is very confusing, because it sounds like `'dispatch-macro` is
incorrect, but it is in fact correct already.
This PR adjusts the error message to:
```
; make-readtable: expected procedure argument after symbol argument
; symbol: 'dispatch-macro
```
which is the convention that is already used when the mode argument is not given.
One effect of using rktio instead of fwrite is that Windows output
produces LF instead of CRLF. Writing CRLF is arguably more correct,
but it likely doesn't matter, and consistency with normal Racket
output is helpful.
Adjust top-level compilation to accomodate an `#%app` macro that
expands to definitions. Allowing `#%app` to expand to a non-expression
is more consistent with expansion in a module.
There's still an issue with top-level expansion where
(define-syntax-rule (#%app id)
(begin
(define-syntax (id stx) 'ok)
id))
does not work, because the kind of partial expansion used for the top
level doesn't trigger `#%app`, and so the macro and use are expanded
together in a `begin` instead of separately. Changing that would be
subtle and maybe not worthwhile for the top level. Also, although the
behavior of the (very) old expander may not be relevant anymore, it
behaved the same way on that example.
Closes#3728
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.
Commit 24c6b2450c fixes a problem with 'text mode output, but "io.scm"
needed to be sync'ed for that repair to take effect. The repair
exposed a problem with position counting for 'text mode input, which
is repaied here.
This commit includes a relatively unrelated repair to `_list` and
`_vector`, which was exposed by a combination of the I/O demo
bootstrap and a recent repair for `malloc` to recognizes `_bytes` as a
GCable type.
Compressing boot files is a trade-off in file size versus startup
time. Compressed boot files take about 10MB instead of 40MB, but using
uncompressed boot files cuts the minimum startup time (for `racket
-n`) by around 25%.
On Unix-like platforms, we favor startup time by default. Although an
extra 30MB isn't small, it's also not that much, and the Unix culture
favors small excutables that start quickly (although Racket's startup
time is not as fast as we'd like).
On Windows, we try the opposite choice with this commit. Windows
doesn't have the same culture of little excutables, slower filesystems
(especially networked ones) seem more common, and the savings for
stand-alone executables seem more worthwhile.