Commit Graph

6065 Commits

Author SHA1 Message Date
Matthew Flatt
13ee90da4d cs & io: fix comparison of paths with different conventions 2021-05-12 18:05:10 -06:00
Matthew Flatt
2ac7e21ad4 change collection-links format to avoid paths as strings
Converting between strings and paths interferes with cross
compilation. This hasn't caused more problems only because cross
compilation has tended to run on Unix platforms, where the generated
paths are acceptable to Windows. But using strings goes wrong when
manipulating a Windows-based build for further cross-build actions on
Unix, and it can go wrong if paths contain bytes that cannot be
encoded in strings.
2021-05-12 15:24:04 -06:00
Cameron Moy
a7ddec9573 Support pattern matching of stream and stream* 2021-05-12 16:47:05 -04:00
Matthew Flatt
8b4b6cfaec fix some -1 exit codes
On Windows, exit(-1) counts as success instead of failure.
2021-05-11 16:51:04 -06:00
Matthew Flatt
391b5579f4 raco exe: fix default compiler for cross mode
The compiler for an embedding executable, as opposed to a separate
bundle file, didn't adapt to cross-multi mode.
2021-05-11 16:20:22 -06:00
Matthew Flatt
6e50aa088b expander: fix eval of machine-independent top-level begin 2021-05-11 16:20:22 -06:00
Matthew Flatt
274eb82deb Chez Scheme: sync test expected errors 2021-05-11 04:19:59 -06:00
Matthew Flatt
7c27ef2ab0 Chez Scheme: fix check on reference displacement
There is no danger of a displcement going off the end of an allocaiton
page, but the reason is a little more subtle for a 32-bit platform.
2021-05-10 18:08:55 -06:00
Matthew Flatt
73a61e4d37 rescind ffi/unsafe/string-list
The `ffi/unsafe/string-list` library is not needed now that `(_list i
_string)` and similar work. This way, existing code that uses `(_list
i _string)`, `(_vector i _string)`, etc., does not needed to be
modified to work with CS.

We don't usually remove libraries, of course, but this one has only
existed for a few days, and it was made to work around a problem that
has been solved in a better way.

Related to #3825
2021-05-10 11:54:21 -06:00
Matthew Flatt
87196e0144 Chez Scheme: add support for nonatomic foreign arrays
A reference bytevector holds a mixture of addresses within GCable
objects and foreign addresses, where "address" corresponds to the
payload of a bytevector or flvector object. The GC knows to apply a
suitable offset to the reference, so that object counts as reachable
from a reference bytevector, and the reference bytevector is updated
if the object is relocated during a collection.

With this change, the restriction in Racket CS against passing
non-atomic memory to a foreign function can be lifted. For example,
`(_list i _string)` can be useful as the type of a foreign-call
argument.

Making reference bytevectors a subtype of bytevectors is not an
obvious choice, given that writing to a reference bytevector with
byte-level operations can easily corrupt it. But this choice makes
various things simpler and easier.
2021-05-10 11:16:03 -06:00
Matthew Flatt
d14c454096 fix printing of prefabs with print-unreadable is #f
Closes #3827
2021-05-08 09:57:14 -06:00
Matthew Flatt
bb462baf30 cs: link Unix variants of racket with exported symbols
I'm not sure this is a good idea, but it doesn't apear to be a
particularly bad idea. Exporting symbols just makes the executable
size slightly larger.

Closes #3617
2021-05-08 09:32:37 -06:00
Matthew Flatt
98cf4151a9 adjust ffi/unsafe/com to use ffi/unsafe/string-list
The one-off `_ptr-to-string/utf-16` can be `_string-list/utf-16`.
2021-05-08 09:20:30 -06:00
Matthew Flatt
36195c71f6 add ffi/unsafe/string-list
Passing an array of strings or byte strings to a foreign function can
be especially tedious on Racket CS, due to the prohibition against
passing an array of GCable pointers to a foreign function.

