Commit Graph

39518 Commits

Author SHA1 Message Date
Matthew Flatt
600a6b4c29 expander: fix compiled-expression-recompile
Linklets other than the body linklet may need conversion from
machine-independent form to machine-specific form.
2018-11-23 09:58:02 -07:00
Matthew Flatt
d6802444fa cify: repair bytes-ref and bignum handling
These problems were exposed by cifying `racket/fasl`.
2018-11-23 08:03:45 -07:00
Matthew Flatt
f47f685af9 schemify: fix srcloc marshaling
Partly fix it, anyway. More is needed in general to reduce
recording build-time paths in compiled code.
2018-11-22 19:31:46 -07:00
Matthew Flatt
19e709d27b revise compile-target parameter
Replace `compile-machine-independent` with
`current-compile-target-machine` to set up
better for future cross-compilation support.
2018-11-22 17:36:31 -07:00
Matthew Flatt
c5f000c4fc expander: recompile converts from machine-independent to -specific
Actually, the machine-independent-to-specific part is trivial. The
hard part was making `compiled-expression-recompile` enable
cross-linklet optimization as it recompiles, since that involves
pulling apart metadata and putting it back together afterward.
2018-11-22 16:39:55 -07:00
Matthew Flatt
2bbaa64cd6 add machine-independent compilation mode
The `compile-machine-indendent` parameter controls whether `compile`
creates a compiled expression that writes (usually in a ".zo" file) to
a machine-independent form that works for anhy Racket platform and
virtual machine. The parameter can be set through the
`-M`/`--compile-any` command-line flag or the `PLT_COMPILE_ANY`
environment variable.

Loading machine-independent code is too slow for many purposes, but
separating macro expansion from backend compilation seems likely to be
a piece of the puzzle from cross-compilation and faster distribution
builds.
2018-11-22 13:41:36 -07:00
Matthew Flatt
fd52cb5dda fix test
This test was meant to be part of 744d440ab9.
2018-11-22 07:23:02 -07:00
Matthew Flatt
d84d35870a expander: fix set! in namespace from module->namespace
Closes #2369
2018-11-22 07:21:30 -07:00
Matthew Flatt
ad14cca1e8 expader: fix caching for flattening 2018-11-22 06:39:38 -07:00
Matthew Flatt
fd462604bd cs: make gensym add a counter for the printed form
Although the counter doesn't make the generated symbol any more
distinct, it's often a helpful hint.

Closes #2396
2018-11-22 05:43:53 -07:00
Sam Tobin-Hochstadt
df88852e24 Additional files to ignore. 2018-11-21 12:39:56 -05:00
Sam Tobin-Hochstadt
18afdb54d6 Use linklet functions from '#%linklet instead of from lower level. 2018-11-21 12:39:56 -05:00
Sam Tobin-Hochstadt
7017781681 Make these tests easier to distinguish. 2018-11-21 12:39:55 -05:00
Matthew Flatt
744d440ab9 schemify: ensure that deserialized constants are immutable
Closes #2394
2018-11-21 10:16:19 -07:00
Matthew Flatt
669e51768d io: normalize path to current-directory[-for-user]
Closes #2393
2018-11-21 09:58:16 -07:00
Matthew Flatt
299692a38a io: fix initial print-as-expression value
Closes #2391
2018-11-21 09:48:14 -07:00
Matthew Flatt
e5bfba5f3c cs: repairs for byte-string comparison operators 2018-11-21 09:38:32 -07:00
Matthew Flatt
7231f11b60 cs: don't treat crashes as constract errors
Converting "invalid memory reference" to an `exn:fail:contract` (which
is the default conversion) hides crashes as success when a test
expects an error.

Also, fix a bug that was hiding as an expected excdeption.
2018-11-21 09:28:28 -07:00
Matthew Flatt
701854a404 expander: remove unused require of racket/fasl 2018-11-21 09:08:48 -07:00
Matthew Flatt
13fa23e79a unbreak cify build 2018-11-21 08:37:48 -07:00
Matthew Flatt
6f6d121611 move linklet bundle and directory to expander layer
The Racket and RacketCS implementations had separate copies of
linklet-directory and linklet-bundle reading and writing. Move the
implementation into the expander layer.

The primitive '#%linklet instance now omits directory and bundle
operations and `read-compiled-linklet`. It intead must provide
`write-linklet-bundle-hash`, `read-linklet-bundle-hash`, and
`linklet-virtual-machine-bytes`.
2018-11-21 07:23:50 -07:00
Robby Findler
8cee5a09da improve the redundancy checking for class contracts
In particular, when there isn't any redundancy detected, then
just make a single call into the projection and create just a single
class.

