Commit Graph

40255 Commits

Author SHA1 Message Date
Matthew Flatt
5fb38fc246 cs: sync include path for {Free,Open}BSD 2019-06-21 21:12:17 -06:00
Matthew Flatt
e68269b357 makefile: avoid automatic "Makefile" rebuild 2019-06-21 19:46:39 -06:00
Matthew Flatt
90b79524aa revise build to avoid ld and nicear
The Chez Scheme build process now create an archive instead of linking
"kernel.o". Adjust the Racket CS build to use archives instead of
"kernel.o".

Also, modernize the Racket build's use of `ar`. Using the flags `rc` by
default (instead of `ruv`) should avoid the need for `nicear`.
2019-06-21 16:53:58 -06:00
Matthew Flatt
5c51096a88 cs: repair filesystem-change-evt
Correct an incomplete adaptation in a2a67a9660.
2019-06-21 13:35:33 -06:00
Matthew Flatt
f27924b8a7 extra math tests
Check repairs for some Racket CS differences that Vincent found
through random testing.

Related to #2708
2019-06-21 13:35:33 -06:00
Vincent St-Amour
77b48f1f2c Fix typo. 2019-06-21 12:32:37 -05:00
Matthew Flatt
c7f7170a3e avoid compiler warning 2019-06-21 09:50:32 -06:00
Matthew Flatt
6e70d8ec1d nicer nicear: suppress "modifier ignored" warning
If GUN ar is configured for deterministic mode by default, then

  ar: `u' modifier ignored since `D' is the default (see `U')

prints. Suppress that to avoid stderr output.
2019-06-21 09:49:11 -06:00
Matthew Flatt
c1bb341d2e skip test of non-embedded "embed-me37.rkt"
The module works as intended only when embedded with the right flags.
2019-06-21 09:30:14 -06:00
Matthew Flatt
db3b75eaf1 expander: add shadow filesystem for Windows in collection lookup
Checking for directories when searching for a collection can be
especially slow with the Windows filesystem, but Windows also supports
filesystem-change events. So, cache information about the existence of
paths, relying on filesystem-change events to detect with the cache is
out of date.