Closes #3825
2021-05-08 09:20:30 -06:00
Matthew Flatt
c42d64cdbc cs: fix some UTF-16 and UCS-4 conversions 2021-05-08 09:20:30 -06:00
Matthew Flatt
f35a92744d cs: fix checking for a non-atomic argument to a foreign call
In CS, a pointer to non-atomic memory cannot usefully be passed to a
foreign function. The general foreign-call path checked for that kind
of argument and raised an exception, but the check was missing from
the common-case fast path, so a meaningless argument would be quietly
passed to the foreign function.

Related to #3825
2021-05-08 09:20:30 -06:00
Dale Vaillancourt
c35a843e71 use unaccented e in eof/length 2021-05-07 17:03:13 -06:00
Sam Tobin-Hochstadt
50a2cb32cb Initial implementation of 3x3 and 4x4 Toom-Cook multiplication.
This speeds up `(factorial 1000000)` (using factorial from math/number-theory)
by about 3x, and the conversion of the result to a string by about 2x.

Benchmark:

    #lang racket
    (require math/number-theory)
    (define n (time (factorial 1000000)))
    (define s (time (number->string n)))
    (string-length s)

Current Racket CS:
cpu time: 19135 real time: 19137 gc time: 372
cpu time: 33416 real time: 33418 gc time: 463

Current Racket BC (GMP is really fast):
cpu time: 1465 real time: 1465 gc time: 51
cpu time: 3661 real time: 3659 gc time: 3

This PR:
cpu time: 6173 real time: 6172 gc time: 168
cpu time: 17846 real time: 17847 gc time: 377

Cutoff between Karatsuba and Toom3 estimated by mflatt.
Cutoff between Toom3 & Toom4 guessed.
2021-05-07 10:27:09 -04:00
Matthew Flatt
b126dc3893 cs and ffi/unsafe/com: repair com-invoke for method without type
The argument type `(_ptr i _string/utf-16)` is not used on CS, because
a pointer to non-atomic memory cannot usefully be passed to a foreign
function from Racket CS.

Closes #3820
2021-05-06 20:20:46 -06:00
Matthew Flatt
b04b0fe3e1 file/[un]tar: add support for [un]packing without using the filesystem
Closes #2549
2021-05-06 18:56:58 -06:00
Matthew Flatt
486ab09587 struct-impersonator: make method-style prop:procedure receive impersonated
When a struct is called as a procedure and the struct is
impersonators, make a method-style `prop:procedure` receive the
impersonated structure as its argument. This change makes a
method-style `prop:procedure` more consistent with a field-index
`prop:procedure. The old behavior, meanwhile, seems to create an
unsoundness in Typed Racket.

Closes #2574
2021-05-06 16:27:35 -06:00
Matthew Flatt
30426fff9d Chec Scheme: better error when W+X page allocation fails
Closes #3819
2021-05-06 10:59:55 -06:00
Matthew Flatt
e368f9e22b Chez Scheme: special case for / on 1 or -1 and an exact rational
Related to #3816, but Sam already has better changes on the way.
2021-05-06 09:29:10 -06:00
Matthew Flatt
1ad3b05213 cs: fix ->fl and fl->exact-integer to match intended constraints
Fix `->fl` to work only on exact integers, and fix `fl->exact-integer`
to work only on integer flonums.
2021-05-06 07:26:48 -06:00
Matthew Flatt
180983fb4b cs: fix encuoraged and cross-module inlining of set!
When an inlined `set!` mutates a variable that's bound in the inlined
function, the `set!` target was not updated to refer to the inlined
binding.

Closes #3817
2021-05-06 07:02:22 -06:00
Bogdan Popa
849d66adaa compiler/embed: strip submod from d-r-p paths
Closes #2536
2021-05-06 06:17:13 -06:00
Matthew Flatt
9410a90a8b define-inline: better handling of misapplication
When a function from `define-inline` is applied to the wrong number of
arguments or the wrong keyword arguments, then leave it as a runtime
error (with a compile-time warning) instead of a badly reported
compile-time error.

Closes #3402
2021-05-05 20:20:04 -06:00
Matthew Flatt
808ea5f303 syntax-location->string: "<line>:<col>" instead of "<line>.<col>"
related to #3492
2021-05-05 17:41:28 -06:00
Matthew Flatt
1558e0bde4 pretty-print: fix 'unquote in mpair and vectors
Fix misinterpretation of `'unquote` within an `mcons` or `vector`
construction in expression-printing mode.

