Commit Graph

39735 Commits

Author SHA1 Message Date
Matthew Flatt
344b72b4f8 cs: reconstruct let* in fallback interpreter
Representing nested `let`s as `let*` avoids a limitation
in Chez Scheme's `fasl-read`, for now.
2018-12-09 08:54:23 -07:00
Matthew Flatt
476bc8b879 schemify: lift "empty" closures to top of a module body
When a `[case-]lambda` form's only free variables are at the module
level, the Schemified form is a `[case-]lambda` form whose only free
variables are in an enclosing `lambda` for a linklet. Since those are
not completely closed, to make the allocation pattern consistent with
traditional Racket, Chez Scheme needs a hint to allocate the closures
once per linklet instantiation.
2018-12-09 08:54:23 -07:00
Matthew Flatt
0261332ac3 io: avoid closure allocations for pipes and byte-string ports 2018-12-09 08:54:23 -07:00
Matthew Flatt
bcf6492d56 io: reduce overhead of a byte string output port
Make it a thinner wrapper around the output half of a pipe.
2018-12-09 08:54:23 -07:00
Matthew Flatt
9f27b90e31 io: change port from table of functions to table of methods
Adjust the internal port representation to that it doesn't inherently
require allocating lots of closures.
2018-12-09 08:54:23 -07:00
Ben Greenman
0c2ada98ff json: improve 'bad input' error message (#2420)
When 'read-json' finds "bad input", print the input to try to show what
went wrong.
2018-12-08 16:31:58 -05:00
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