Commit Graph

42879 Commits

Author SHA1 Message Date
David Van Horn
497f35a071 Use https for HtDP links since MIT Press doesn't redirect. 2021-02-16 22:19:47 -05:00
David Van Horn
5170940daf Fix stale MELPA URL. 2021-02-16 22:19:47 -05:00
David Van Horn
297c3b93fb Update CGI RFC reference, fix stale URL. 2021-02-16 22:19:47 -05:00
Matthew Flatt
616daa2239 windows: fix finding self for boot files
Use a wide-character function instead of an ASCII function
to open the executable. Otherwise, Racket breaks when installed
into a non-ASCII path.
2021-02-16 17:24:11 -07:00
Ryan Culpepper
f502cf3b4e db: simplify locking 2021-02-16 12:56:15 +01:00
Ryan Culpepper
f1a5dab4c7 db: update sqlite3 to use ffi-common mixin 2021-02-16 12:56:15 +01:00
Ryan Culpepper
594dfafdf4 db: factor out ffi-common mixin 2021-02-16 12:56:15 +01:00
Matthew Flatt
cf0e45b763 cs: unbreak Windows errno
Restores the repair in 6e58310176, which accomodates certain modes of
compiling the Chez Scheme kernel on Windows.
2021-02-15 17:52:56 -07:00
Matthew Flatt
1fd516c502 cs: fix exit on startup error
Also, simplify errno and exit handling, because Chez Scheme always
provided "(cs)s_errno", and "(cs)c_exit" now does what Racket needs.

Closes #3687
2021-02-15 17:41:25 -07:00
Matthew Flatt
688094e622 Chez Scheme: make default exit handler normal
If a script uses `(exit 1)`, for example, the script should
exit with status 1.
2021-02-15 17:23:55 -07:00
Matthew Flatt
b9ef307b30 cs & regexp: fix regexp-match/end on large strings
When a string is large enough, its conversion to bytes is internally
streamed, and `regexp-match/end` did not get the match-ending bytes
correctly.

Closes #3684
2021-02-14 10:22:03 -07:00
Matthew Flatt
0541fe3b54 disable unreliable test 2021-02-13 09:00:18 -07:00
Matthew Flatt
2dd59a706c bc: unbreak JIT 2021-02-13 08:58:57 -07:00
Matthew Flatt
0523a5311c add structure-type sealing
The predicate for a seald structure type can be faster than a
predicate for a non-sealed structure type, and Chez Scheme takes
advantage of that opportunity.

The BC JIT could be improved to take advanatge of sealed structure
types, but it isn't.

This commit also fixes CS checking of a supertype for certain shapes
of prefab struct-type declarations.
2021-02-13 08:46:31 -07:00
Matthew Flatt
1f68962d67 cs & schemfiy: avoid crash with 1 extra argument to make-struct-type 2021-02-12 19:45:08 -07:00
Matthew Flatt
ae80c890e9 update source READMEs on modifying versions and pb bootfiles 2021-02-12 16:50:32 -07:00
Matthew Flatt
ccad328afd sync pb with signal-registration change 2021-02-12 16:50:32 -07:00
Matthew Flatt
4c836a1dd1 rktio: always set signal mask to empty after fork
Saving and restoring the signal-mask state does not work right, since
rktio itself may block SIGCHLD in some cases, and it doesn't seem
useful/right to preserve the mask after fork.
2021-02-12 16:50:32 -07:00
Jack Firth
6cfc7b880b Clarify the purpose of flat-contract-predicate
The docs currently state that `flat-contract-predicate` is merely a holdover for backwards compatibility, and that flat contracts can be used directly as predicates now. This isn't correct: _some_ flat contracts can be used directly as predicates, but not all. Ordinary racket values that double as contracts such as numbers and symbols can't be used as predicates without using `flat-contract-predicate`. Additionally, this pull request directs users to `coerce-flat-contract` if they're seeking to build contract combinators that explicitly convert ordinary racket values into flat contracts.

