Commit Graph

39979 Commits

Author SHA1 Message Date
Matthew Flatt
a66038a427 io: shortcut for common format patterns 2018-12-07 11:03:53 -07:00
Matthew Flatt
0f413d38c5 cs: faster path for simple foreign calls 2018-12-07 09:53:49 -07:00
Matthew Flatt
45046f4c5d fix placement of "instantiate" starting counter 2018-12-07 07:53:56 -07:00
Matthew Flatt
99feebf070 ephemeron-value: add optional "retain" argument
When an ephemeron is accessed through a weak mapping from the same key
that is used in the ephemeron, and when the key is not otherwise
reachable, there can be a race between extracting the value from the
ephemeron and performing a GC that reclaims the key. Avoid that race
by supplying the key back to `ephemeron-value`, which ensures that the
key remains reachable until the value is extracted.

In many cases, supplying the key as the second argument would also
work --- since that argument is used as a replacement value when the
key is inaccessible, but the key can't become inaccessible if it's
pending as a replacement value. A separarate optional argument to
`ephemeron-value` seems clearer and more general, though.
2018-12-07 06:31:18 -07:00
Matthew Flatt
9ce4dd8770 raco exe: fix excessive memory use
Avoid retaining namespaces that are created to gather runtime paths.
If expansion generates a lot of instances with a lot of type
information, for example, this repair can save a lot of space.
2018-12-07 05:31:43 -07:00
Matthew Flatt
f9551bcaa5 remove accidentally committed debugging file 2018-12-06 16:48:49 -07:00
Matthew Flatt
beb8445d14 cs on Windows: almost support embedded DLLs
Wire in the pieces to make embedded DLLs work, but a DLL based
on Chez Scheme doesn't actually work as embedded, yet.
2018-12-06 16:46:48 -07:00
Matthew Flatt
4b42225f0c raco setup: remove -M/--compile-any
This commit mostly reverts 9441f7075f, because it looks like relying
on `racket`-level configuration is the right idea after all.
2018-12-05 17:31:37 -07:00
Matthew Flatt
fed7e5e95c reader: immutable vectors and boxes from read-syntax
Closes #1745
2018-12-05 16:26:57 -07:00
Gustavo Massaccesi
561fe7e2e7 cs: more pure primitives 2018-12-04 22:03:27 -03:00
Gustavo Massaccesi
ff5f2ae69a optimizer: (cdr <list?>) is a <list?>
In case it is not an error, the result is a list.
2018-12-04 18:34:21 -03:00
Ben Greenman
88b165314a
fix pair accessor error messages (#2413)
Change the error message for some functions like `caddr` so they
describe pair structures that they expect
2018-12-04 16:04:01 -05:00
Ben Greenman
cbaa1b99d9
doc: logging, clarify 'none level and the level ordering (#2407)
add the `'none` log level to the intro paragraph,
 declare `'none` the level of "least detail",
 and change prose to say "subscribes to current level and lower"

+2 small rewordings
2018-12-04 16:03:38 -05:00
shhyou
8043768b4c Support unsyntax-splicing in vector quasisyntax
If the sub-template inside #(...) is unsyntax-splicing instead
of list, produce the template #((~@! . ????)) instead of calling
(datum->syntax o list->vector o syntax->list). Fixes #2402.
2018-12-04 12:00:01 -06:00
Matthew Flatt
5454b7d809 doc example repair
Fixes a typo in b3104a6acd.
2018-12-04 10:41:53 -07:00
Philip McGrath
b3104a6acd add #:result clause to for/lists and for*/lists 2018-12-04 10:12:43 -07:00
Matthew Flatt
6d8596bae3 raco setup: repair more problems with multi-cross mode
Fix some race conditions involving concurrent setup tasks that are
each trying to generate both machine-independent bytecode and
machine-specific bytecode.
2018-12-04 06:05:53 -07:00
Ben Greenman
b38ce36c92
glob: add 'glob-quote' (#2397)
add a function to escape any glob wildcards in a path or string

also add a private `glob-element->filename` function so that, e.g., the pattern
`a\*` matches the file named `a*` (previously, the match would fail and
I think it was impossible to match for only `a*`)
2018-12-04 00:21:14 -05:00
Matthew Flatt
e729d35915 bump version number
Should have bumped with 37929f2191.
2018-12-03 20:24:13 -07:00
Gustavo Massaccesi
d8d94b1549 Build cs variant on Travis, but allow failure.
With this script the "default" value of RACKETCS_SUFFIX is effectively ""
instead of "cs" as in the make file.
This is a minor incompatibility/unexpected behavior that will get eventually
solved when the real default changes to "".
2018-12-02 20:16:05 -05:00
Sam Tobin-Hochstadt
6e8f47788f Build cs variant on Travis, but allow failure. 2018-12-02 20:16:05 -05:00
Matthew Flatt
37929f2191 cs: make interp layer safe-for-space
Fix the fallback interpreter (which is used for the "outside" of a
module that is too big to compile) so that it's safe-for-space.

This change is unlikely to repair any immediate problems, but space
safety problems are difficult to detect and avoid when the underling
implementation is not safe-for-space so fixing the interpreter is
likely worthwhie in the long run.
2018-12-02 15:58:59 -07:00
Matthew Flatt
74abc61f03 cs: fix module-prompt handling in interpret mode 2018-12-01 09:33:23 -07:00
Matthew Flatt
0c6d22a04a hash-ref: guard against fixnum argument when JIT-inlined
Closes #2409
2018-12-01 06:22:08 -07:00
Matthew Flatt
3a19809268 compiler/cm: protect a ".dep" use against old versions 2018-12-01 06:00:49 -07:00
Matthew Flatt
b94f84a909 expander: load modules on demand for recompile 2018-11-30 22:54:10 -07:00
Matthew Flatt
68e105c0ed cs: prompts for module-body expressions
Module definitions and expression need to have a prompt around them to
delimit continuation capture, variable assignment needs to happen at
the right point to ensure that reassignment is guarded and
non-assignment is detected. But avoid the prompt when it's not needed,
such as around function definitions.

Closes #2398
2018-11-30 22:54:10 -07:00
Matthew Flatt
6f0748108c cs: fix module-variable initialization order
Similar to a255def019, but for side effects potentially
exposed by definition RHS expressions, instead of
expressions not in a definition. Improve that commit and
this one by only forcing variable assignments at non-simple
expressions.
2018-11-30 22:54:10 -07:00
Matthew Flatt
8b15ad971c cs: fix embedded modules in places 2018-11-30 22:54:10 -07:00
Matthew Flatt
f2fb2ebc55 racketcs: fix command-line handling after non-flag argument 2018-11-30 22:54:10 -07:00
Sam Tobin-Hochstadt
1bf17f7743 Don't set this up quite yet. 2018-11-29 21:49:16 -05:00
Sam Tobin-Hochstadt
28ba449102 Add issue templates 2018-11-29 21:46:20 -05:00
Philip McGrath
bd7de80d98 raco pkg new: Remove deprecated sudo: false from .travis.yml
Travis is eliminating its container-based infrastructure
and deprecating the `sudo` keyword.

This commit also updates the example build matrix to use
more recent Racket versions.

Corresponds to https://github.com/greghendershott/travis-racket/pull/29
2018-11-29 19:21:13 -05:00
Philip McGrath
4362e98b58 Clarify docs for filter-map (#2405)
See discussion on the mailing list: https://groups.google.com/d/topic/racket-users/8vyJX9MqMFY/discussion
2018-11-29 16:00:04 -08:00
Matthew Flatt
4d032bdd64 adjust raco exe tests to use racocs, etc. 2018-11-29 10:38:40 -07:00
Matthew Flatt
2e3b16f77c makefile: fix redundant path separators 2018-11-29 10:08:19 -07:00
Matthew Flatt
e607ae09de makefile: speed up make in "cs" build directory
Take advantage of ".d" files that are already generated to speed up a
`make` in the "cs" build dierctory when nothing needs to be done.
2018-11-29 09:41:49 -07:00
Matthew Flatt
50cb877184 makefile: fix SERVER_COMPILE_MACHINE handling
More targets need to support the `SERVER_COMPILE_MACHINE` option.
2018-11-29 06:23:01 -07:00
Philip McGrath
2798608ccd cs: fix error message from raise-argument-error
Closes https://github.com/racket/racket/issues/2400
2018-11-28 06:19:12 -07:00
Matthew Flatt
7823b6eecf raco decompile: support machine-independent bytecode 2018-11-27 20:59:52 -07:00
Matthew Flatt
a7499ab854 expander: more determinsitic machine-independent "bytecode"
Discard local-variable names to avoid `gensym` artifacts in the same
way that a more complete compilation would discard the names. This
change does not affect function names, which are preserved through
separate properties.
2018-11-27 20:01:43 -07:00
Matthew Flatt
8c6af1a234 expander: avoid format in common paths
Use `string-append`, `symbol->string`, etc., instead of `format` for
constructing some symbols.
2018-11-27 19:26:59 -07:00
Matthew Flatt
432dfcdb4a hash-{map,for-each}: strengthen try-order? guarantee
Promise a specific order for a hash table that uses only certain
primitive, non-compound datatypes for keys.
2018-11-27 17:50:48 -07:00
Matthew Flatt
da62067d8f maefile: adjust SERVER_COMPILE_MACHINE convention
The old way wasn't delivering needed information to
`distro-build/drive-clients`.
2018-11-27 10:34:52 -07:00
Matthew Flatt
5f940e462e call-with-atomic-output-file: option to make Windows moves more atomic
It most cases, it's more important for `compiler/cm` to reliably
replace a file that might be busy than to make the file update atomic.
To suport that kind of use, `call-with-atomic-output-file` implemented
a fairly reliable, multi-step, non-atomic process for replacing a file
on Windows.

For recompilation of bytecode in machine-independent form, however,
`compiler/cm` now really wants to atomically write a replacement
bytecode file. That's not generally possible on Windows (except on
NTFS with transactions, which are discouraged...), but MoveFileEx work
atomically in some cases and it's likely to work for the cases needed
by `compiler/cm`. Probably.

So, add a mode to `call-with-atomic-output-file` to get "more atomic"
updates on Windows. This mode is enabled by a callback that makes the
caller responsible for deciding what to do with the move fails, such
as waiting a while and trying again. And `compiler/cm` now waits a
while and tries again, up to a limit, which should be good enough for
recompilation.
2018-11-27 09:47:11 -07:00
Robby Findler
b68866db0f added object=-hash-code 2018-11-27 16:00:24 +01:00
Matthew Flatt
a001b5b231 raco setup: multi-machine cross-compile support
Enable `raco {setup|make}` to build two sets of compiled files: one
set that is suitable for the current machine, and another set that is
suitable for a different machine or for all machines (i.e.,
machine-independent bytecode).

In the long run, this new `raco setup` mode support cross compilation
where the build machine and target machine have different bytecode
formats --- unlike the current cross-compliation mode, which relies on
there being a single bytecode format in traditional Racket for all
platforms.

In the short run, the new mode enables the faster creation of
Racket-on-Chez distribution builds. The build server can send out
machine-independent bytecode to client machines while using
machine-specific bytecode for itself to drive the build process.

The new compilation mode relies on a somewhat delicate balance of the
`current-compile-target-machine` and `current-compiled-file-roots`
parameters (as reflected by the `-M` and `-R` command-line flags for
Racket) as well as cross-compilation mode (as enabled by the `-C`
command-line flag).
2018-11-26 19:49:33 -07:00
Matthew Flatt
4a080ada04 system-type: add 'target-machine
The 'target-machine result from `system-type` reports the
default value of `current-compile-target-machine`.

Also, fill in pieces to make `setup/cross-system` work
for RacketCS, although cross-compilation is still several
steps away.
2018-11-25 12:10:09 -07:00
Matthew Flatt
7cdf9f1c0b raco setup: remove -M/--compile-any
This commit mostly reverts 9441f7075f, because it looks like relying
on `racket`-level configuration is the right idea after all.
2018-11-25 12:10:09 -07:00
Matthew Flatt
695e270197 compiler/cm: avoid race in recompile
The new path for recompiling from machine-independent files
trues to read a ".zo" file without holding the recmopilation
lock and without an `exn:fail:filesystem` handler.
2018-11-25 08:11:21 -07:00