Closes #3652
2021-05-05 17:10:35 -06:00
Matthew Flatt
fc955b99f3 quasisyntax: recognize unsyntax in a box
This is a backward-incompatible change, but I think it's unlikely that
any code intentionally uses `unsyntax` or `unsyntax-splicing` within a
syntax-quoted box and expects it to stay literal.

Meanwhile, as @rocketnia noted, the documentation for `quasiquote` was
unclear about the espacing positions for `unquote` and
`unquote-splicing`, so this commit impoves that documentation. It
adjusts the documentation for `quasisyntax` to note that a hash table
value position is not an escape position, unlike for `quasiquote`.
(The lack of an escape position within hash tables is consistent with
`syntax`. That's arguably inconsistent with `quasiquote`, but it seems
simpler to leave that alone, and changing `syntax` just might matter
for existing code.)

Closes #3656
2021-05-05 16:46:37 -06:00
Matthew Flatt
f5306039cb repair a test 2021-05-05 07:18:16 -06:00
Matthew Flatt
d12f1f55ad x86_64: sign-extend signed integers pass as foreign call arguments
I can't see where the ABI pins this down for x86_64, but the default
compiler on Mac OS seems to have started caring that 1-byte and 2-byte
integer arguments are sign-extended in registers. The previous lack of
sign extension would affect only small-structure arguments.
2021-05-04 19:45:29 -06:00
Matthew Flatt
bee9c46e0d Chez Scheme: repair and update bullyx tests 2021-05-04 17:16:42 -06:00
Matthew Flatt
e899b519e3 Chez Scheme: more documentation how tests work
Also, make some adjustments to "Mf-base" so that plain `make`
generates a summary file as before and so that output files are linked
in a way that lets `make root-experr` and `make patches` find them.
2021-05-04 15:01:50 -06:00
Jamie Taylor
88cb6aae10 run mats configurations in parallel
* refactor mats to allow different configurations to run in parallel.

The {partial,all,bully}x targets now support being run in parallel should
make decide to do so (e.g., via the -j flag)

* fix mats ignoring "rmg" parameter

* Update travis-ci build scripts to use new partialx target and run multiple
jobs in parallel, based on the number of processors available.

