Commit Graph

6065 Commits

Author SHA1 Message Date
Philip McGrath
1b8250de14 readme: remove reference to Boehm GC 2021-04-14 08:33:21 -06:00
Matthew Flatt
5dfe7b9c18 cs: repair run of at-exit custodian callbacks
When an at-exit callback is attached to a subcustodian, it wasn't run
as it should be.

Closes #3782
2021-04-14 08:14:19 -06:00
Matthew Flatt
84b58d9bae expander: more flexible top-level #%app expansion
Adjust top-level compilation to accomodate an `#%app` macro that
expands to definitions. Allowing `#%app` to expand to a non-expression
is more consistent with expansion in a module.

There's still an issue with top-level expansion where

 (define-syntax-rule (#%app id)
   (begin
     (define-syntax (id stx) 'ok)
     id))

does not work, because the kind of partial expansion used for the top
level doesn't trigger `#%app`, and so the macro and use are expanded
together in a `begin` instead of separately. Changing that would be
subtle and maybe not worthwhile for the top level. Also, although the
behavior of the (very) old expander may not be relevant anymore, it
behaved the same way on that example.

Closes #3728
2021-04-12 17:00:12 -06:00
Matthew Flatt
4d6a23d1d5 cs & io: fix exception type for "port closed"
To be consistent with BC, it's an `exn:fail` exception, but not
`exn:fail:contract`.
2021-04-11 17:57:03 -06:00
Matthew Flatt
a808eb042b cs & io: fix read on closed byte-string input port
Closes #3770
2021-04-11 16:14:53 -06:00
Matthew Flatt
4fabc762a5 Racket HISTORY.txt notes for v8.1 2021-04-10 10:19:22 -06:00
Matthew Flatt
b9fdb503c1 raco demodularize: adapt to CS
Really, `raco demod` is adapted here to work with any linklet-based VM
by compiling modules to machine-independent form, which is essentially
a wrapper around linklet S-expressions. The BC-specific implementation
remains in place, and it has the advantage of being able to work with
existing module compilations, while the implementation based on
machine-independent form must recompile all modules before attempting
to combine them (but that recompilation is easily cached).

Use `--work <dir>` to use `<dir>` as a cache for multiple
demodularizations.

Getting `raco demod` to work involved several incidental improvements:

 * make `racket/linklet` work with machine-independent forms;

 * add `linklet-body-reserved-symbol?`;

 * fix schemify for linklets that have unexported definitions (which
   the expander never generates, but the demodularizer does);

 * add `current-multi-compile-any` to expose CM's multi-target
   compilation mode programmatically; and

 * repair a bug in CS JIT mode.

The demodularizer could be a lot smarter to prune demodularized code
before sending it off to the compiler. Of course, the compiler should
be able to figure out improvements itself, but sending a smaller chunk
of code to the compiler can avoid the hybrid interpreter--compiler
mode that is used for large linklets and that prevents optimizers like
cp0 from doing much to prune definitions.

The demodularizer has a lot in common with the expander's flattener
that is used for bootstrapping, and a smarter demodularizer would have
even more in common. It would be nice to have one implementation
instead of two.
2021-04-10 08:13:29 -06:00
Robby Findler
1244396d01 fix *list/c so that it returns a flat contract when given flat contracts and a chaperone contract when given chaperone contracts 2021-04-09 22:18:10 -05:00
John Clements
16bc937e7f Post-release version for the v8.1 release 2021-04-09 12:17:53 -07:00
Matthew Flatt
ebb4ce990e cs: repairs for 'text mode on Windows
Commit 24c6b2450c fixes a problem with 'text mode output, but "io.scm"
needed to be sync'ed for that repair to take effect. The repair
exposed a problem with position counting for 'text mode input, which
is repaied here.

This commit includes a relatively unrelated repair to `_list` and
`_vector`, which was exposed by a combination of the I/O demo
bootstrap and a recent repair for `malloc` to recognizes `_bytes` as a
GCable type.
2021-04-08 16:01:26 -06:00
Ryan Culpepper
1c4570b315 fix commit 0a95c50f, missed one call to wrap-ports 2021-04-08 19:56:24 +02:00
Ryan Culpepper
0a95c50f77
openssl: add ALPN support for clients (#3765) 2021-04-08 15:26:01 +02:00
Gustavo Massaccesi
24c6b2450c rktio: fix output of newlines in text files in Windows 2021-04-08 07:01:19 -06:00
Matthew Flatt
4cf538f349 cs: compress boot files by default on Windows
Compressing boot files is a trade-off in file size versus startup
time. Compressed boot files take about 10MB instead of 40MB, but using
uncompressed boot files cuts the minimum startup time (for `racket
-n`) by around 25%.

On Unix-like platforms, we favor startup time by default. Although an
extra 30MB isn't small, it's also not that much, and the Unix culture
favors small excutables that start quickly (although Racket's startup
time is not as fast as we'd like).

On Windows, we try the opposite choice with this commit. Windows
doesn't have the same culture of little excutables, slower filesystems
(especially networked ones) seem more common, and the savings for
stand-alone executables seem more worthwhile.
2021-04-07 07:09:12 -06:00
Mike Sperber
922bab40b5 Add print-value-columns parameter. 2021-04-07 05:13:25 -06:00
Matthew Flatt
548aca02e7 configure and makesfiles: make code compression more configurable
Add a `configure` argument to enable even more compression in ".zo"
forms, and introduce environment variables to enable compression
control for Windows builds using MSVC.
2021-04-06 17:14:48 -06:00
Matthew Flatt
069e6d1417 cs: fix cross-compile non-code fasl compression
When cross compiling, use the same fasl compression mode as non-cross
compilation on linklet bundles --- instead of always compressing,
which slows down module loading in most environments.
2021-04-06 17:14:48 -06:00
Matthew Flatt
aaab0aca28 configure: unbreak --enable-compressboot 2021-04-06 17:14:48 -06:00
Matthew Flatt
1ad31fe559 cs: fix cross compile to omit RTD descriptions
This is another way that cross compilation differed from direct
compilation, overlooked before because it's an argumen to
`compile-to-port` instead of a parameter.
2021-04-06 17:14:48 -06:00
Matthew Flatt
e58a3d9dda cs: adapt (unused) Patricia trie implementation for negative hash codes
The hashing protocol has been adjusted since the Patricia trie
implementation so that the result can be negative. Force it to
avoid breaking an assumption in the Patricia-trie implementation
(even though this implementation is not currently used).
2021-04-06 17:14:48 -06:00
sorawee
e8f857cc19
sequence & list: add in-inclusive-range and inclusive-range
Currently, a common way to generate an inclusive range is to
use `in-range`, but users need to figure out an appropriate
upper bound, which (1) is error-prone and (2) obscures the intention.
As an example, https://docs.racket-lang.org/pict/Animation_Helpers.html
uses `(in-range 0 1.2 0.2)` to generate `'(0 0.2 0.4 0.6 0.8 1.0)`.
It is also quite common to use `(in-range 1 (add1 n))` to generate
`(list 1 2 ... n)`. Both examples are subpar.

This PR adds `in-inclusive-range` as a counterpart to `in-range`, and
`inclusive-range` as a counterpart to `range`, to make inclusive range
construction easier.

An alternative API is to modify `in-range` to accept a keyword argument
like `#:inclusive? #t`, but this is more verbose and no other sequence
generating function accepts keyword arguments.
Therefore, I think `(in-)inclusive-range` is more appropriate.
2021-04-05 08:02:36 -06:00
Greg Hendershott
b7078dc272 provide-trampoline: Ensure expanded export id has srcloc
1. Forms like rename-out supply the original "export-id" syntax to
make-export as orig-stx, as well as the symbol value as out-sym. In
such a case -- that is, when (eq? (syntax-e (export-orig-stx export))
(export-out-sym export)) -- expand using orig-stx, retaining its
source location and other properties.

2. Otherwise, at least expand using out-sym as an identifier with
srcloc from orig-stx. Rationale: Although that source location might
not be exactly correct it is probably better than none at all.

Note: The spirit of this commit is to treat this as a private
implementation detail -- as opposed to stating some new official API
for renaming provide transformers in general -- so this commit doesn't
update documentation for e.g. `make-export`.
2021-04-05 08:01:41 -06:00
Matthew Flatt
612c1865de cs: ensure cross compile uses same configuration as non-cross
Some compiler settings were previously not carried over to
cross-compile mode, with the consequence that cross-compiled code was
slightly slower.
2021-04-04 15:12:11 -06:00
Matthew Flatt
7013cfb655 cs: configure MSVC Windows build to compress compiled code 2021-04-04 12:41:15 -06:00
Matthew Flatt
589f0e55e4 ffi/unsafe: repair cast from GCable pointer with offset
The repair in 601f4a76e7 did not correctly handle pointers with a
non-zero offset.

Thanks to Bruce O'Neel for the report.
2021-04-04 11:19:12 -06:00
Matthew Flatt
d3f3be5dc5 sqlite3: in ffi, fix _ptr arguments to #:blocking? #t functions 2021-04-04 08:30:43 -06:00
Matthew Flatt
ed8019742c ffi/unsafe: add optional malloc mode to _ptr and _box
The optional mode is probably most useful when 'atomic-interior is
needed in combination with a `#:blocking? #t` function.
2021-04-04 08:24:06 -06:00
Matthew Flatt
dcaf358c64 cs: add malloc support for 'interior mode
Since immobile vectors now exist at the Chez Scheme level, it's easy
to support 'interior mode (similar to 'interior-atomic).
2021-04-04 07:51:34 -06:00
Matthew Flatt
601f4a76e7 ffi/unsafe: fix cast from _bytes to _pointer
The `cast` function is supposed to auto-promote its second argument to
a GCable type if the value to convert is a GCable pointer. This
promotion did not happen for `_bytes` and other string-like types.

Also, in CS, `malloc` did not alocate GCable memory by default when
given the `_bytes` type, which would sometimes interfere with getting
a GCable pointer result.

This bug explains why the "draw-test/tests/racket/draw/dc.rkt" test
would occassionally have an `unscaled-alpha-set` failure on DrDr (for
many years).
2021-04-02 10:32:40 -06:00
Matthew Flatt
181b9c80ac add syntax-serialize and syntax-deserialize
The new functions provide a more direct way to serialize and
deserialize syntax objects than compiling and running a `quote-syntax`
form. The new functions also offer additional configuration related to
preserving extra syntax properties and limiting the use of shared
"bulk binding" tables (i.e., tables that must provided by module
declarations in the namespace).

This change does not add syntax-object support to `serialize` or
`s-exp->fasl`, because serialized syntax objects are still in many
ways like code: they are version-specific, and their invariants can be
broken by mangling the serialized form (in much the same way that
compiled code can be broken by mangling, and with similar safetly
implications).
2021-04-01 08:05:51 -06:00
Matthew Flatt
2606ae3d8e raco pkg: add support for "git+http[s]://" package sources
When referring to a Git repo with a "https://" URL, the URL must end
with ".git" to distinguish the URL for directory and file URLs. A
"git+https://" URL specifies that the Git-over-HTTP protocol should be
where the URL cannot contain ".git". For example, SourceHut URLs do
not include ".git" (while hosting services like GitHub or BitBucket
allow ".git" to be in the URL).

When using `raco pkg`, it was possible to specify `--type git` for an
"https://" reference, but for consistency and internal tracking, a
".git" would be added to the URL, anyway. Using `--type git-url` can
similarly force the interpretation of an "https://" reference without
triggering the addition of ".git". The new state is mostly internal,
but it is reflected in the output of `raco pkg show`, which shows
`git` for such references (as opposed to `url` as shown for others).
2021-03-31 13:29:42 -06:00
Ryan Culpepper
9a4f9688ad db: fix custom functions for blocking sqlite3_step change
Also fix error reporting for aggregate functions.
2021-03-30 10:15:12 +02:00
Ryan Culpepper
d65e648d6a db: mark sqlite3_step and sqlite3_prepare* as blocking
This allows the GC to run during these ffi calls. It is probably only
worth marking often-used, potentially long-running calls.
2021-03-30 09:06:35 +02:00
Bogdan Popa
6535f4f2b8 xexpr: add current-unescaped-tags to disable escaping for certain tags 2021-03-29 11:38:16 -04:00
Bogdan Popa
1a1018d9fe rumble,error: fix error case when given a field with no value
Closes #3744
2021-03-29 07:03:38 -06:00
Matthew Flatt
920e3dbde5 cs: repair async-apply handling for foreign callbacks
The CS implementation was missing a level of indirection. It worked
for a typical handler `(lambda (thunk) (thunk))` for the case when the
callback can run atomically, but it did not work for caces where
`thunk` is made to run later (potentially out of atomic mode).

Also, fix the management of interrupt state, including for some place-
and future-related asynchronous callbacks.

Thanks to @rmculpepper for the `async-apply` report, new `async-apply`
tests, and the repair for the interrupt-state bug.
2021-03-28 20:18:56 -06:00
Matthew Flatt
e31003b0ad racket/stream: unbreak chained lazy streams
The new implementation attempting to collapse lazy streams was broken.
2021-03-27 08:23:55 -06:00
Matthew Flatt
a5615a7bae racket/stream: add more control over laziness
Add `#:eager` options to `stream-cons` to control whether the head
and/or tail expression is delayed. Also add `stream-lazy` to
explicitly construct a lazy stream and `stream-force` (normally not
needed) to force a stream.

Delayed expressions in `stream-cons` are now non-reentrant, like
promises created by `delay`. This is a change in behavior, but I'm
hoping that no one relied on the old behavior, which has the bad
property that the delayed expression is retained until its result is
received.

For consistency, this commit also changes `stream*` to delay the
stream-construction expression when its the only one expression that
is given.

Internally, changes to the stream implementation reduce allocation.

The `stream-lazy` form would be more natrally called `stream-delay`,
but that creates a conflict with existing packages.
2021-03-26 19:52:42 -06:00
Matthew Flatt
4704dc6962 makefile: fix RACKET_FOR_BOOTFILES 2021-03-26 10:43:40 -06:00
yjqww6
4328b3acdb fix signatures of $fx+? and $fx-? 2021-03-26 15:07:51 +08:00
Alex Knauth
5c2949d051
add make-struct-type-property/generic and make-generic-struct-type-property (#3627) 2021-03-25 19:44:40 -04:00
Matthew Flatt
cd2d5f0ac7 cs: fix some error-message formatting
Some Chez Scheme error messages were not converted correctly,
leaving the values to be printed by Chez Scheme's printer.
2021-03-23 16:41:30 -06:00
Brian Adkins
f65560ed4c Optimize when sep is unspecified or the default regexp 2021-03-23 16:16:07 -06:00
Brian Adkins
754b3457c3 Verify the argument is a string?
For the fast path of splitting on whitespace, verify the str
argument is a string, so that internal-split will handle the
invalid argument error.
2021-03-23 16:16:07 -06:00
Brian Adkins
d061df81ce Optimize splitting strings on whitespace
Use an optimized function, instead of regexp-split, when string-split
is called with the default separator and trim setting.
2021-03-23 16:16:07 -06:00
Matthew Flatt
2a718d8162 Chez Scheme: repair for cross-library inlining
The cross-library inlining improvement in commit 6020b944ef did not
manage internal names correctly, and it could mix up bindings that
have the same printed form.

Closes racket/ChezScheme#35
2021-03-23 15:33:10 -06:00
Matthew Flatt
281eed7dda Chez Scheme: fix some typos 2021-03-23 13:42:05 -06:00
Gustavo Massaccesi
61cca93086 Chez Scheme: improve eq[v]? reductions in cptypes
Improve eq? and eq? handling to reduce expressions like
(eq? (newline) (void)) => (begin (newline) #t)
2021-03-23 15:14:56 -03:00
Gustavo Massaccesi
355b9f51be Chez Scheme: fix too much propagation of numbers in cptypes
In this example, after the check with eq? or eqv? the value of
the variables x and y are known, so cptypes replaced the
reference to the variable with it. But it can interact badly
with the eq? test, for example in this case the first (eq? x y)
can be #f and the second be reduced by the compiler to #t.

In spite eq? cannot be used to compare numbers reliably, this
behavior is too confusing and it's better to avoid it.

(define (one)
  (let ([r (random 2)])
    (if (= r 0) (one) r)))

(define (f x y)
  (define first-comparison (eq? x y))
    (when (and (eqv? x 7.0)
               (eqv? y 7.0))
      (define second-comparison (eq? x y))
      (eq? first-comparison second-comparison)))

(f (+ 6.0 (one)) (+ 6.0 (one)))))
2021-03-23 15:14:56 -03:00
Matthew Flatt
ef0ff679d0 correct some hash-table locking cases
BC did not take a lock for `hash-clear!`. Maybe the intent was that a
lock isn't needed from the perspective of `hash-clear!` when it isn't
traversing the table, but failing to take a lock before modifying the
table can break other operations (that do take a lock) in progress.
Furthermore, some iterations that intentionally did not take a lock
also did not guard against changes well enough. Various repairs here
avoid crashes, and now `hash-clear!` consistently takes a lock.

CS had a similar (but more subtle and more limited) instance of the
problem in `hash-map` and `hash-for-each`. That problem is corrected
(without adding any new lock acquisitions).

The existing CS implementation of `equal-hash-code` for hash tables
takes a lock more than the BC implementation. A possibly surprising
result: when attempting to add a mutable hash table to itself as part
of a key, the `hash-set!` can block forever on the hash table's lock,
instead of doing something more random as a result of having a mutated
key. The documentation now notes that possibility.

Related to #3738
2021-03-21 13:03:17 -06:00
Ryan Culpepper
8bf8e3cf82 db: fix error case for disconnect in lock 2021-03-20 18:27:55 +01:00
Ryan Culpepper
5f66fad355 db: fix check for recursive lock acquire 2021-03-20 18:27:55 +01:00
Ryan Culpepper
815910b419 db: fix lock for non-escaping hopeless callbacks 2021-03-20 18:27:55 +01:00
Matthew Flatt
a099e18767 sync generated files 2021-03-19 15:11:23 -06:00
Matthew Flatt
206577d701 vector->pseudo-random-generator[!]: accept impersonated vectors 2021-03-19 15:02:30 -06:00
Matthew Flatt
a50aa9d164 cs: repair for callbacks that might throw exceptions
The callable used to trigger stack unwinding was unlocked during
initialization, but it shouldn't be.
2021-03-19 07:49:28 -06:00
Gustavo Massaccesi
3952355d30 Chez Scheme: add suport for lists in cptypes
With list-assuming-immutable? and the internal construct
immutable-list the compiler can assume that some lists will
not be mutated.

Also, change the definition of interned-char?, because in CS all chars
are interned.
2021-03-19 09:19:27 -03:00
Gustavo Massaccesi
993b86ffa3 Chez Scheme: fix test in date.ms 2021-03-18 09:55:15 -03:00
Matthew Flatt
3244fa7a3c normalize error message for mem{ber|q|v}
Restore roughly the old error message for BC, but also adjust it to
use the modern error-message style (with newlines).
2021-03-17 19:52:26 -06:00
Robby Findler
274e4b95b1 give the binding that is introduced to be renamed on provide a source
location so it can be the target of jumps from other files

related to #3733
2021-03-17 19:55:53 -05:00
Matthew Flatt
e2cbd9bd73 fix "non-pair" error message for ass{oc,q,v,f} 2021-03-17 14:16:29 -06:00
Matthew Flatt
d0feb5c75a move memq and memv back to core
This commit partly reverts c305dba649 and 88fc9a979f, which was
discusssed in #366.

The original discussion was about allowing an extra argument to
`member` to pick the equality predicate. That change is still in place
in the same (private) Racket module.

The `memq` and `memv` functions are in Scheme for Racket CS and back
to being and in C for Racket BC. The old motivation for moving `memv`
and `memq` --- to get them out of C --- is subsumed by the switch to
CS (granting that some C code got added back to BC meanwhile). The
advantage of moving `memq` and `memv` back to the runtime core is that
the compiler can do more with them, at least in CS.

When `memq` and `memv` were moved previously, they lost checking for
cyclic lists. That wasn't discussed and presumably wasn't on purpose;
check is restored here, including for `member`.

There's no significant performance change in CS, except in cases like
`(memq x '(a b c))` that the compiler unpacks into a combination of
`eq?`s. For BC, the C version is a little faster (10-40%, depending on
the length of the list), but still slower than CS (probably because
`pair?` is slower, which due to representation differences).
2021-03-17 13:36:40 -06:00
Matthew Flatt
db34c62241 schemify: propagate 'compiler-hint:cross-module-inline through values
This change makes

 (begin-encourage-inline
   (define-values (f g h) (values e1 e2 e3)))

equivalent to

 (begin-encourage-inline
   (define f e1)
   (define g e2)
   (define h e3))
2021-03-17 13:33:04 -06:00
Sam Tobin-Hochstadt
4a65dfb1aa Use dd-parse to parse ... patterns inside quasipatterns.
Related to racket/typed-racket#1055.
2021-03-16 21:44:27 -04:00
Matthew Flatt
5058dc5a1a Chez Scheme: fix make-date and date-nanosecond signature 2021-03-16 08:26:06 -06:00
Matthew Flatt
a5db4bf376 Chez Scheme: fix make-time type signature
On a 32-bit platform, the nanosecond argument is not always a fixnum.
2021-03-16 07:47:45 -06:00
Matthew Flatt
a484cd76e5 cs & thread: fix problem with place initialization
The `current-place` place-local variable was initialized relatively
late in the set of place-creation steps. It was possible for the
thread scheduler to get involved before `current-place` was set ---
and in that case, it was possible for semaphores and Racket threads to
end up being used in the wrong place.
2021-03-15 13:51:16 -06:00
Matthew Flatt
c0cfd32bcb Chez Scheme: move cp machine-register indirection
Register allocation needs fresh machine-register state for each
compilation, and that was previously implemented by allocating a new
register record and indirecting references through a parameter. Move
the indirection to the places where conflict-set, index, and precolor
state is manipulated, and pass a state vector though to keep access
efficient. This change makes compilation slightly faster, and it makes
registers easier to work with by not having to introduce
indirections/delays in various places for register references.
2021-03-14 12:10:05 -06:00
Matthew Flatt
467ca64a7f Chez Scheme: split cpprim out of cpnanopass
Moving the np-expand-primtives pass to a separately compiled source
file reduces peak memory use when compiling Chez Scheme from about 1.3
GB to about 0.7 GB on a 64-bit platform. It's also nice from a
code-navigation perspective to split a 19k-line file to a 10k-line
file plus 8k-line file (and some additional small files).

The overall time for Chez Scheme to compile itself is only slightly
affected, even though some support functions, macros, and record
declarations end up getting compiled twice.
2021-03-14 07:39:55 -06:00
Bob Burger
31358698f3 Chez Scheme: sleep of non-positive duration now returns immediately
A negative duration would previously result in an infinite pause in
Windows.
2021-03-13 11:05:51 -07:00
Matthew Flatt
5e1df80a00 unixstyle-install: adjust DESTDIR fixup for "lib" executables with a suffix
More generally, make the path-fixup step insensitive to specific
filenames in the "lib" directory, making it more like the handling of
the "bin" directory.
2021-03-13 10:12:05 -07:00
Gustavo Massaccesi
a6e77a1a0c Chez Scheme: Add more maybe-* and eof/* types
The logic was added in the previous commits, but it's necesary to add
the mapping from the names in primdata to cptypes.

Also add a few subsets of fixnum.
2021-03-13 11:20:02 -03:00
Matthew Flatt
6f58ef5458 make embedding wrapper executable less sensitive to argv[0]
Running a `starter`-based executable with an argv[0] different
than the executable's path can make sense in various situations, but
it doesn't work for finding code embedded in the enxecutable. On
platforms where it's possible to get the current process's executable
(not looking at you, OpenBSD), then use that instead of argv[0] for
the purposes of loading embedded code.

Related to #3685
2021-03-12 20:08:53 -07:00
Matthew Flatt
4a06e4a1e3 Chez Scheme: remove before install
Removing the old executable before copying a new one in place avoids
problems on ARM Mac OS, at least.
2021-03-12 20:08:53 -07:00
Ismael Luceno
44964359ae Chez Scheme: fix missing include in externs.h
The correct header is needed to build with musl.
2021-03-12 19:50:40 -07:00
Robby Findler
288d13b85a add blame-replaced-negative? 2021-03-11 17:02:53 -06:00
Gustavo Massaccesi
3d04b71ced Chez Scheme: add maybe-char to cptypes
chars are immediates, so the previous change doesn't add automatically
the combinations like maybe-char. Add also eof/char that is commonly
used and has the same problem.

And rename in ctypes the internal symbol $immediate/true to
true-immediate because in all the other instances / is used for unions.
2021-03-10 14:27:00 -03:00
Matthew Flatt
8ba89cbd2a Chez Scheme: avoid floating-point register shuffling on x86_64
For floating-point arithmetic, encourage the register allocator to use
the same register for an argument and destination in arithmetic.
2021-03-09 17:36:21 -07:00
Matthew Flatt
5a2b6aab1e Chez Scheme: update docs for expand/optimize and run-cp0
Mention that it runs cptypes.
2021-03-08 09:55:45 -07:00
Matthew Flatt
75ba7ff5bc cptypes: discard call form around an error, better cm support
An an example of better error handling,

 (f (error 'x "x") y x)

turns into

 (error 'x "x")

which may allow further propagation through `begin` and `if` as
alerady implemented.

Also, make cp0 and cptypes more aware of
`call-{setting,getting,cosuming}-continuation-attachment` in terms of
result types and single-valuedness. The single-valued part requires
some generalization to the existing `single-valued?` support (by
default, "single-valued" => "doesn't inspect/changed immediate mark")
in both cp0 and cptypes.

Finally, the "optimize.rktl" test suite is now enabled for Racket CS.
The tests helped expose some missed opportunities and bugs, and it
should be particularly helpful going forward, since we're back to
having a place for Racket-level optimization tests. Not all tests
written for BC pass with CS. Grep for 'chez-scheme for missed
optimization opportunities.
2021-03-08 09:10:18 -07:00
Matthew Flatt
73eeff4f60 fix problems with continuation-mark-key chaperones
CS: When `with-continuation-mark` for a chaperoned key is in tail
position for a mark (such as a `parameterize`), make sure the existing
mark is still in place while (non-tail-)calling the chaperone's
interposition function.

BC: Don't collapse immediately nested `with-continuation-mark`s for
the same key if the key might be chaperoned. Also, repair treatment of
module-level bindings as potentially chaperoned.
2021-03-07 20:08:49 -07:00
Matthew Flatt
87d84a59c1 cs & schemify: cptypes-nice inline of authentic access and mutate
Change schemify to inline accessors and mutators of authentic
structure types in a way that lets cptypes eliminate checks for
subsequent operations.
2021-03-07 19:11:21 -07:00
Matthew Flatt
9651b45c83 cs & schemify: fix inlining that fold to #f
When the schemify inliner tries to inline, and inlining is supposed to
succeed with a result expression `#f`, the #f was being treated as a
failure to inline.
2021-03-07 16:55:18 -07:00
Philip McGrath
e45cd87511 version/check: use https; actually enforce timeout; guard reading params
Also, add an environment variable for testing purposes
and document the fact that `check-version` may block.
2021-03-07 11:12:57 -05:00
Bogdan Popa
81e0c86fc3 pkg: show bad deps in check-dependencies 2021-03-07 07:37:42 -07:00
yjqww6
b4d05e7a41 add [unsafe-]assert-unreachable 2021-03-07 06:48:50 -07:00
Matthew Flatt
fac8463082 cs: fix raco exe for OpenBSD
The repair involvea adding a `-E` flag to Racket for use by the wrap
executable that `raco exe` created, because OpenBSD (intentionally)
does not have a way to access the executable file of the current
process.

Closes #3717
2021-03-07 05:03:50 -07:00
Matthew Flatt
a3bf702ac9 cs & io: fix simplify-path for 'up relative to a root
Closes #3716
2021-03-06 09:37:10 -07:00
Matthew Flatt
07c7ff51ff repairs for NetBSD 2021-03-06 09:37:10 -07:00
xxyzz
d03456b55e
Skip keywords in invalid-option-placement (#3621)
Close #3603

* skip keywords in invalid-option-placement
* replace check-duplicate with check-duplicates
* add skip keywords test
* add require and fix syntax-e error
* update comment of invalid-option-placement
* add mixture keywords and arguments test
* forget to skip keyword in loop
* and another two tests for syntax-parse
* define splicing-formals-no-rest as @Metaxal suggested
* add formals link
* rename splicing-formals-no-rest to formals-no-rest
* add attributes to formals
* remove racket/dict import
2021-03-06 00:55:52 +01:00
Matthew Flatt
076426e796 unbreak unzip
Commit 71b7f21fdb changed the scope of a shadowing binding.
2021-03-03 09:29:10 -07:00
Matthew Flatt
a5b61f7ac8 unzip: add option to insist on a zip archive
The fact that a non-zip archive has always been silently ignored seems
bad, but adding an error might break code that (probably accidentally)
relies on the behavior. This change makes sane behavior at least
available by adding a `#:must-unzip?` option.

Relevant to #3613
2021-03-03 09:07:06 -07:00
Matthew Flatt
71b7f21fdb unzip: avoid blocking on break exception
The `dynamic-wind` that causes problems dos not appear to be needed.

Closes #3703
2021-03-03 08:20:41 -07:00
Matthew Flatt
1e56ca9cc1 treat uname result as locale encoding instead of UTF-8 2021-03-03 07:06:07 -07:00
Philip McGrath
261d73abdb racket/src/cs/c/Makefile.in: use $(SHELL) rather than hard-coded /bin/sh
This change facilitates building in environments where `/bin/sh` is not
available, such as Nix and GNU Guix.
The GNU Autoconf manual lists several additional systems where `/bin/sh`
is either missing or not POSIX-compliant:
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.70/html_node/The-Make-Macro-SHELL.html

Related to https://github.com/racket/racket/issues/3707
2021-03-03 07:04:51 -07:00
Philip McGrath
fdb2ad7892 Chez Scheme: avoid hard-coded paths for utilities in build scripts
These changes facilitate building Chez Scheme in environments where
utility commands are not available at their usual absolute paths,
such as Nix and GNU Guix.

Specific changes:
  - `cc` -> `$(CC)`
  - `/bin/rm` -> `rm`
  - `/bin/ln` -> `ln`
  - `/bin/cp` -> `cp`
  - `/bin/echo` -> `echo`
  - in `makefiles/installsh`, add a case to find `true`
    at an unusual path or as a shell builtin

Related to https://github.com/racket/racket/issues/3707
2021-03-03 07:04:51 -07:00
Matthew Flatt
5114fec2c7 file/resource: support REG_EXPAND_SZ
Also, provide workarounds for some broken conversions --- especially
the 'string/utf-16 conversion for reading. For writing, allow
specifying raw bytes that end up in REG_SZ or REG_EXPAND_SZ via
'bytes/string or 'bytes/expand-string.
2021-03-03 06:41:16 -07:00
Matthew Flatt
e615294e78 change (system-type 'machine) to use C-library uname
Thanks to @LiberalArtist for pointer out that uname(3) exists!

Related to #3707
2021-03-02 17:33:27 -07:00
Matthew Flatt
afe522ab9c find-executable-path: avoid conversion of PATH to string
Send bytes directly to `path-list-string->path-list`, since it can
handle bytes and convert directly to paths. Also check that the
argument to `path-list-string->path-list` has no nul character or byte.
2021-03-02 15:51:53 -07:00
Gustavo Massaccesi
421dce228d Chez Scheme: add maybe predicates to cptypes
Actually, use a more general decomposition with a part for an
$immediate, a part for a $record and a third part for other types
like string?, vector?, ...

This is not as general as an arbitrary union, but it is enough for
the common cases, and also to handles the common objects in Racket
that are implemented in CS as the corresponding object and a record
for the impersonator.
2021-02-28 17:05:20 -03:00
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
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
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
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
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
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
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
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
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
Matthew Flatt
3e2245d40e rktio: unbreak for Windows 2021-02-11 17:39:07 -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
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
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
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
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
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
Matthew Flatt
24f539087f ffi/unsafe/schedler: add unsafe-make-signal-received 2021-01-29 11:09:22 -07:00
Matthew Flatt
f685a27b41 cs & thread: add missing check on thread-suspend
Also, fix non-atomic check for shut-down custodian in `thread-resume`.

Closes #3660
2021-01-29 07:05:58 -07:00
Matthew Flatt
b55f268510 cs: fix list-{ref,tail} error messages
Closes #3661
2021-01-29 07:05:47 -07:00
shuhung
a7fef69f33
cs: print extra ellipses if the context is truncated 2021-01-29 05:36:43 -07:00
Matthew Flatt
1fea5f8e3f cs: don't display via prop:exn:srclocs when context length is 0
It's not clear that supressing source locations with the context
length is set to 0 is the right choie, but it's consistent with BC.
2021-01-27 14:47:58 -07:00
Gustavo Massaccesi
0ff8d18be5 cs: reimplement the predicate lattice in cptypes
Clean up the implementation. For example predicate-union was
calling predicate-implies? like 20 times. With the new
implementation this can be done in a single pass.

Also, this changes the results of the functions for 'bottom and
#f so they behave like sets. So this removes some special cases
and makes the functions more consistent.
2021-01-27 15:47:35 -03:00
Ryan Culpepper
ad6bbe9809 db: add option to run query in separate OS thread 2021-01-27 14:58:18 +01:00
Matthew Flatt
e110b07cc8 racket/fasl: use current-directory for relative-path unmarshaling
Relative-path handling for `fasl->s-exp` was meant to be like code
unmarshaling, but it did not fall back to `(current-directory)` when
`(current-load-relative-directory)` is #f. There's some risk to
changing the behavior of `fasl->s-exp`, but better matching the intent
seems at least as likely to fix problems as create them. One problem
it fixes is in CS code marshaling.

Closes racket/drracket#421 (again)
2021-01-26 11:29:43 -07:00
Matthew Flatt
91060487ca sync pre-built files
Needed a rebuild after changes to avoid naming via keyword arguments.
2021-01-26 11:29:43 -07:00
Matthew Flatt
18954fdc70 Chez Scheme: fix compilation problems for MinGW 2021-01-26 05:59:03 -07:00
Alexis King
c54ab626f7 Ensure block does not evaluate define-syntaxes RHSs multiple times
As described in #3635, there isn’t currently any good way to use
first-class definition contexts without evaluating define-syntaxes RHSs
multiple times. For macros like `class` and `unit`, it’s unclear if that
can be avoided, but for `block`, the first-class definition context
turns out to not be necessary.

This commit changes the implementation strategy used by `block` to a
trampolining macro rather than a first-class definition context. This
has the nice side-effect of avoiding the issue described in #3198, too.
2021-01-25 15:51:53 -06:00
shhyou
7894e97fd2 Stop keyworded functions from changing args' name 2021-01-25 06:55:31 -07:00
yjqww6
ef165fedda cs: add pariah for slow path of define-inline 2021-01-25 06:52:10 -07:00
Bogdan Popa
dcb7257d3f cs,alloc: close off sweep_next chain along with thread local segment 2021-01-25 06:51:18 -07:00
Matthew Flatt
87bf20c581 Windows: turn on string pooling for CS executables
Visual Studio 2015 duplicates the "Replace me for EXE hack" string in
the GRacket executable, which breaks the hack. Adding the /GF compiler
flag counteracts that duplication, and it's consistent with
`<StringPooling>true</StringPooling>` in the BC projects.
2021-01-23 16:04:40 -07:00
Matthew Flatt
442d7d2d00 Chez Scheme: repair for reify-cc register saving on arm32
This repair is simpler approach than the original, and it makes the
manual register allocation a little less fragile.
2021-01-23 10:46:01 -07:00
Matthew Flatt
00ce8904c7 repair prop:exn:srcloc handling
For CS, the default error display handler was not using `prop:exn:srcloc`.

For BC, a bad `prop:exn:srcloc` that returned a value other than a
list of srclocs coudl cause a crash.

Related to #3645
2021-01-23 09:33:48 -07:00
Bogdan Popa
3baed0966d build: fix make install for cross builds
W/o this change, some targets (like `copytree-run`) fail because they
try to run the target Racket executable instead of the host.
2021-01-23 06:42:00 -07:00
Matthew Flatt
c084ead2f3 Chez Scheme: fix continuation-attachments compilation
On AArch{32,64}, compiling `call-setting-continuation-attachment` in a
non-tail position could run out of registers for saving/restoring
around th intrinsic to reify the continuation.

Closes #3646
2021-01-23 06:35:48 -07:00
Matthew Flatt
be42b9a24a Chez Scheme: always disable X11 support on Mac OS 2021-01-22 09:35:59 -07:00
Matthew Flatt
9c8d7b3ebf bump version for Chez Scheme sync
After pulling in patches that change the Chez Scheme version to 9.5.5
(with not much changing besides the version, since we've pulled other
patches), update the Racket version number to reflect the change to
compiled files.
2021-01-22 08:47:16 -07:00
Bob Burger
53dcd3c439 update release notes 2021-01-22 08:36:06 -07:00
dyb
2613740431 9.5.5 changes: - updated version to 9.5.5 BUILDING NOTICE makefiles/Mf-install.in scheme.1.in c/Makefile.a6nt c/Makefile.i3nt c/Makefile.ta6nt c/Makefile.ti3nt mats/Mf-a6nt mats/Mf-i3nt mats/Mf-ta6nt mats/Mf-ti3nt workarea c/scheme.rc s/cmacros.ss release_notes/release_notes.stex csug/copyright.stex csug/csug.stex bintar/Makefile rpm/Makefile pkg/Makefile wininstall/Makefile wininstall/a6nt.wxs wininstall/i3nt.wxs wininstall/ta6nt.wxs wininstall/ti3nt.wxs - newrelease no longer logs as updated files with no actual changes newrelease 2021-01-22 08:36:03 -07:00
dyb
6c1d6b49dc updated version to 9.5.4 BUILDING NOTICE makefiles/Mf-install.in makefiles/Makefile-csug.in scheme.1.in c/Makefile.a6nt c/Makefile.i3nt c/Makefile.ta6nt c/Makefile.ti3nt mats/Mf-a6nt mats/Mf-i3nt mats/Mf-ta6nt mats/Mf-ti3nt workarea c/scheme.rc s/7.ss s/cmacros.ss release_notes/release_notes.stex csug/copyright.stex csug/csug.stex bintar/Makefile rpm/Makefile pkg/Makefile wininstall/Makefile wininstall/a6nt.wxs wininstall/i3nt.wxs wininstall/ta6nt.wxs wininstall/ti3nt.wxs 2021-01-22 08:35:47 -07:00
dyb
aa2208eb04 fixed S_condition_wait Y2038 bug; rounding ns to ms on Windows - now using 64-bit arithmetic for seconds in S_condition_wait to prevent a potential 2038 bug, at least on platforms where time_t is 64 bits. also now rounding rather than truncating nanoseconds in the coversion to milliseconds on Windows. thread.c 2021-01-22 08:35:37 -07:00
Matthew Flatt
13ee990165 rktboot: adjust for newer nanopass 2021-01-22 08:35:29 -07:00
dyb
416a6790c3 added textual-output-port checks for record-writer write argument print.ss, record.ms, root-experr* 2021-01-22 08:35:20 -07:00
Jarhmander
14a685af77 use Unicode for Windows error messages (#521) 2021-01-22 08:35:09 -07:00
Jarhmander
f74a9dea56 use lowercase winbase.h for Windows (#520) 2021-01-22 08:35:02 -07:00