Context: racket/scribble#293.
2021-02-12 09:05:23 -06:00
Matthew Flatt
8a914d9338 further repair to unix-signal test 2021-02-11 19:29:56 -07:00
Matthew Flatt
3e2245d40e rktio: unbreak for Windows 2021-02-11 17:39:07 -07:00
Matthew Flatt
5fe6de4ea9 repair to unix-signal test 2021-02-11 17:32:09 -07:00
Matthew Flatt
eba9be1b39 cooperate with nohup
If SIGHUP is initially ignored, don't set a SIGHUP handler.
2021-02-11 15:27:29 -07:00
Matthew Flatt
27c7f45937 guide: fix broken sentence
Closes #3673
2021-02-11 15:27:29 -07:00
Matthew Flatt
350264571d reference: better info on random-number generator state space 2021-02-11 15:27:29 -07:00
Matthew Flatt
2cbaeb7865 Unix: restore all signal handlers after creating a subprocess fork
For each signal handler that is changed, save its state, and restore
the state in a child process after a `fork` and before an `execve`.
Also save and restore the signal mask.

This change requires cooperation from various subsystems, which often
takes the form of a callback registered with the subsystem to be
called before adjusts a signal handler.

Closes #3609
2021-02-11 15:27:29 -07:00
Matthias Felleisen
2ca6f7a5d6 fixes docs, closes #3682 2021-02-11 16:31:48 -05:00
Anish Athalye
c07e9cde09 Improve errors for forbidden ops on weak sets
Forbidden set operations on weak sets produced slightly confusing error
messages:

    > (define s (weak-set))
    > (set-add s 42)
    ; set-add:
    ; expected: (not/c set-mutable?)
    ; given mutable set: (weak-set)
    ; argument position: 1st
    > (set-mutable? s)
    #f

Invoking an operation that required an immutable set gave a message
saying that a `(not/c set-mutable?)` was expected, but a `weak-set` is
not recognized by `set-mutable?`, which only recognizes mutable sets
with strongly-held keys. Changing `set-mutable?` to recognize weak sets
seems undesirable.

This patch changes the error message so that the above example produces
the following error:

    > (define s (weak-set))
    > (set-add s 42)
    ; set-add:
    ; expected: (not/c (or/c set-mutable? set-weak?))
    ; given mutable set: (weak-set)
    ; argument position: 1st
2021-02-11 12:41:46 -05:00
Matthew Flatt
0137c1c545 Chez Scheme: repair expected-error log 2021-02-10 07:55:23 -07:00
Bogdan Popa
f3793bb4d7 xexpr: micro-optimize xexpr-write
This improves write performance by between 15% and 40% on large xexprs.
2021-02-10 09:09:39 -05:00
Matthew Flatt
9f6f988150 Chez Schme: change struct predicate implementation
Instead of keeping a rectord type's ancestry in a vector ordered from
subtype to supertype, keep the vector the other way around, and
include a record type at the end of its own vector. This order makes a
more direct test possible when checking for a known record type,
especially one without a supertype, and it's generally easier to
reason about.

The revised compilation of record predicates trades some speed in one
case for smaller generated code and speed in other cases. The case
that becomes slower is when a predicate succeeds because the record is
an immediate instance of the record type. The cases that go faster are
when a predicate fails for a non-instance record or when a predicate
succeeds for a non-immediate instance. It's possible that an
immediate-instance shortcut is worthwhile on the grounds that it's a
common case for a predicate used as contract, but we opt for simpler
and less code for now, because the difference is small.

Also, add `record-instance?`, which in unsafe mode can skip the check
that its first argument is a record, and cptypes can substitute
`record-instance?` for `record?` in some cases. This change was worked
out independently and earlier by @yjqww6, especially the cptypes part.