This seems to help on at least one of the configurations of
dungeon, which completes in about 6 minutes with this commit
and I gave up waiting after 15 minutes for the version of
racket that didn't have it
2018-11-20 21:30:39 -06:00
Gustavo Massaccesi
b4e3030a0d rumble: fix some type checks in bytes.ss 2018-11-20 16:50:50 -03:00
Sam Tobin-Hochstadt
940e46df6c Rebuild expander.
Should have been included in 1258d9d28.
2018-11-20 11:56:28 -05:00
Sam Tobin-Hochstadt
1258d9d28a
Point to body forms in missing-expression error. (#2356)
Improves the error message for:

```
(define-syntax (like-lambda stx)
  (syntax-case stx  ()
    [(_ e) #'(lambda () e)]))

(like-lambda (define x 1))
```

Based on a report from @pkoronkevich.
2018-11-20 11:43:28 -05:00
Sam Tobin-Hochstadt
1ea9ec399f Fix tests that depend on the current exception handler. 2018-11-20 11:42:53 -05:00
Sam Tobin-Hochstadt
b1712b76d1 Handle errors during tests. 2018-11-20 11:42:53 -05:00
Sam Tobin-Hochstadt
6bf0225fba Make testing work with just racket/base loaded. 2018-11-20 11:42:53 -05:00
Matthew Flatt
42bde1c9cf add a constructor arity test
Closes #2390
2018-11-19 20:06:50 -07:00
Matthew Flatt
daed85e1dc setup/dirs: fix cases where paths are unavailable
When an executable distibution is created, some path become
unavailable at run time, such as the result of `find-links-file`.

Change the contract on those functions and adjust the implementation
to return `#f` in those cases. This is a backward-compatible change in
the sense that uses that now return `#f` would have crashed before
(although it does shift the blame in that case).

Based on an initial patch by Shu-Hung.

Closes #2352
2018-11-19 19:15:49 -07:00
Gustavo Massaccesi
cc14310cdb clarify examples in docs of take and drop 2018-11-18 13:26:04 -03:00
Sam Tobin-Hochstadt
c1d2e4031e
Guard free-identifier=? comparisons in shared. (#2382)
Fixes #2381.
2018-11-17 22:26:11 -05:00
Alex Feldman-Crough
c4189ff934 untar: treat the tag #\nul as a synonym for #\0
The GNU Tar manual (at
https://www.gnu.org/software/tar/manual/html_node/Standard.html) says
that older archives may have the typetag AREGTYPE (\0) instead of
REGTYPE ('0'), and that AREGTYPE should silently be treated as
REGTYPE.
2018-11-17 18:00:15 -07:00
Matthew Flatt
ef9e9e3f7e cs: check initialization of variables on instance linking 2018-11-17 16:44:08 -07:00
Matthew Flatt
a255def019 cs: fix state of module instance interrupted by error
Closes #2380
2018-11-17 16:30:56 -07:00
Matthew Flatt
d47d036239 cs: fix dynamic-wind on chaperoned procedure 2018-11-17 15:58:46 -07:00
Matthew Flatt
64069a5792 cs: initialize error-value->string-handler per place
Closes #2377
2018-11-17 15:15:23 -07:00
Matthew Flatt
f6eb956199 cs: fix error with a single symbol argument
Closes #2379
2018-11-17 15:06:55 -07:00
Matthew Flatt
c1c110f662 makefile: accomodate current Mingw-64
As of version 5.0.5, Mingw-64 adds an ".exe" extension even if it's
not in the `-o` argument. Adjust the makefiles to consistently use
".exe".
2018-11-17 15:03:15 -07:00
Matthew Flatt
cb9289bd0b makefile: change the executable used for the distro pkg step
The distro-build process creates an executable in a build area, then
uses it to set up a distribution in a "bundle" directory. That way,
any package-supplied native libraries will be found in the process of
installaning a package, in case installation needs native libraries.

Don't switch in the case of cross-compiling, though. For
cross-compilation, `PLAIN_RACKET` still has to be used, since it is
set up to be one that runs on the build platform, and the
`PLAIN_RACKET` installation simply has to have any needed native
libraries installed. That's why the makefile wasn't using the
exectuable in "bundle" before for package installation (but it can
create trouble for non-cross builds, especially on Windows).
2018-11-17 14:15:05 -07:00
Matthew Flatt
c44c8b9cc0 cs: implement best-effort-ordered hash table traversal 2018-11-16 16:53:54 -07:00
Matthew Flatt
a6e37fc947 racket/fasl: improve determinism of output
When traversing hash tables, try to sort the keys.
2018-11-16 16:36:56 -07:00
Matthew Flatt
624918d399 expander: remove obsolete and broken to-source? compile mode
Source mode was a leftover from early iterations of the expander. A
bootstrapping mode that uses replacement `compile-linklet`, etc.,
turned out better.
2018-11-16 16:21:28 -07:00
Matthew Flatt
709258d88c reorganize and update "README.txt"s about sources and builds
Integrate Racket-on-Chez information better and reorganize information
to reflect the way that the makefiles and build scripts have evolved.
2018-11-16 07:49:53 -07:00
Matthew Flatt
337aec3436 cs: fix -C flag to set (system-type 'cross) 2018-11-15 18:17:05 -07:00
Matthew Flatt
7c1326a120 io: fix subprocess waiting for Windows 2018-11-15 14:57:09 -07:00
Spencer Florence
2f74b6087d explicate docs for make-rectangular and make-polar 2018-11-15 15:54:36 -06:00
Caner Derici
331b383103 fasl: make sure every write-bytes know where to write (#2373)
adding tests that fail without this fix
2018-11-15 16:53:53 -05:00
Matthew Flatt
06101ffb89 cs & io: fix current-directory initialization 2018-11-15 10:02:57 -07:00
Matthew Flatt
6d1b287467 io: fix (find-system-path 'orig-dir) 2018-11-15 09:37:28 -07:00