* Add a way to only run particular machines in travis-ci by including
a line that starts with "travis:only:" and lists the machine types in the
commit message.
2021-05-04 15:01:50 -06:00
Jarhmander
68d8c8acc2 add alternative (R7RS) spelling of booleans (#563) 2021-05-04 15:01:50 -06:00
Jarhmander
da2a9969ef Mention an up-to-date crt.dll for Windows (#564) 2021-05-04 15:01:50 -06:00
Matthew Flatt
d777cd28d7 fix contract checks for number <-> representation bytes
... especially for CS, but there's also one BC correction.

Reported in tweet by KenHatesSoftwar.
2021-05-03 20:08:15 -06:00
Matthew Flatt
9c60382461 info.rkt: allow regexps in compile-omit-paths
Closes #1400
2021-05-03 16:38:37 -06:00
Matthew Flatt
c663d13fab cs: sync schemified
Rebuild schemified files to take advantage of correction for unsafe
`fxlshift` and `fxrshift`.
2021-05-03 10:18:21 -06:00
Matthew Flatt
ef43f26f62 net/base64: speed up encoding and decoding, especially on byte strings
Base64 encoding and decoding are common and simple enough to
specialize for byte strings, where they can be much faster.
2021-05-03 07:47:50 -06:00
Matthew Flatt
d20292b80c cs: fix fx{lr}shift conversion for (#%declare #:unsafe) 2021-05-03 07:33:05 -06:00
Matthew Flatt
9d53990e18 net/base64: faster encode
Make encoding almost twice as fast by treating input chunks of 3 that
turn into output chunks of 4.
2021-05-03 07:33:05 -06:00
Matthew Flatt
7179df6009 configure: improve platform detection and reporting 2021-05-03 07:33:05 -06:00
Bogdan Popa
0c8e3765f2 cs,thread: fix thread-receive-evt retry proc
Fixes #3813
2021-05-03 07:32:53 -06:00
Matthew Flatt
d9c128fe65 add namespace-call-with-registry-lock
Lazy require benefits from using a lock on a namespace registry for
much the same reason as on-demand instantiation of ready modules. Make
lazy require use the lock that's alerady in place for on-demand
instantiation, and expose `namespace-call-with-registry-lock` for
other potential uses.

Thanks to @m4burns for tracking down the problem and its solution.

Related to #3805
2021-05-02 12:10:30 -06:00
Matthew Flatt
406dcc9ff3 Chez Scheme: make pb build accomocate WRITE_XOR_EXECUTE_CODE
Although W^X is useless to pb, allowing it to build with
`-DWRITE_XOR_EXECUTE_CODE` can be helpful.
2021-05-01 09:26:59 -06:00
Matthew Flatt
1f0223fef1 Chez Scheme: repair to W^X mode
Fix single-segment flipping to accomodate write regions that span
segments.
2021-05-01 08:58:47 -06:00
Matthew Flatt
8ea5b58393 cs: add configuration for {Free,Open,Net}BSD on {ARMv6,AArch64,PowerPC}
It's not clear how many of these combinations work right now, but they
should be close, and the intent is that they're supported. I
succcessfully built for FreeBSD on AArch64 and Chez Scheme for NetBSD
on PowerPC32.
2021-05-01 06:57:32 -06:00
Matthew Flatt
c0af3a253b Chez Scheme: fix fence preproceddore conditional for AArch64
The memory-fence macros were not being used on non-Apple AArch64.
2021-04-30 12:22:12 -06:00
Matthew Flatt
b058be9bfc Chez Scheme: clean up "Mf-<unix>" and "<unix>.def"
Replace lots of mostly-duplicated "Mf-<platform>" and "<platform>.def"
files with just a few "Mf-unix" and and "unix.def" files plus
configuration within "configure" and "workarea". Also change
"version.h" to infer more OS details (as was used for pb, anyway).
This change simplifies setting up configurations for different
platforms, and it makes it easier to share among similar
configurations.
2021-04-30 09:08:14 -06:00
Matthew Flatt
0eeb8d26f3 net/url: trim whitespace when getting enviornment variables like http_proxy
For compatibility with other systems, trmi whitespace from environment
variables.

Closes #2663
2021-04-29 11:33:03 -06:00
Matthew Flatt
6f1875c384 bc: fix interaction of prop:object-name and prop:procedure
Document the fact that `prop:object-name` takes precedence for the
`object-name` result, and make printing also use `object-name` instead
of the propcedure's name when they're differet.

Also, repair constructor-style printing of a transparent structure
type that has `prop:object-name`.

Closes #2585
2021-04-29 11:23:15 -06:00
Matthew Flatt
5ae19c56e1 fix submodule loading when a ".zo" file is referenced directly
The default load/use-compiled handler was not consistent with the
default load handler in the treatment of submodules from module files.

Closes #2363
2021-04-29 10:05:11 -06:00
Matthew Flatt
ed115af6b2 windows makefile: fix liblz4.dll linking
Link "liblz4.dll" with the right LZ4 library for /MT mode. It looks
like VS 2017 links anyway, but VS 2015 (and probably earlier) does not
link with the wrong library.

In a normal build, "liblz4.dll" is not needed, but it's linked in case
it turns out to be useful to compress or decompress boot files. A
normal build will construct boot files with the intended final
compression, at least when all the right flags are passed around to
the right places.
2021-04-29 10:05:02 -06:00
Matthew Flatt
a1452ab399 configure: add -lrt for BC on Linux
Linking with `-lrt` is needed for `clock_gettime` on older Linux
distributions.
2021-04-29 08:24:07 -06:00
Matthew Flatt
cfa10d5f30 fix typo in in-value change
Thanks to @yjqww6
2021-04-28 20:29:46 -06:00
Matthew Flatt
bd94ac6b27 fix impersonator-prop:application-mark for keyword arguments
Closes #1836
2021-04-28 17:51:05 -06:00
Matthew Flatt
387f5dc3ba add current-inexact-monotonic-milliseconds
Closes #1826
2021-04-28 17:29:38 -06:00
Matthew Flatt
4eed365e1f class: fix name-conflict checking with local names
Closes #1819
2021-04-28 16:20:08 -06:00
Matthew Flatt
3e9a8ccf59 mixin: fix error-message construction
Closes #1693
2021-04-28 14:30:31 -06:00
Matthew Flatt
94725ffb4e in-value: fix inlined binding
The inlined version of `in-value` in a `for` form did not bind the
left-hand identifier at the right layer relative to other bindings in
`for/fold`, which caused the inlined `in-value` to behave differently
than a non-inlined `in-value`. Confusing about this `in-value`, in
turn, had led to incorrect documentation on `for/fold`.

It would be nice to clean up a little more of the evaluator and
availability of bindings in `for/fold`, but doing so runs a
significant risk of breaking existing code (unlike fixing `in-value`,
which behaved even worse and where the repair seems less likely to
break existing programs).

Closes #1659 (again)
2021-04-28 14:19:50 -06:00
Matthew Flatt
09480c86e8 open-output-file et al.: add #:permissions argument
Add a `#:permissions` optional argument that is a permissions integer
in the same style as `file-or-directory-permissions` and that is used
when a file is created. On Unix, the given permissions are combined
with the process's umask.

Closes #1654
2021-04-28 13:58:12 -06:00
Matthew Flatt
bff31f0768 expander: allow syntax-local-lift-require during #%module-begin expansion
Making `syntax-local-lift-require` during `#%module-begin` expansion
provides a solution to a long-standing problem with composing
languages via `#%module-begin`, where the bindings of some lanuage
should be made available for expanding the module body by
`#%module-begin` expansion (i.e., the language is *not* the initial
import). If the language does not support `require`, then there was no
way to expand and expose the language import dependency.

Closes #1352
2021-04-28 08:30:20 -06:00
Matthew Flatt
f4ccd0fdc6 expander: correct some namespace-mismatch error formats
Related to #1352
2021-04-28 07:13:06 -06:00
Matthew Flatt
8cea33baa1 racket/unitsig: fix location on indirect reference
Set the source location of a function call that implements an indirect
import to be the original identifier, so a use-before-definition error
has the right location.

Closes #1324
2021-04-28 07:13:06 -06:00
Matthew Flatt
bf4fb553b3 raise-syntax-error: accomodate cyclic S-expressions
Closes #1016
2021-04-28 07:13:06 -06:00
Matthew Flatt
613e142447 typo in comment 2021-04-28 07:13:06 -06:00
plan-do-break-fix
0cdede88c3 Chez Scheme: corrects typos in project documentation 2021-04-27 19:43:22 -03:00
Matthew Flatt
6e3a94b6ac openssl: fix waiting on input or output
As noted by @rmculpepper, using an underlying input port as an evt to
indicate more SSL input is not right if data can be pumped from the
underlying input port meanwhile. This commit uses progress evts (real
or synthesized) to avoid that problem.

[The commit include more whitespace changes than I'd normally like,
but it seems like some past tabify went wrong.]

Closes #3804
2021-04-27 12:50:07 -06:00
Matthew Flatt
2f9cd5446b cs: auto-flush stdout/stderr only when terminals
Match BC's long-standing behavior of only flushing the original output
and error ports on input from the original input port when the output
and/or error port is a terminal port.
2021-04-27 11:55:59 -06:00
Matthew Flatt
a385788971 cs: make flush-output error if port is closed
Closes #3803
2021-04-27 09:23:32 -06:00
Matthew Flatt
9ae6d66449 bc: fix sync when a guard-evt turns into choice-evt late
During the time that the procedure in a guard-evt is called by `sync`,
it's possible for the `sync` evt choice to become determined. If the
guard-evt procedure then returns a choice-evt, the BC implementation
of `sync` could lose track of the selected evt; the selection is
represented by an index, and choice-evt splicing can shift indices.

Possibly related to #3004
2021-04-27 08:39:40 -06:00
Matthew Flatt
f4a9058941 stream-{ref,tail,take}: avoid retaining stream for potential error
Although retaining the original stream argument to `stream-ref`,
`stream-tail`, or `stream-take` can enable a better error message if
the stream runs out of elements too soon, it can also interfere with
the intended memory use of a stream.

Closes #2870
2021-04-26 20:03:55 -06:00
Matthew Flatt
a2d724fff6 security-guard-check-network: fix contract
CS was correct, but BC and the documentation were too strict.

Closes #1763
2021-04-26 18:14:00 -06:00
Matthew Flatt
5b66a2e590 racket/rerequire: fix submodule handling
Closes #971
2021-04-26 16:32:08 -06:00
Matthew Flatt
60129ffaca native libs: add CG-with-clipping patch to Cairo
This patch is useful for emoji support on Mac OS.
2021-04-26 16:32:08 -06:00
shhyou
0cff2f6caf ->[*]: Put srcloc on the outermost syntax object 2021-04-26 09:06:41 -05:00
John Clements
b1f84fa60d typo, insert 'to' 2021-04-25 17:16:37 -07:00
Greg Hendershott
b72c11f08b Supply original stx to make-import
Although commit 5b0f0cee23 was sufficient to make `rename-in` expand
to `rename` with srcloc for the original name, it turns out it did not
address a similar issue with `only-in` renaming.

Do so by supplying the original (not renamed) identifier syntax as the
`orig-stx` for `make-import`.
2021-04-23 09:46:09 -06:00
Matthew Flatt
af40cdb7e7 repair struct with same #:name and #:constructor-name identifier
Closes #3791
2021-04-21 11:20:36 -06:00
Matthew Flatt
725a7e353c cs: avoid crash on startup if the working directory does not exist
Closes #3793
2021-04-21 11:07:59 -06:00
Bob Burger
c6608d78d3 Chez Scheme: maybe-compile-program now returns void 2021-04-21 07:54:17 -06:00
Jamie Taylor
17bc9b2b33 Chez Scheme: fix mat that failed in bullyx with cmg=1 2021-04-21 07:53:18 -06:00
Jamie Taylor
b090edbe9d Chez Scheme: update docs on ftype pointer types in foreign-procedure
Now specifies that the ftype pointer parameter types - `(* ftype)` and
`(& ftype)` - actually require an `ftype-name` (i.e., the syntax
requires an identifier in that position). This clarifies the problem
encountered in issue cisco/ChezScheme#557 (although further examples
would be helpful, of course).
2021-04-21 07:52:52 -06:00
Jamie Taylor
e97ae6522c Chez Scheme: add instructions for building docs
[The original commit has been adapted to revised "BUILDING" format.]
2021-04-21 07:52:52 -06:00
Bob Burger
70db865800 Chez Scheme: fix typo in get-process-id documentation 2021-04-21 07:27:12 -06:00
Amirouche
2e8da7ecb7 Chez Scheme: typofix 2021-04-21 07:26:31 -06:00
Philip McGrath
0ead209cc5 Chez Scheme: further adjust paths for utils in build scripts
As suggested by @akeep

Co-authored-by: Andy Keep <akeep@robotman.org>
2021-04-21 07:25:18 -06:00
Matthew Flatt
f383076784 Chez Scheme: repair bignum shift right
When a negative bignum is shifted right by a multiple of the bigint
bit size (which is 32), when a shifted-off bit is non-0, and when the
result would be a sequence of bigints with all 1 bits before rounding
to deal with the dropped bits, a carry that should have been delivered
to a new high bigint was dropped.

Closes #3794
2021-04-20 18:25:23 -06:00
Philip McGrath
cc0b1bafeb remove committed "racket.boot"
This file appears to have been checked in accidentally.
2021-04-18 10:16:15 -06:00
Robby Findler
9085ffe69b Update racket/collects/json/main.rkt
Co-authored-by: Sam Tobin-Hochstadt <samth0@gmail.com>
2021-04-16 16:15:02 -05:00
Robby Findler
7cae0adaa6 change json parser to be more strict about whitespace (matching the spec) 2021-04-16 16:15:02 -05:00
Robby Findler
fea6a0b9ae specialize or/c when its arguments are eq-contracts
This commit improves the performance of or/c contracts with symbols
(or other things that the contract system compares with eq?).

For example, on the program below we halve the distance to
just writing the contract directly as a predicate.

```
 #lang racket/base
(require racket/contract/base)

(define c1 (or/c 'x 'y (integer-in 1 24)))

(define (c2 x)
  (or (eq? x 'x) (eq? x 'y)
      (and (exact-integer? x)
           (<= 1 x 24))))

(define f1
  (contract (-> c1 any)
            (λ (x) x) 'pos 'neg))

(define f2
  (contract (-> c2 any)
            (λ (x) x) 'pos 'neg))

(define (try f)
  (time
   (for ([x (in-range 1000000)])
     (f 'x) (f 'y) (f 10) (f 'x) (f 'y) (f 10)
     (f 'x) (f 'y) (f 10) (f 'x) (f 'y) (f 10)
     (f 'x) (f 'y) (f 10) (f 'x) (f 'y) (f 10)
     (f 'x) (f 'y) (f 10) (f 'x) (f 'y) (f 10)
     (f 'x) (f 'y) (f 10) (f 'x) (f 'y) (f 10))))

(try f1)
(try f2)
```

with this commit:
cpu time: 849 real time: 850 gc time: 39
cpu time: 615 real time: 616 gc time: 2

without this commit:
cpu time: 1020 real time: 1021 gc time: 37
cpu time: 616 real time: 617 gc time: 2
2021-04-16 14:31:43 -05:00
K
df0c756f73
typographic rehash of --help output
The current output for `--help` is quite messy and hard to
navigate.

I added some indentation and spacing to make the document
easier to read. For example,

    File and expression options:

      -e <exprs>, --eval <exprs>
         Evaluate <exprs>, print results
      -f <file>, --load <file>
         Like -e '(load "<file>")' without printing

The new layout is longer, but at least it is readable. It
might be better if we could move all the options to a man
page and only select a few common ones to put in `--help`.
2021-04-16 08:25:31 -06:00
Sorawee Porncharoenwase
73381c3ad3 expander: another improvement to make-readtable's error message
Currently `(make-readtable #f #\a 'dispatch-macro)` produces the error
message

```
; make-readtable: expected procedure argument after symbol argument
;   given: 'dispatch-macro
```

which is very confusing, because it sounds like `'dispatch-macro` is
incorrect, but it is in fact correct already.

This PR adjusts the error message to:

```
; make-readtable: expected procedure argument after symbol argument
;   symbol: 'dispatch-macro
```

which is the convention that is already used when the mode argument is not given.
2021-04-16 08:22:43 -06:00
sorawee
bad18f5be6
expander: fix make-readtable's error message and doc 2021-04-15 12:33:23 -06:00
Greg Hendershott
5b0f0cee23 Use import-orig-stx instead of import-src-sym when appropriate
The equivalent, for imports, of commit 66a8436bc1 and PR #3758 for
exports.
2021-04-15 11:57:12 -06:00
Matthew Flatt
6d30ff78c1 ffi/unsafe/try-atomic: don't use callback during nested atomic
When a `try-atomic` thunk starts a more nested atomic region, don't
trigger the callback until the more nested atomic region ends.
2021-04-15 09:16:09 -06:00
Matthew Flatt
237d627583 bc: send stderr/stdout logging through rktio
One effect of using rktio instead of fwrite is that Windows output
produces LF instead of CRLF. Writing CRLF is arguably more correct,
but it likely doesn't matter, and consistency with normal Racket
output is helpful.
2021-04-14 17:23:19 -06:00