Related to #3679
2021-02-10 06:53:53 -07:00
Matthew Flatt
3a49533ff5 fix accidental change 2021-02-07 13:45:54 -07:00
Matthew Flatt
8a08704012 cs: support Android on 32-bit and 64-bit ARM
Various configure and makefile improvements apply more broadly to
environments that, say, lack iconv or target 32-bit ARM without Thumb.
2021-02-07 10:49:25 -07:00
Matthew Flatt
342bd6645c update cross-build info for Racket CS 2021-02-07 07:09:08 -07:00
Matthew Flatt
d07d256f18 racket/src/configure: correct default when CS and BC are both enabled 2021-02-06 10:51:24 -07:00
Sorawee Porncharoenwase
965c941caa doc: change define-struct to struct whenever possible
As documented, `define-struct` "is provided for backwards compatibility;
struct is preferred". This PR changes uses of `define-struct` to
`struct` whenever possible in the docs.
2021-02-05 15:22:51 -07:00
Ben Greenman
5948655911
typo: "its" -> "it" 2021-02-05 11:15:49 -05:00
Matthew Flatt
41623f3027 Chez Scheme: move write-barrier fixnum guard outside write fence
On an Apple M1, an example like

      (let ([v (make-vector 1000000)])
        (for* ([_ (in-range 100)]
               [i (in-range 1000000)])
          (vector-set! v i (+ 1 i))))

would generate tightly interleaved fence and store operations, which
seems to make the processor unhappy so that the code run 40x slower
than it should.

A key part of the example is that `(+ 1 i)` defeats cp0-level
inference that the result will be a fixnum. A dynamic fixnum test
avoids adding the update to a remembered set as part of the write
barrier, but the memory fence needed for ARM must be before the store,
while the fixnum test was after the store. This change bundles the
write fence and remember-set update under a `fixnum?` guard, so they
happen to gether or not at all --- at the small cost of generating the
store instruction(s) in two branches. In the example above, neither
the fence nor remember-set update happen, but changing `(+ 1 i)` to
`(quote x)` triggers both, and performance is still ok.
2021-02-03 10:30:24 -07:00
Matthew Flatt
0a945cd5f7 fix continuation-marks on thread without prompt
Closes #3675
2021-02-03 07:14:07 -07:00
yjqww6
5c6d7a3934
ChezScheme: use types to eliminate some dirty stores 2021-02-03 06:16:16 -07:00
Matthew Flatt
f968945e26 cs & schemify: with-continuation-mark optimization
Remove a `with-continuation-mark` that is redundant because its both
is another `with-continuation-mark` with the same key. That's useful
for reducing a pattern that appears after some `if`-removing
optimizations on code with errortrace-generated annotations.
2021-02-01 09:05:56 -07:00
Matthew Flatt
fd642d2715 test to check that callbacks are in atomic mode 2021-02-01 09:05:56 -07:00
Matthew Flatt
53b3cc5eb4 makefile: make just nmake make
Use a comment trick to make `nmake` see a different default target
than `make`, which will save a small amount of hassle from forgetting
to type `nmake win`.
2021-02-01 09:05:56 -07:00
Ryan Culpepper
ee43d982e4 db: fix for disconnect during query in OS thread
This change allows a query that is run in an OS thread to succeed even
when the connection is custodian-disconnected. Previously, the part in
the OS thread would complete, and then the operations needed to
package the result would fail. This fix moves some of those operations
to the OS thread and makes read-tx-status work when disconnected.
2021-01-31 07:13:03 +01:00
John Clements
a5b14d74b7
typos (#3668)
* typos

* reorder and reword raco exe flags for CS/BC

Suggestsions from @sorawee, thanks!

* make two suggested edits, retract one
2021-01-30 13:27:27 -08:00
Matthew Flatt
936ac2bf75 docs: update BC and CS references
Replace "3m and/or CGC" with "BC", use "implementation" instead of
"variant", add a section on implementations to the reference,
update corners where the documentation suggests that BC/3m is the
default, and generally order CS first.
2021-01-30 10:53:07 -07:00
Sam Tobin-Hochstadt
32d3c8b607 Describe Racket CS as the default.
Relevant to #3663.
2021-01-30 08:16:49 -07:00
Sorawee Porncharoenwase
0101f584fb struct*: fix incorrect struct-info extraction
Also add tests for `struct-copy` and `struct*` for cases
where struct-field-info is not available

Fixes #3662
2021-01-30 08:16:11 -07:00
Ryan Culpepper
c9861931ad db: use ffi/unsafe/os-async-channel
Also:
- use one OS thread per connection instead of one per query
- when using OS thread, finish disconnect in OS thread
2021-01-30 08:54:40 +01:00
Matthew Flatt
4e76091c64 add ffi/unsafe/os-async-channel 2021-01-29 12:54:23 -07:00