Related to racket/drracket#281
2019-06-21 09:27:12 -06:00
Matthew Flatt
a2a67a9660 filesystem-change-evt: fix use of failure thunk
Also, allow the failure thunk to be #f to get the default behavior.
2019-06-21 09:27:12 -06:00
Atharva Raykar
d6ffc5b820 Fix cosmetic error in code example (#2705)
* Fix cosmetic error in code example

* Improve code example
2019-06-21 09:28:21 -04:00
Matthew Flatt
ec5b45e4f8 cs: inline arithmetic-shift and other bitwise operations 2019-06-20 18:31:19 -06:00
Matthew Flatt
9083c6abb4 schemify: use unsafe box operation for lifted mutable variables 2019-06-20 18:30:55 -06:00
Matthew Flatt
bf692f572d cs: avoid indirection through Chez Scheme for raise 2019-06-20 14:37:03 -06:00
Matthew Flatt
3f35504355 thread: refactor scheduler poll-and-select loop
Further reduce redundant checks, and also avoid an excessive delay
after making the process sleep.
2019-06-20 14:36:43 -06:00
Matthew Flatt
6d3eff55a4 cs: repair for external signals
Like 2a1404f9a3, but for Ctl-C.
2019-06-20 12:14:48 -06:00
Matthew Flatt
35ff9137e7 cs: tweak return for call/ec and call-with-continuation-barrier
The prompt installed for an escape continuation or continuation
barrier is never used to delimit a captured continuation, so the
return from the continuatiton can be streamlined slightly.

The benefit is very small (but detectable in the macro expander's use
of barriers). There's an opportunity to use `call/1cc` instead of
`call/cc`, but that change does seem to help --- neither Chez Scheme's
current `call/1cc` nor the opportunistic variant of `call/cc` use to
implement continuation attachments.
2019-06-20 08:48:56 -06:00
Matthew Flatt
30393ae0fa cs: linear-time prompt check
Add cache for `continuation-prompt-available?` so it's amortized
constant time.
2019-06-20 08:48:56 -06:00
Ryan Culpepper
685d067361 syntax/parse: fix handling of ~seq with action patterns 2019-06-20 16:36:14 +02:00
Matthew Flatt
2a1404f9a3 cs & io: fix fd semaphore polling
Reducing external-event polling exposed a problem with fd semaphore
checking, where the check before sleeping didn't abandon the sleep if
an fd semaphore was posted.

Also, fix a bug with interrupted network address lookup.
2019-06-19 18:13:37 -06:00
Matthew Flatt
1ba4d76fe0 cs & thread: avoid excessive polling for external events
Reduce polling in the case that threads that block and swap rapidly,
in which case polling on every thread swap can be useless and
expensive.
2019-06-19 17:27:24 -06:00
Matthew Flatt
ba8d442e75 cs & thread: refactor and finish futures implementation
Complete the implementation of futures, fsemaphores, future logging,
and their cooperation with threads, places, and custodians.
2019-06-19 12:50:19 -06:00
Ryan Culpepper
eb4ec000b0 syntax/parse: use generic tree functions in analyses 2019-06-19 16:21:43 +02:00
Ryan Culpepper
4b64cdef54 syntax/parse: add multiple pattern-processing passes
- pair specialization
- and/ord normalization, and cleanup
- add pat:seq-end to list-pattern
2019-06-19 16:21:43 +02:00
Ryan Culpepper
29e46bea78 syntax/parse: add generic (dynamic) tree traversal library 2019-06-19 16:21:43 +02:00
Ryan Culpepper
e845d0861d syntax/parse: add explicit pattern checks 2019-06-19 16:21:43 +02:00
Ryan Culpepper
fa78f5ebd3 syntax/parse: add well-formed pattern predicates 2019-06-19 16:21:43 +02:00
Ryan Culpepper
769dfb9e34 syntax/parse: add hpat:single; {single,head}-pattern types disjoint 2019-06-19 16:21:43 +02:00
Ryan Culpepper
5ab82ccdd4 syntax/parse: code reorganization 2019-06-19 16:21:43 +02:00
Ryan Culpepper
1c01df60ce syntax/parse: use logging instead of conditional eprintf, show more patterns 2019-06-19 16:21:43 +02:00
Ryan Culpepper
39bacd45d5 syntax/parse: simplify head pattern compilation
The continuation expression for a head pattern evaluates to a
procedure that takes the rest of the term and the current progress.
2019-06-19 16:21:43 +02:00
Ryan Culpepper
6e46dd1b0d syntax/parse: fix saving of eh-alternatives
Avoid adding extra syntax wrapping. This doesn't matter for parsing,
but it does matter for pattern analyses.
2019-06-19 16:21:43 +02:00
Ryan Culpepper
4a7717679a syntax/parse: clean up insertion of default expressions in patterns 2019-06-19 16:21:43 +02:00
Ryan Culpepper
233c9b8f50 syntax/parse: fix abstract failure pattern analysis 2019-06-19 16:21:43 +02:00
Ryan Culpepper
bad4dd909d syntax/parse: delete dead make-dummy-stxclass 2019-06-19 16:21:43 +02:00
Ryan Culpepper
51d7060ff0 syntax/parse: add missing failure -> failure* 2019-06-19 16:21:43 +02:00
Ryan Culpepper
7fb0250191 syntax/parse: update comments 2019-06-19 16:21:43 +02:00
Ryan Culpepper
6577791664 syntax/parse: improve minimatch on structs, vectors; delete dead code 2019-06-19 16:21:43 +02:00
Stephen De Gabrielle
38ef00fca3 raco pkg new changed to create APACHE and MIT license files 2019-06-19 09:17:53 -04:00
Ryan Culpepper
527048c319 update expobs regression test for change in syntax expansion 2019-06-19 15:03:17 +02:00
Ryan Culpepper
4cb37a1d8a template: improve ASTs, use smart constructors
Improvements include:
- less scattered handling of constant templates
- better recognition of constant templates, like (1 (... 2)), where
  the template syntax is not identical to its value
- better code for (x ... ...), where x is trusted
2019-06-19 14:48:28 +02:00
Ryan Culpepper
2915657c27 template: parse ellipses using stack of map environments
This is like the psyntax approach but frames are mutable
and track extra information.
2019-06-19 14:48:28 +02:00
Ben Greenman
7b4e757fe5
typo: impersonate-hash, 'filter' -> 'replace' & 'a the'
- change high-level summary of `key-proc` to say it replaces
   keys rather than filters; this matches the wording further down
- 'a the' -> 'the'
2019-06-18 20:17:47 -04:00
Matthew Flatt
6184de2389 ffi: fix use of struct malloc mode for function results
Relevant to #2702
2019-06-17 15:32:14 -06:00
Matthew Flatt
1824fe5e41 io: add shortcut to get semaphore on blocking fd read
When reading from an input fd blocks, instead of creating a general
event that creates a semaphore, use the semaphore directly (when
available). Also, treat a semaphore internally as an event that
always produces 0.

This change speeds up the "echo" shootout benchmark.

This change speeds up the "echo" shootout benchmark.
2019-06-17 10:08:40 -06:00
Matthew Flatt
97e61b5f25 thread: avoid repeated polls while scanning available threads
Poll for external events just once before starting a search for an
available thread, instead of polling every iteration in the search.
2019-06-17 10:08:27 -06:00
Matthew Flatt
6d200e6143 cs: remove compile-as-independent? mode
This slower mode hasn't turned out to be needed, and since it hasn't
been used, it probably doesn't work anymore.
2019-06-17 09:10:39 -06:00
Matthew Flatt
9d55443e23 cs: force inline of applicable-struct support
When the schemify pass cannot determine that a call is to a primitive
procedure, it generates an `#%app` form that expands to

  ((extract-procedure rator) rand ...)

Force `extract-procedure` to be inlined (by making it a macro), so the
expansion is

  (let ([tmp rator])
    ((if (#%procedure? tmp) tmp (slow-extract-procedure tmp)) rand ...))

which is usefully faster in the common case that `rator` turns out to
be a primitive procedure.
2019-06-17 09:10:08 -06:00
Matthew Flatt
ae1bf1b9fc cs: lock-free eq-hash-code
Chez Scheme doesn't provide `eq-hash-code`, so it's implemented with a
weak `eq?`-based hash table that maps values to fixnums (except for
numbers, symbols, and characters). The table had a lock to support
concurrent use in multiple places, and that became a major source of
contention in parallel builds. Change the implementation to use a new
`eq-hashtable-try-atomic-cell` operation, which effectively moves
contention from the hash table to individual buckets (where it should
be much rarer).
2019-06-17 09:09:30 -06:00