Exposing `$immediate?` as just "immediate" will be useful to cptypes.
Meanwhile, introduce "fixmediate" as the term for a union of "fixnum"
and "immediate" (i.e., values that are not allocated).
The new terminology helps avoid internal inconsistencies, such as the
`Simmediatep` kernel macro meaning "immediate" while the `$immediate?`
primitive meant the union.
Commit a110c58e52 broke the interaction with `PLTCOMPILEDROOTS`.
Instead of reverting to the old behavior that coerced 'same to a path,
this change makes `path-list-string->path-list` a little more
flexible.
Closes#3704
Weak hash tables retain keys weakly, but they hold each corresponding
value strongly as long as the key is accessible. As a result, weak
hash tables suffer from the key-in-value problem: if the value refers
to the key, the key cannot become inaccesible and be removed from the
table.
Previously, the way around that problem was to map a key to an
ephemeron that combines the key and value. The extra cost of involving
ephemerons (a constant factor) is why ephemerons storage is not the
default behavior of weak hash tables.[*] Having ephemeron hash tables
as a distinct variant avoids imposing a cost where its not needed, and
compared to using explicit ephemerons, it's easier to drop into a
program that was written to use strong or merely weak hash tables.
For Racket CS, the change is especially straightforward, because
ephemeron tables already exist in Chez Scheme (at least for the Racket
variant, in the case of eqv- and equal-based tables).
[*] Also, non-emphemeron hash tables turn out to be needed for certain
finalization tasks.
Prior to this change, the combination was documented as a syntax
error, but it was only a run-time error --- and not even that as of
v8.0 for Racket CS (but it was always a run-time error for BC).
Closes#3700
For bases other than powers of 2, I think reading is at least
O(n^1.58), due to multiplication with Karatsubra --- but that turns
out to be a lot faster than O(n^2) by the time you get to 1M digits.
For powers of 2, the time should be linear.
The `collection-file-path` function did not handle compiled-file root
paths correctly. The problem was exposed by a recent change to the
default for `current-compiled-file-roots`, which made it match the
documentation, but this commit changes it back and fixes the
documentation.
Adapted from Peter Bex's Scheme version of CHICKEN's implementation
here:
https://www.more-magic.net/posts/numeric-tower-part-3.html
Improving dvision has a large effect on printing large integers in
base 10, such as printing `(expt 2 8000000)`.
Raise the threshold for using Karatsuba. The experimentally determined
threshold (on an M1 Mac) matches the GMP default threshold, so that
seems like a good sign.
Also, adjust kernel bignum operations to decrease the trap counter.
Otherwise, a program that performs many big multiplcations or
divisions does not check for Ctl-C or swap threads often enough.
Fix `unsafe-call-with-composable-continuation/no-wind` so that it's
not blocked by a barrier, since it's supposed to have thread-like
capturing ability.
Closes#3696
For a Unix-style installation, change the default mode to put
"compiled" directories under "lib" instead of "shared", since they're
architecture-specific for Racket CS.
This installation mode relies on the new 'compiled-file-roots config
entry. The installation process updates "config.rktl" so that
`current-compiled-file-roots` is initialized to find ".zo" files under
"lib".
Use `--enable-sharezo` to get the old behavior, either for installing
Racket BC or if you want to ignore "lib"-vs.-"share" guidelines to
simplify the installation.
If a Git package source does not include "#" followed by a ref, then
use the branch/commit designated by a server as the default branch or
commit (i.e., the one for the "HEAD" symref), instead of assuming the
branch "master".
This is technically a backward-incompatible change to the
interpretation of Git package sources, but explicit branch
specification continues to work the same. For the forseeable future,
to support recent versions, packages in a branch other than "master"
will still need to be specified using the branch name, such as
including "#main" at the end of the package source. Eventually,
relevant versions of Racket will support the new default.
Relevant to #3672
Also, change the default ref from "master" to 'head. This is
technically a backward-incompatible change, but so far it seems more
likely to make things work right than to break them.
In Racket BC, callbacks don't have to be atomic, and it's ok for the
callback to raise an exception (as long as the foreign library is ok
with a longjmp escape). Using `#:callback-exns? #t` on a foreign
callout in both CS and BC allows an atomic callback (invoked during
the foreign call) to raise an exception. Terms and conditions apply.