After a reduction like (pair? (list <x> <y>)) => (begin (list <x> <y>) #t) make a semi-shallow
reduction of the argument, so it is further reduced to (begin <x> <y> #t) and even remove <x> or <y>
if they have no side effects.
original commit: fe085761cbd200f4c67025d968d6d1418ab7d3e7
A Chez Scheme garbage collection involves a rendezvous among threads
that are used to implement places and futures (and potentially other
things that create Chez-level threads). The thread that is used to
drive the garbage collection was not formerly specified, and callbacks
like the GC icon in DrRacket can only be run in the initial thread.
When a major collection was run in a non-initial thread, the callback
was simply skipped.
The Racket branch of Chez Scheme now drives a collection in the
initial thread whenever that thread is active. In Racket CS, the
initial thread can be inactive if it's waiting for external events,
and a place can meanwhile trigger a GC. Now, when the Racket CS GC
callback is called for a major collection in any thread other than the
initial one, it defers the major collection to an asynchornous
callback in the main thread (and meanwhile performs a minor
collection).
So, a major collection might now be delayed by just a little while if
the main thread is inactive, such as when it's waiting for external
events, but callbacks like the GC icon in DrRacket will be reliably
invoked for major collections.
For a collect rendezvous, call the collect-notify handler in
the main thread if it is active. A collect-notify handler can
then make sure the main thread is active and try again, if
that's useful to an application.
original commit: 0bc286e81827f029dd02a3627a192edd053b3b91
It's still unclear what the specification of syntax->string regarding whitespace
before closing parens should be. The implementation also has not dealt with
the issue. This PR therefore removes whitespace before closing parens from
the tests.
Once the discussion at
https://github.com/racket/racket/issues/3071#issuecomment-601984438
has reached a conclusion and implemented, we can add these tests back.
Implementing a thorough `clean` target for a repo-based is tedious and
error-prone. Instead, make the `clean` target suggest `git clean -d -x
-f .`, which is more effective in most situations (but seems too
dangerous to run automatically).
Check that the rtd argument is single valued. For example
(record? 5 (values 1 2))
was incorrectly reduced to
(begin 5 (values 1 2) #f)
original commit: 543ba171cee6c03b4207de5ea970573dd85dd3a0
The `call-in-continuation` function generalizes applying a
continuation to values by accepting a thunk that is called in the
restored continuation. In other words, insteda of having to use the
pattern
((call/cc (lambda (k)
.... (set! saved-k k) ...
(lambda ()
original-result))))
...
(saved-k (lambda () new-result))
The extra call and thunk on the capture side can be omitted:
(call/cc (lambda (k)
.... (set! saved-k k) ...
original-result))
...
(call-in-continuation saved-k (lambda () new-result))
At the Chez Scheme level, a `call-in-continuation` in tail position
within a function can avoid forming a closure for its second argument.
The `call-in-continuation` function at the Racket CS level doesn't yet
provide that benefit.
The `call-in-continuation` operation is called `continuation-slice` in
Feeley's "A Better API for First-Class Continuations".
Expansion of a procedure with keywords is quadratic due to generating
a nested sequence of `let`s, but speed it up by roughly a constant
factor by using a dintinct symbol for each nested layer.
Related to #3070
Using `call-in-continuation` to apply a thunk within a continuation
slightly simplifies and speeds up parts of the implementation of
delimited continuations.
This operation effectively allows sending an expression back to a
continuation, instead of just a value. It's the same as Marc Feeley's
`continuation-slice` operation, but adjusted slightly to support
continuation attachments.
original commit: d0e36e72d20a6eaa5d9d8b795da5e77abde75289
The expansion of `struct` created far too much code to parameterize
`struct-field-index`, making expansion of a `struct` form with just
100 or 200 fields take a noticeably long time to expand.
Also, remove signatures from primref. Now the record is reverted to the one in
the main ChezScheme version.
And lift most of the code outside the cptypes function.
original commit: 8f4384e0a5e1e9b383f65e097d6088b30d8069e5
The implicit counter to number the prelex has caused problems in the multithread
version many times, so make it an explicit arguments of the functions that is
passed around until the prelex-counter function uses it.
Perhaps it can be remover later, after rewriting the implementation of
define-specialize.
original commit: 6ca1db6a0159b6a7756fad7c5e25b0225c858609
While "\44\26\2\f6" currently works as a terminator for non-compressed
fasl streams, the working byte sequence varies as the fasl format
changes. Add "\177" as a simpler and unchanging terminator.
original commit: 332019360491be6cedd2063c9a8056183d764bbb
- the collector now releases bignum temporaries in the collector
rather than relocating them so we don't keep around huge bignum
temporaries forever.
gc.c
- removed the presumably useless vector-handling code from load()
which used to be required to handle fasl groups.
scheme.c
- object files are no longer compressed as a whole, and the parameter
compile-compressed is no longer defined. instead, the individual
fasl objects within an object file are compressed whenever the
new parameter fasl-compressed is set to its default value, #t.
this allows the fasl reader to seek past portions of an object
file that are not of interest, i.e., visit-only code and data
when "revisiting" an object file and revisit-only code and data
when "visiting" an object file. the compressed portions are
compressed using the format and level specified by the compress-format
and compress-level parameters. the C-coded fasl reader and
boot-file loader no longer handle compressed files; these are
handled, less efficiently, by the Scheme entry point (fasl-read).
a warning exception is raised the first time a program attempts
to create or read a compressed fasl file.
7.ss, s/Mf-base, back.ss, bytevector.ss, cmacros.ss, compile.ss,
fasl-helpers.ss, fasl.ss, primdata.ss, strip.ss, syntax.ss,
externs.h, fasl.c, gc.c, scheme.c, thread.c,
mats/6.ms, mats/7.ms, mats/bytevector.ms, mats/misc.ms, patch*,
root-experr*,
intro.stex, use.stex, io.stex, system.stex,
release_notes.stex
- added begin wrappers around many of the Scheme source files that
contained multiple expressions to cut down the number of top-level
fasl objects and increase compressibility. also removed the
string filenames for debugging at the start of each file that had
one---these are best inserted universally by a modified compile-file
during a debugging session when desired. also removed unnecessary
top-level placeholder definitions for the assignments that follow.
4.ss, 5_1.ss, 5_2.ss, 5_3.ss, 5_7.ss, 6.ss, 7.ss, bytevector.ss,
cafe.ss, cback.ss, compile.ss, cp0.ss, cpcommonize.ss, cpletrec.ss,
cpnanopass.ss, cprep.ss, cpvalid.ss, date.ss, engine.ss, enum.ss,
env.ss, event.ss, exceptions.ss, expeditor.ss, fasl.ss, foreign.ss,
format.ss, front.ss, ftype.ss, inspect.ss, interpret.ss, io.ss,
library.ss, mathprims.ss, newhash.ss, pdhtml.ss, pretty.ss,
prims.ss, primvars.ss, print.ss, read.ss, record.ss, reloc.ss,
strnum.ss, syntax.ss, trace.ss
original commit: b7f161bf2939dfedce8accbfa82b92dbe011d32a
PR #2678 unintentionally removed this attribute, but it was used
at least by "collections-lib" and "static-rename-lib".
cc @sorawee @lexi-lambda @jackfirth @rmculpepper