Commit Graph

42879 Commits

Author SHA1 Message Date
Matthew Flatt
37ee8a793c Chez Scheme: make "immediate" consistently mean type-immediate
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.
2021-02-28 08:45:17 -07:00
Matthew Flatt
04e78c4bb7 repair handling of PLTCOMPILEDROOTS
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
2021-02-27 19:16:21 -07:00
Matthew Flatt
2b79ba6d4f add ephemeron hash tables
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.
2021-02-27 19:08:05 -07:00
Matthew Flatt
c89f885578 Chez Scheme: fix test involving CAS
Replace an unnecessary `box-cas!` in a test with `set-box!`. The use
of `box-cas!` was wrong in that it didn't accomodate a spurious CAS
failure.
2021-02-27 12:20:09 -07:00
Matthew Flatt
be7c7755b2 struct: syntax error for #:prefab plus #:authentic
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
2021-02-26 16:58:31 -07:00
Matthew Flatt
6ae0417468 docs: explain why not to use byte-ready? 2021-02-26 14:50:19 -07:00
Matthew Flatt
999c300f7f cs: fix byte-ready? on the result of make-input-port
When an evt is returned by the byte-peeking function, the evt needs to
be polled.

Relevant to racket/datalog#13
2021-02-26 11:34:05 -07:00
Ryan Kramer
0841af7992 add tests and scribble documentation for XML indentation 2021-02-26 09:24:31 -05:00
Ryan Kramer
a5f95a4a41 adding different indentation to XML 2021-02-26 09:24:31 -05:00
Matthew Flatt
0ab75d1675 read: avoid quadratic-time string->number integer conversion
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.
2021-02-25 14:58:02 -07:00
Matthew Flatt
70c763833d repair collection-file-path and default current-compiled-file-roots
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.
2021-02-25 13:31:17 -07:00
Cameron Moy
7f34da35e7 Fail random generation of range contracts with bad bounds 2021-02-25 11:34:00 -06:00
Matthew Flatt
f1fb22f0a7 Chez Scheme: faster bignum printing for power-of-two bases
Insteda of using the generic strategy that involves division, walk
through the bits of a bignum to convert to a power-of-two base.
2021-02-25 06:35:46 -07:00
Matthew Flatt
c2b46b1e96 Chez Scheme: Burnikel-Ziegler division for very large integers
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)`.
2021-02-25 06:35:46 -07:00
Matthew Flatt
35116f6015 Chez Scheme: improve multiplication with trailing 0s
Multiplying bignums with trailing 0s is common enough to be worth a
special case.
2021-02-25 06:35:46 -07:00
Matthew Flatt
0cb9643fcb Chez Scheme: improve multiplication and scheduling
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.
2021-02-25 06:35:46 -07:00
Cameron Moy
c8bc0c76ad Improve flat-murec-contract with random generation 2021-02-24 15:51:45 -06:00
Matthew Flatt
18435e3a08 cs: fix interactio of unsafe capture and barriers
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
2021-02-23 13:03:39 -07:00
Matthew Flatt
fff39d0306 Chez Scheme: fix expected-error log
Repair after commit 0523a5311c.
2021-02-23 13:03:39 -07:00
Fred Fu
12dbfeb58a doc: fix contract for read-bytes-avail!/enable-break 2021-02-23 11:30:05 -07:00
Patrick McCarty
3fa362566c guide: fix a grammatical issue
`into to` -> `into`
2021-02-23 11:29:08 -07:00
yjqww6
4110761f94 cs: optimize pattern matching on authentic structs 2021-02-23 11:25:04 -07:00
Matthew Flatt
23dc67c1a4 unixstyle install: fix when "share/pkgs" is not created 2021-02-22 19:28:36 -07:00
Matthew Flatt
5855fcd0ae more acks.rkt catchup 2021-02-22 19:28:36 -07:00
Matthew Flatt
05ab3ce853 raco pkg: test repair
Thanks to @yfzhe
2021-02-22 19:28:36 -07:00
Matthew Flatt
63aa90c748 repair sandbox test for compile-file-roots with extra paths 2021-02-21 17:52:36 -07:00
Matthew Flatt
6099ec80b3 further repair for test with 'same in compiled-file-roots 2021-02-21 15:11:32 -07:00
Matthew Flatt
5e9535b3a5 fix test to work with ".zo" via compiled-file-roots 2021-02-21 12:58:45 -07:00
Matthew Flatt
d3b4d14287 correction to unixstyle-install for raco commands 2021-02-21 09:47:51 -07:00
Matthew Flatt
441cf9a85c correction to unixstyle-install for libzo mode 2021-02-21 09:41:05 -07:00
Matthew Flatt
4df60bb819 unbreak make install step for non-Unix-style, too 2021-02-21 08:29:33 -07:00
Matthew Flatt
9dbcf179b6 unbreak make install step 2021-02-21 08:16:27 -07:00
Matthew Flatt
51b8606861 unix-style install: ".zo"s in "lib" instead of "share"
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.
2021-02-21 07:58:29 -07:00
Matthew Flatt
a110c58e52 add 'compiled-file-roots to "config.rktd" 2021-02-21 07:58:29 -07:00
Matthew Flatt
404c91ed55 fix sorting in "acks.rkt" 2021-02-21 07:58:29 -07:00
Matthew Flatt
95ee83e486 cs: remove reference to racket_exit
Was supposed to be part of 1fd516c502, but was missed because the
change wasn't saved.
2021-02-21 07:58:29 -07:00
Matthew Flatt
2239811eab fix doc typo
Thanks to Mike Sperber for the report.
2021-02-21 07:58:29 -07:00
Robby Findler
3d2eeba6a4 typo 2021-02-20 13:47:27 -06:00
Matthew Flatt
cff766ab84 change Git package references to use default branch
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
2021-02-20 07:21:10 -07:00
Matthew Flatt
f0e41cf143 git-checkout: add support for 'head as a ref
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.
2021-02-19 16:01:29 -07:00
Matthew Flatt
19c3ee456b configure: fix --collectsdir and --appsdir handling
Thanks to @tgbugs for the report an initial repair.

Closes #3692
2021-02-19 09:26:58 -07:00
Matthew Flatt
eaeb49d0d1 update acks.rkt 2021-02-19 09:26:58 -07:00
David Van Horn
f060ba5cd5 Spelling 2021-02-18 10:46:41 -05:00
Matthew Flatt
89130bd64f unbreak cross build 2021-02-17 11:09:54 -07:00
Matthew Flatt
bf8741e727 add #:callback-exns? to _fun and _cprocedure
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.
2021-02-17 08:41:09 -07:00
Matthew Flatt
5ed105ef8a reference: fix docs on get-output-string 2021-02-17 08:41:09 -07:00
David Van Horn
cc5dbaac2c Update pkgs/racket-doc/scribblings/guide/other.scrbl
Co-authored-by: Sam Tobin-Hochstadt <samth@cs.indiana.edu>
2021-02-16 22:19:47 -05:00
David Van Horn
77b487b671 Fix up planet url. 2021-02-16 22:19:47 -05:00
David Van Horn
5743e1a143 Occurrences of http -> https that don't redirect. 2021-02-16 22:19:47 -05:00
David Van Horn
4438dec280 Wayback for old MSDN doc. 2021-02-16 22:19:47 -05:00