Commit Graph

5118 Commits

Author SHA1 Message Date
Matthew Flatt
fe708871bd cs: avoid a leak due to prefab declarations 2019-05-26 11:56:25 -06:00
Matthew Flatt
f0c39b1f81 cs & threads: fix weak reference from custodian
Using a will executor to turn a reference from weak to strong still
seems like an ok idea, but it needs to be a regular will executor,
because a custodian-registered value is likely to involve have a
nested self-reference.
2019-05-25 18:31:15 -06:00
Matthew Flatt
e43bfd5767 cs: fix compression-conversion build step to support LZ4 2019-05-25 07:36:06 -06:00
Matthew Flatt
fb8368e373 cs: fix handling of non-typical make-struct-type forms
Some checks were missing to guard the transformation of a `struct`
expansion into a Chez Scheme `define-record-type` expansion.
2019-05-25 07:36:06 -06:00
Matthew Flatt
b33075f4c5 raco setup: fix target machine reporting 2019-05-25 07:36:06 -06:00
Matthew Flatt
3d3f1a408c get-lib-search-dirs: repair for cross-compile mode
More generally, repair the internal `exe-relative-path->complete-path`
function to work when the current directory is not the original
current directory and `racket` is started with a relative path.
Currently, it happens that `exe-relative-path->complete-path` is
called with a potentially different directory only by
`get-lib-search-dirs`.
2019-05-25 07:36:06 -06:00
Matthew Flatt
5896462e1a cs: uncompress boot files
When the compression format changed to LZ4, which is much faster to
decompress than zlib, the configure script changed to enable
compression by default. Bytecode tends to benefit all around from
compression, but the boot files take 20ms or so longer to load --- not
a lot of time when loading typical amounts of code, but a signficiant
cost for a minimal startup. This commit allows compression to be
controlled separately for boot files, and it configures them as
uncompressed by default.
2019-05-23 13:58:05 -06:00
Matthew Flatt
d9c8ef964c generate version string from individual numbers
Thanks to @sorawee for pointing me to
  https://stackoverflow.com/a/5459929/718349
2019-05-22 16:48:25 -06:00
Matthew Flatt
b219f92113 fix version number
Correct mistake in prvious commit.
2019-05-22 15:12:59 -06:00
Matthew Flatt
9178169370 bump version number
Syncing with the main Chez Scheme branch changes the header on
compressed bytecodes, so force recompilation of Racket CS ".zo"s.
2019-05-22 13:43:01 -06:00
Matthew Flatt
a23e0a3a57 cs: fix checking and arity of unsupported extfl functions 2019-05-22 10:36:42 -06:00
Matthew Flatt
ba0934521e cs: rewrite division-by-zero error message 2019-05-22 10:36:42 -06:00
Matthew Flatt
ceef969d48 cs: remove trailing space in error message 2019-05-22 08:37:22 -06:00
Matthew Flatt
55c8c12f2f planet: adapt to work with Racket CS overlay build 2019-05-22 08:30:41 -06:00
Matthew Flatt
0b74787419 cs: fix chaperone-of? for hash tables with nested chaperones 2019-05-22 08:30:20 -06:00
Paulo Matos
e2ab4869d7
Remove unnecessary MZ_USE_JIT (#2602)
* Remove irrelevant #ifdefs MZ_USE_JIT

Bonus points - fixes a compiler warning on aarch64 and a typo.

* Fixes a compiler warning on aarch64 for unused current_linklet_native_lambdas
2019-05-22 16:25:04 +02:00
Paulo Matos
ce76c673b1
Simplify conditionals after removing dead store of has_space (#2489)
* Simplify conditionals after removing dead store of has_space

The conditional simplification looks good to me. The biggest issue
here was to understand if when `pipe_quote` is true, we can and should
go to the else clause. Actually the more I look at it the more I think
this uncovers and earlier bug where if pipe_quote is true, result and
total_length are left at NULL and 0 respectively after the block.
2019-05-22 15:30:44 +02:00
Matthew Flatt
cd31b308af cs: sync error message for undefined identifier 2019-05-22 07:01:48 -06:00
Matthew Flatt
266c5eeb9b threads: fix for multiple threads with the same wakeup time 2019-05-21 13:57:42 -06:00
Matthew Flatt
7067ac8bfa cs: fix weak reference for GC-callback registration 2019-05-21 10:48:23 -06:00
Matthew Flatt
97672bb00c change datum->syntax treatment of code inspectors
Change `datum->syntax` so that it limits the transfer of a code
inspector from a source syntax object; the code inspector is kept only
if a macro is being expanded and the macro has the same code inspector
(or, more generally, the weaker of the two code inspectors is
preserved).

This change is a kind of defense-in-depth to prevent the use of
unarmed syntax with `datum->syntax` to access unexported bindings from
the module where a syntax object originates.

The general approach is Ryan's idea. This particular implementation is
a simplification of the general idea, and we'll see whether it's
worakble and sufficient.
2019-05-21 09:59:19 -06:00
Matthew Flatt
ed5bb40109 cs: implement compile-enforce-module-constants 2019-05-21 09:59:19 -06:00
Matthew Flatt
b268f77ae9 cs: fix vector-set! and set-box! impersonation
Use the result from an interposition to install into the vector or
box, instead of the original value.
2019-05-21 09:59:19 -06:00
Matthew Flatt
541a8e870f cs: fix struct constructor result for object-name 2019-05-20 06:48:08 -06:00
Matthew Flatt
55728352f4 schemify: optimize local struct declarations
Rewrite locally declared structure types to expose them to the
compiler in the same way as module-level declarations.
2019-05-20 06:48:08 -06:00
Paulo Matos
6e7920e204
Enable ubsan configure argument for CS (#2658)
* Refactor --enable-ubsan to m4 macro and include it from racket and cs
* Regenerate configure scripts
* upload ubsan artifacts even if it fails
2019-05-20 11:41:22 +02:00
Alexis King
18e897bfb8 expander extract: Improve purity analysis for struct type properties
The changes in aab63ad3 introduced a dependency on
racket/private/promise, which the analysis was not capable of dropping
due to the use of the `prop:force` property. This caused trouble for the
thread layer, since it introduced a reference to `error`, which is
defined in the io layer. This change adds some additional detection for
struct type properties with guards that accept procedures of particular
arities, which allows `prop:force` to be marked as pure.

Also, a typo in the thread layer’s Makefile meant globals weren’t
actually getting tracked, so this fixes that, too.
2019-05-19 10:48:04 -05:00
Alexis King
aab63ad31d Add for[*]/foldr[/derived] and reimplement for[*]/stream using it
`for/fold` is a left fold, which is normally what you want in a
call-by-value language such as Racket, but it makes efficient lazy
iteration difficult. This commit adds a new `for/foldr` iteration form
(along with `for*/` and `/derived` variants) that provides a right fold
operation that offers complete control over precisely how lazy the
iteration ought to be.

In simple microbenchmarks, reimplementing `for/stream` to use
`for/foldr` instead of `for` plus a generator can be almost 40x faster
on large streams.
2019-05-19 10:47:54 -05:00
Matthias Felleisen
52bde149f3 where to find the docs and the tests 2019-05-18 12:57:00 -04:00
Matthew Flatt
cc73ec8d69 reader: see new parameter values in read/recursive
When `read/recursive` is used, do not inherit parameter values
recorded by an enclosing `read`, and instead look them up again.
This change restores behavior of the old reader.

Closes #2661
2019-05-18 12:52:45 -04:00
Matthew Flatt
39fe53f5d5 reader: fix number->string case insensitivity
For example, `1+2I` and `+INF.FI` should parse as numbers.

Closes #2660
2019-05-18 12:22:01 -04:00
Matthew Flatt
236e2768f8 cs: fix structure-preicate-procedure? for some cases
Fix `structure-preicate-procedure?` on a predicate returned by a
`make-struct-type` call that isn't effectively inlined by schemify.
2019-05-18 12:22:01 -04:00
Matthew Flatt
2c16beb942 cs & threads: fix plumber flushing interleaved with addition
A plumber is supposed to gather all callbacks before running any of
them so that callbacks added by a callback are not run.
2019-05-18 12:21:51 -04:00
Matthew Flatt
7f92443a5f adjust printing of renamed procedures
When ">" appears in a procedure name, or when other characters appear
that would normally need to be escaped in a symbol, don't add escapes
since `#<....>` isn't readable anyway. This change makes renamed
procedures print in a consistent way with primitive procedures.

Similarly adjust the printing of structure type names.

Closes #2646
2019-05-18 09:55:23 -04:00
Matthew Flatt
a56c984db0 avoid incorrect unix-style inference
Closes #2659 by both recognizing `lib64` as a default path and by
having `--enable-origtree` override inference and specified when
running `configure` through the root makefile.
2019-05-18 07:56:02 -04:00
Matthew Flatt
cc487a4d9a cs: fix incorrect impersonator discard in chaperone-of? 2019-05-18 06:39:37 -04:00
Matthew Flatt
b3f66a4973 repair prop:impersonator-of interaction with {impersonator,chaperone}-of?
Relevant to #2644
2019-05-18 06:39:37 -04:00
Alexis King
6ae082fccd class/c: Swap after, not before, adding #:important blame context
Swapping the blame before adding #:important context associates the
important party with the negative party for the purposes of picking
“contract violation” versus “broke its own contract” messages in error
reporting. Therefore, only swap after adding the context.

fixes #2531
2019-05-17 19:57:26 -05:00
Matthew Flatt
ddb944d583 improve precision of / on complex numbers with small parts
Closes #2654
2019-05-14 07:57:03 -06:00
Matthew Flatt
0d55a05b46 cs: fix a case in unsafe-add-collect-callbacks
Fix a function-call shape that is used for GTK+2.
2019-05-12 14:45:26 -06:00
Matthew Flatt
ff95f1860a io: fix hostname lookup for tcp-listen
Need to lookup with "passive" flag. Some platforms/configurations
apparently don't care, but some do.
2019-05-11 18:56:57 -06:00
Paulo Matos
a672ac9907
Fix simple typo
s/emable/enable/
2019-05-11 17:48:01 +02:00
Matthew Flatt
59d5300f77 makefile: fix configure dependencies
Reconfigure if "cfg-racket" changes without "configure" changing.
2019-05-10 21:21:54 -06:00
Lukas Lazarek
001eeded9f racket/contract: Fix (box/c #:immutable #f) failing on mutable boxes 2019-05-10 21:05:23 -05:00
Matthew Flatt
bfe649bcc7 adjust GC behavior to be more usable without generational collection
Instead of limiting the nursery size and performing a full GC every
time a small nursery is full, allow the nursery to be proportional
to the total heap size if generational GC is disabled.
2019-05-10 19:45:05 -06:00
Paulo Matos
7c3a207f36 Add configure option --enable-generations (enabled by default).
This option allows the user to enable or disable (with
--disable-generations or --enable-generations=no) generations in
3m. Disabling generational collection is, in most cases, a bad
idea, but it may be necessary on a platform where signal handling
doesn't work well enough to support a write barrier that is
implemented with page protection.
2019-05-10 19:44:46 -06:00
Matthew Flatt
eeaac9c142 avoid unspecified NULL passed to memcpy
Closes #2632
2019-05-10 19:35:38 -06:00
Matthew Flatt
bb7836e734 cs: support --enable-natipkg 2019-05-10 17:35:53 -06:00
Paulo Matos
75cc43aa56
In autoconf 2.70 variable runstatedir was added - ignore (#2606)
Ignore new autoconf variable added in 2.70.
The interesting thing is that debian decided to backport this variable
to their 2.69 release so in some 2.69 autoconf this variable does not
exist but in debian ports 2.69 generates this variable. It is
nonetheless not useful for Racket, so add to ignore list.
2019-05-10 18:19:49 +02:00
Matthew Flatt
d5a46eb39d cs: repair build without --enable-racket
When using a built-for-bootstrapping Racket to build Racket CS, the
intermediate module loading module mode should be `--boot` instead of
`--chain`. The repo's top-level makefile takes care of that already,
but not `configure`-generated makefiles as may happen in a build from
a source distribution.
2019-05-10 07:20:31 -06:00
Robby Findler
2c3fce244c added #:unprotected-submodule 2019-05-08 20:32:04 -05:00
Matthew Flatt
b7d738d59a cm: fix lock more
Still trying to get it right for the repair started in 70e0cac062 and
continued in ef1004fdc0.
2019-05-06 20:17:38 -06:00
Matthew Flatt
93d84170d0 read: fix #e after #x
Corrects a bug in 0549bfb1e5 where `#x` causes the `e` in `#e` to be
interpreted as 14 instead of the character `#\e`.
2019-05-06 08:14:20 -06:00
Matthew Flatt
bed23e221e update racket HISTORY.txt for v7.3 2019-05-06 07:34:55 -06:00
Matthew Flatt
83ad6bd7c1 cs: fix banner and make startup use it
The string returned by `banner` was missing a "v" and a "." compared
to the traditional result. Avoid duplicating the string in "main.sps".
2019-05-05 17:34:04 -06:00
Matthew Flatt
151b5755c5 cs: repairs for inaccessible custodians and custodian boxes
Allows an inaccessible custodian to be GCed, promoting any values that
it manages to its parent custodian. Also repair memory accounting for
custodian boxes.

For values referenced by a custodian, the nature of the custodian's
weak references is slightly different on Racket CS. The reference is
weak enough that the value can be finalized via will (e.g., to close
an unused port), but it's not weak enough to allow weak boxes, weak
hash table keys, or ephemeron keys to be cleared. That's a consequence
of using ordered finalization instead of finalization/weakness levels.
This difference could be avoided at the cost of an extra wrapper for
any finalized value and a discipline of using such wrappers as the
user-visible reference for all custodian-managed values, but semi-weak
references so far appear to be practical and a better compromise.
2019-05-03 19:16:45 -06:00
Matthew Flatt
9951efc891 cs: fix unsafe-thread-at-root to use the root custodian
Otherwise, a finalization thread can get shut down, resulting in a
leak.
2019-05-03 15:00:33 -06:00
Matthew Flatt
ef1004fdc0 cm: fix lock
Commit 70e0cac062 neglected to use `#:for-lock? #t` as intended.
2019-05-03 12:57:58 -06:00
Matthew Flatt
f52fdfdd6e expander: preserve inlining annotations in machine-independent bytecode 2019-05-03 10:36:42 -06:00
Matthew Flatt
920c899ba8 thread: adjust use of later will executor for custodian
The use of a will executor for a custodian is a bit of a hack, and it
doesn't want the "keep live until executed" constraint. So, add an
optional internally.
2019-05-03 06:28:25 -06:00
Matthew Flatt
e13fac3ccf foreign: document internal make-late-will-executor
Also, rename from "stubborn" to "late" internally to be more
consistent and avoid overloading "stubborn" in the allocator.
2019-05-03 06:20:11 -06:00
Matthew Flatt
032479cf2c keep late will executors live with pending wills
If a late will executor has pending will, then it needs to stay
live until the enclosing place has terminated (and post-custodian
callbacks are run). Otherwise, `ffi/unsafe/alloc` can lose values
that it expects to finalize, and it reports an "internal error".

The late will executor for `register-finalizer` from `ffi/unsafe`
was kept live in traditional Racket, but only as an accident of
custodian shutdown in a terminating place: the shutdown process skips
threads, since that work is technically not necessary. Relying on that
coincidence is asking for trouble, though, so implement retention more
deliberately.
2019-05-03 05:39:15 -06:00
Matthew Flatt
358764faac cs: fix retention of late will executors
A late will executor must stay live as long as it has finalizations
registered.
2019-05-03 05:38:54 -06:00
Matthew Flatt
8f5f0a4330 cs: implement foreign-call locks 2019-05-02 20:09:43 -06:00
Matthew Flatt
d5243820f6 cs & schemify: faster ptr-ref and ptr-set! on primitive types
Recognize `(ptr-ref <ptr> _uint8)`, etc., and turn it into a more
direct `(ptr-ref/uint8 <ptr>)`, etc. This improvement speeds PNG
loading by a factor of 10 to 20, for example, because the
implementation expects the pattern to be recognized.
2019-05-02 17:31:40 -06:00
Ben Greenman
a13070f302 racket/contract: improve fast-append
test whether the 2nd arg is null once, rather than N times
2019-05-02 11:35:55 -04:00
Ben Greenman
721ef2050f racket/contract: move comment
Move a comment closer to the code it talks about
2019-05-02 11:35:55 -04:00
Matthew Flatt
5b929a7621 io: fix port custodian unregister
Make unregister match the register change in 11789ff8b0.
2019-05-02 07:26:20 -06:00
Matthew Flatt
651fc3ae5e ffi/unsafe/com: use ffi/file instead of C API 2019-05-01 14:43:36 -06:00
Matthew Flatt
92c12de018 cs: implement prop:exn:srclocs in exn:fail:read 2019-05-01 14:43:36 -06:00
Matthew Flatt
fb968db7a5 cs & thread: detect plumber-flush errors on place exit 2019-05-01 13:46:46 -06:00
Matthew Flatt
cfeef54a28 cs & threads: run post-custodian shutdown actions on place exit 2019-05-01 13:22:47 -06:00
Matthew Flatt
193bec6b7d cs & threads: more place-message repairs for graphs 2019-05-01 09:24:39 -06:00
Matthew Flatt
9268dcaad3 cs: better handling for contended hash-table locks
When the number of places approaches the number of available
processing cores, then a spin lock isn't good enough for a small
number of contended hash tables (maybe just one of them). When
contention is discovered, fall back to a mutex-based lock.
2019-05-01 09:24:39 -06:00
Alexis King
1101461434 rktio: Make sure not to close subprocess standard in/out/err
When spawning a new subprocess, it's possible that one or more of the
new process's standard input, output, or error descriptors use file
descriptor 0, 1, or 2, even if they don't correspond to any of the
parent process's original standard input, output, or error descriptors.
This can happen if the parent process closes one of its standard
descriptors, and the operating system reuses the file descriptor number
for a new descriptor.

Therefore, be more careful about closing and copying file descriptors in
the child process before calling `exec`. Specifically, move file
descriptors out of the way as needed so they aren't clobbered, and
accommodate cases where multiple standard streams may share the same
file descriptor in the parent process.

fixes #2634
2019-05-01 09:10:33 -05:00
Matthew Flatt
f3de3e4584 cs & threads: repairs for places
Includes a repair for handling vectors and prefab structs that are
involved in cycles.
2019-04-30 20:28:38 -06:00
Matthew Flatt
635c64e8bb racocs make: repair --no-deps destination 2019-04-30 19:00:52 -06:00
Matthew Flatt
1de69c4d37 cs & thread: repair retention of subcustodians
A subcustodian was incorrectly registered as weak for its parent,
which means that an unreferenced custodian could get lost when
shutting down an ancestor.
2019-04-30 18:10:17 -06:00
Matthew Flatt
dcb0f422a9 cs & io: fix shared byte strings over place channels 2019-04-30 17:46:10 -06:00
Matthew Flatt
f5836d7a30 racket/rerequire: repair for Racket CS 2019-04-30 17:46:10 -06:00
Matthew Flatt
5f53c91c6e cs: repair make-sibling-inspector 2019-04-30 17:46:10 -06:00
Matthew Flatt
164442ab26 fix place-message-allowed? on an empty vector 2019-04-30 17:46:10 -06:00
Matthew Flatt
436f3d8f64 io: fix handling of sharing in place messages 2019-04-30 17:46:10 -06:00
Matthew Flatt
11789ff8b0 io: fix socket/fd port custodian registration
Register the port, not the file descriptor, especially since a TCP
connection can have ports that share a file descriptor. Also, I think
a weak reference in the custodian doesn't work as intended (visible
through finalization) if the file descriptor is referenced with a
callback that closes over the port.
2019-04-30 14:40:17 -06:00
Matthew Flatt
cf08436e05 cs: fix custodian shutdown of TCP to use shutdown
In other words, send an EOF over TCP on custodian shutdown.
2019-04-30 14:40:17 -06:00
Matthew Flatt
258fb8fafd cs: use print-as-expression in default print handler 2019-04-30 14:40:17 -06:00
Matthew Flatt
a3fcaf92df racket/class: remove excessive syntax-protect
No `syntax-protect` is needed for `define/private`, etc., because no
new identifiers or expressions are introduced. Adding extra dye packs
can interfere with other macros that pull apart syntax (although maybe
the macros shouldn't do that without using `syntax-disarm`).
2019-04-30 09:07:59 -06:00
Matthew Flatt
dd22b8b599 io: correct custodian assumption
A custodian doesn't provide any order on shutting down the objects
that it manages (I was confused about some past experiments), so
avoid that assumption.
2019-04-29 17:39:24 -06:00
Matthew Flatt
b3b240ebc7 rktio: correct problem with change to growable poll set 2019-04-29 16:09:48 -06:00
Matthew Flatt
c4f44eaedd cs: fix cross-build bootstrap
Fix the relevant makefile target.
2019-04-29 13:29:09 -06:00
Matthew Flatt
bd5677da70 Revert "cs: fix cross-build bootstrap"
This reverts commit e13fcd6226.

Wasn't the right change, because the modified targets aren't used for
a cross build.
2019-04-29 13:29:09 -06:00
Ryan Culpepper
77a54c1af6
ffi-lib: log success, log failures with candidates tried (#2566) 2019-04-29 16:52:23 +02:00
Matthew Flatt
535bfcb0c3 cs: repair shared poll set initialization
Esspecially affects filesystem change events on Mac OS and BSDs.
2019-04-29 07:41:11 -06:00
Matthew Flatt
5c7d7aae68 rktio: fix fd leak in filesystem-change-evt with kqueue
Affects Mac OS and BSDs.
2019-04-29 07:41:11 -06:00
Ryan Culpepper
cbfaf428d2 syntax/parse: add describe frame if opaque even if no description
fixes #2627

Also fix a bug where eh-alternatives were mistakenly marked opaque.
2019-04-29 09:00:19 +02:00
Matthew Flatt
8f0fb72160 repair chaperone handling in potential place messages
Closes #2630
2019-04-28 10:27:34 -05:00
Matthew Flatt
e13fcd6226 cs: fix cross-build bootstrap 2019-04-27 19:53:21 -05:00
Ben Greenman
1a4192f697
typo: reword install/clone error message (#2609) 2019-04-27 11:43:21 -04:00
Alexis King
930046e729 wrap-expr/c: Add #:phase argument to control phase of introduced syntax
closes #2455
2019-04-26 12:34:27 -05:00
Ryan Culpepper
1481f3e8d9 sqlite3: fix reporting of insert-id 2019-04-26 13:35:08 +02:00
Matthew Flatt
8d77b8403c cs-boostrap: repairs to work in Racket CS 2019-04-25 20:45:42 -06:00
Matthew Flatt
01eec4ef9a expander: more reserved names to accomodate schemify
Compiling the Chez Scheme bootstrap library in Racket on Chez Scheme
is a good way to discover missing reserved symbols.
2019-04-25 20:04:14 -06:00
Matthew Flatt
c59ba15522 cs: unbreak async foreign callbacks
Adds a changed missed in 1624193210.
2019-04-25 19:52:00 -06:00
Matthew Flatt
776996fe24 cs: implement unsafe-{file-descriptor,socket}->semaphore
Use `unsafe-{file-descriptor,socket}->semaphore` internally to
make scheduling scalable for threads blocked on sockets, like
traditional Racket.
2019-04-25 19:29:33 -06:00
Matthew Flatt
05fe76f49a repair module name resolver
Revert an accidental change in 2d3ee903ec.
2019-04-25 17:19:47 -06:00
Matthew Flatt
2d3ee903ec cs: implement filesystem change events 2019-04-25 16:12:01 -06:00
Matthew Flatt
20672cd60a make Chez Scheme bootstrap work as a "cs-bootstrap" package 2019-04-25 10:09:26 -06:00
Matthew Flatt
1624193210 reduce overhead and precision of per-thread cpu times
Getting the current CPU time is relatively expensive, so get it only
on thread swaps where a thread used its full quantum or 1/100 swaps
otherwise. This approximation should work because thread-specific CPU
times are rarely requested, and they make the most sense for threads
that don't constantly swap out due to synchronization.
2019-04-25 08:23:32 -06:00
Matthew Flatt
84deff1d02 cs: more explicit handling of acessor/mutator errors
Formerly, an expression like `(arity-at-least-value 7)` could crash,
because the `arity-at-least-value` accessor is created in unsafe mode,
and the slow path to accessor errors attempted to use the accessor to
provoke an error message. Instead of using a potentially unsafe
accessor, have the slow path raise an error explicitly with
`raise-argument-arror`. That change has the added benefit of making
error messages mach traditional Racket (at least for structure types
that are not declared as "authentic").

The problem was exposed by tests added in 55dcdf5538.
2019-04-24 16:50:49 -06:00
Matthew Flatt
a600991ff7 cs: fix typo in error-message constructor 2019-04-24 15:42:26 -06:00
Matthew Flatt
92e937032d cs: repair number->string on most negative fixnum 2019-04-24 15:40:58 -06:00
Matthew Flatt
fa1861869e cs: use continuation marks for module context
Instead of a separate hash table mapping continuations to
linklet-instance names, use a continuation mark. That's faster,
because capturing a continuation means copying part of it on continue.
2019-04-24 15:05:46 -06:00
Matthew Flatt
688f03e208 cs: avoid some hashtable overhead during linklet instantiation 2019-04-24 12:54:38 -06:00
Matthew Flatt
a0b1791a9d declare deserializaton helper linklet as consistent
Declaring as consistent avoids some application indirections on Racket
CS, for example.
2019-04-24 12:33:00 -06:00
Matthew Flatt
42009925dc cs: reduce allocation on linklet instantiation
Avoid some closure creations and `append`s. The performance
improvement is very small, but measurable.
2019-04-24 11:03:04 -06:00
Matthew Flatt
d69f5cf00f cs: restore cross-module optimization
A backwards `if` in a7988c3813 disabled cross-module optimization.
2019-04-24 10:39:05 -06:00
Matthew Flatt
20e669f478 adjust local-require to help Check Syntax
Currently, Check Syntax has trouble correlating `require` forms and
references to imports that go through a macro-introduced rename
transformer. For example, there's no binding arrow from the final
`starting` to the `racket/list` in

 #lang racket/base
 (require (for-syntax racket/base))

 (define-syntax-rule (define-as-first mod starting)
   (begin
     (require (only-in mod
                       [first initial]))
     (define-syntax starting (make-rename-transformer #'initial))
     starting))

 (define-as-first racket/list starting)
 starting

But change the last two `starting`s to `initial`, and the binding
arrows work.

Until a general repair is in place for Check Syntax, this commit
adjusts 38d612dba6 to use the original export name for an immediate
binding, which acts as a hint to the current Check Syntax
implemenration.
2019-04-24 07:59:06 -06:00
Philip McGrath
c838d01c09 typo: inatll -> install 2019-04-24 06:12:19 -06:00
Matthew Flatt
31101c57db bytecode compiler: fix coordinate problem in letrec check
Example provided by Jay
2019-04-23 18:19:42 -06:00
Alexis King
72ab50a993 Establish free-id=? equivalences in intdefs with local bindings in scope
fixes #2594
2019-04-22 22:50:16 -05:00
Alexis King
38d612dba6 local-require: Remove last remaining use of syntax-local-get-shadower 2019-04-22 22:49:14 -05:00
Matthew Flatt
701a86b863 source "README.txt" corrections related to Racket CS builds 2019-04-22 19:06:24 -06:00
Matthew Flatt
e001f3b3cb include ChezScheme sources in a source distribution
Note that the source-distribution client must have a
"build/ChezScheme" checkout created, maybe by building as a 'cs
variant. A pruned version of that checkout is then included with other
sources. The resulting source distributon then works for building
either Racket variant.

Adapt the configure scripts and makefiles to use a "ChezScheme"
directory that is bundled with sources.
2019-04-22 16:56:17 -06:00
Matthew Flatt
21ad81b4fc cs bootstrap: move struct declaration to centralized module
Keep together declarations that need to match the Chez Scheme
implementation.
2019-04-22 07:24:38 -06:00
Gustavo Massaccesi
55dcdf5538 fix jit-inlining of struct primitives
Some expressions like (date-day) gave usually an arity error, but when they
were inlined by the JIT the arity check was wrong, so they produce a segfault
or a nonsensical result.
2019-04-20 20:09:57 -03:00
Matthew Flatt
4b586eeadf cs: faster Chez Scheme bootstrap
Improve record encoding to make it more exposed to the compiler.
2019-04-20 13:27:02 -06:00
Matthew Flatt
8c8979369f cs: switch Chez Scheme download to racket/ChezScheme at GitHub 2019-04-20 08:32:36 -06:00
Matthew Flatt
e2de99f0b9 cs: adjust build to use Racket bootstrap of Chez Scheme 2019-04-20 08:25:20 -06:00
Ben Greenman
f26b793e9a recursive contract: add else-branch to a cond
Raise an exception if none of the other cases match, instead of
returning `(void)` where a contract is expected
2019-04-19 20:43:44 -05:00
Matthew Flatt
e337c65204 implement bootstrap of Chez Scheme using Racket
Provide a way to build Chez Scheme from source using Racket. In the
short run, this lets us distribute source that ultimately depends only
on a C compiler (since a variant of Racket can be built from source
using just a C compiler).
2019-04-19 13:45:50 -06:00
Matthew Flatt
7e9d167101 expander: fix namespace-require/copy for some require specs 2019-04-19 13:44:14 -06:00
Ben Greenman
6d7550125f typo: change error messages for vectorof contract
- change an 'an' to 'a'
- remove 'immutable' where expecting either mutable or immutable (don't
  bother to specify which, because `vector-common.rkt` doesn't bother)
- remove extra ','
2019-04-18 07:15:08 -05:00
Matthew Flatt
e1ad8d4721 cs: fix path on discovered Chez Scheme library name
Corrects 8a368cac99.
2019-04-12 06:56:07 -06:00
Matthew Flatt
615677299e switch Mac OS back from poll to select
The `poll` system call doesn't work right for fifos, so switch
back to `select`, but use a new strategy to size fd_set buffers
instead of trying to use `getdtablesize` (because the result
of `getdtablesize` can change dynamically on Mac OS).

Also, add a check for input at the rktio level when trying to read
from devices other than regular files. Otherwise, Racket CS (which
doesn't have some redundant polling that is in traditional Racket)
sees spurious EOFs for unconnected fifos.

Closes #2577
2019-04-10 12:34:40 -06:00
Matthew Flatt
4c53b514cf cs: correction on compiler flags for object-name
Repairs a mistake in 40b8b5c675.
2019-04-10 07:55:24 -06:00
Matthew Flatt
8a368cac99 cs: fix discovery of Chez lib name on Windows 2019-04-10 07:52:11 -06:00
Paulo Matos
9e8b9d8959
Remove value store in ready_pos but unread (#2588)
* Remove value store in ready_pos but unread

* Move declaration of ready_pos to where it is used

* Make discard of return value of tcp_check_accept explicit

* Split declaration and var assignment to comply with xform
2019-04-10 14:14:57 +02:00
Paulo Matos
5a3d7b87e4
Remove dead assignment to ch (#2589)
Remove dead assignment to ch and make discard return value explicit
2019-04-10 08:37:37 +02:00
Paulo Matos
2919d21d1d
Remove dead assignment to target_offset (#2590) 2019-04-10 08:34:06 +02:00
Paulo Matos
93224561f8
Fix --enable-cify option (#2598)
I guess, a previous copy-paste AC_ARG_ENABLE meant that cify never had
its own option.
2019-04-10 08:32:52 +02:00
Matthew Flatt
40b8b5c675 expander extract: improve pure-function analysis
Improve the analysis enough to handle changes to
`make-keyword-procedure` (in 47467a1dba) and restore the Racket CS
build.
2019-04-09 16:12:31 -06:00
Gustavo Massaccesi
9f9b3f4443 cs: fix check of Chez Scheme version
Merge to v7.3
2019-04-09 18:03:57 -03:00
Matthew Flatt
ef49ccf87a cs: fix chaperone-struct on accessor/mutator taking a position
Closes #2570
2019-04-09 11:53:27 -06:00
Matthew Flatt
247c985702 cs: faster (current-memory-use 'cumulative)
A slow `(current-memory-use 'cumulative)` could causes misleading
results in `PLT_EXPANDER_TIMES` output for frequent actions.
2019-04-09 11:53:27 -06:00
Matthew Flatt
d61f56c77f cs: imprve fixnum hashing
Avoid collision for 0 and -1, for example.
2019-04-09 11:53:27 -06:00
Matthew Flatt
cc45dc044d cs: faster number->string on fixnums 2019-04-09 11:53:27 -06:00
Alexis King
1bf416a776 Make equal? on classes and objects see through class contracts
Making `equal?` do the right thing on classes turned out to be easy---it
just involved adding a straightforward `prop:equal+hash` property to the
`class` struct—but making it work properly for *objects* was the tricky
part. The trouble is that `equal?` on objects that don’t implement the
`equal<%>` interface is just ordinary structure equality, which can be
relevant if objects are inspectable. Writing `(inspect #f)` in a class
body is like making a struct `#:transparent`, and it has all the same
ramifications for equality.

The trouble is that `class/c` creates new wrapper classes, and every
class has its own struct type. Since the default behavior of `equal?` on
structs is to *never* be equal to structs of different types, even
subtypes, an object created from a contracted class can never be
`equal?` to an object created from the same class without contracts.

The solution is to add a `prop:equal+hash` property to `object%` itself
that emulates the default behavior of `equal?`, but sees through class
contract wrappers. Since struct type properties are inherited by
subtypes, this property will be present on all objects, and it only
needs to be attached once.

fixes #2279
2019-04-09 12:27:27 -05:00
Alexis King
47467a1dba Avoid creating procedures with internal source locations as names
Mainly, this improves `make-keyword-procedure`: when applied to a single
argument, it now uses `procedure-rename` to ensure the resulting
procedure has the appropriate name. A couple other changes also guard
against the case where a lambda expression has no inferred name and no
source locations information, which would lead to the source locations
in the implementation being used, instead.
2019-04-09 12:27:11 -05:00
Matthew Flatt
0d2dd8f578 cify: fix multiple-value return where braces are needed
Merge to v7.3
2019-04-08 13:15:19 -06:00
John Clements
5ce11626ef Post-release version for the v7.3 release 2019-04-08 10:55:30 -07:00
Paulo Matos
b9b6d97b30
Make second argument of scheme_os_getcwd a size_t (#2584)
By being an unsigned type, we ensure that when 0 is passed we know
that there's no smaller number. This aids the static analyzer.
2019-04-08 17:25:43 +02:00
Matthew Flatt
e6aef1093b expander: fix submodule order nondeterminism
The nondeterminstic order could lead to a mismatch that caused
Racket CS to crash on submodule tests.
2019-04-08 07:23:47 -06:00
Matthew Flatt
d87be8789e cs: use new $record-ref, etc., primitive
Also, speed up hashing and logging a little by adjusting semaphores to
succeed with `$record-cas!` when no waiting is necessary.
2019-04-08 11:13:01 +02:00
Matthew Flatt
39c67f8b6a cs: require Chez Scheme 9.5.3 2019-04-07 10:32:55 +02:00
Matthew Flatt
5a638073eb cs: avoid abuse of vector-ref for struct-ref
Use `$object-ref`, instead. Otherwise, cptypes can detect the abuse of
`#3%vector-ref` and make unwanted transformations.
2019-04-07 10:24:54 +02:00
Matthew Flatt
d8125082a2 cs: improve hash-code mixing 2019-04-07 10:24:54 +02:00
Alexis King
b6db4f7be1 class/c: Fix init arg contract projections being dropped
Previously, all init arg contracts’ first order checks were always
checked, but a typo meant all but one of the projections was always
dropped! This fixes that, and it removes a little nearby dead code while
we’re at it.
2019-04-04 15:27:14 -05:00
AlexKnauth
935c558717 fix uses of raise-arguments-error
one message string and no field-value pairs
2019-04-02 11:10:16 -04:00
Matthew Flatt
cbd565a3fd fix interpreted begin0 to for a 0-result case
In some cases, 0 results will be represented by a NULL results-array
pointer. Fix the interpreter to detect a single result completion
through a count of 1 instead of a NULL result-array pointer.

Also, remove a bug extra push operation in the JIT-generated code for
`begin0`. (Other features of the JIT-generated code compensated for
the extra push in cases where the bytecode compiler did't optimize
away the `begin0`, so it turns out not to have caused a problem, but
that's a surprising and fragile set of coincidences.)

Closes #2571
2019-03-30 20:41:01 -06:00
Matthew Flatt
e7456d3e9e io: avoid some unneeded work when sending paths to rktio 2019-03-30 20:41:01 -06:00
Matthew Flatt
dd9e11e1c7 cs: fix $value confusion in schemify and begin0
The attempted repair for `$value` in 6c195d521c was wrong.
2019-03-29 11:00:44 -06:00
Matthew Flatt
253f0f4383 cs: add guard for prop:arity-string
Relevant to #2569
2019-03-29 10:59:04 -06:00
Matthew Flatt
fdad73df32 cs: fix keyword-procedure chaperone with properties
Closes #2569
2019-03-29 10:46:29 -06:00
Matthew Flatt
793d655770 cs: limit linklet performance stats to main place
Avoids crashes due to a lack of synchronization, and makes
Racket CS consistent with Racket.
2019-03-29 10:21:15 -06:00
Matthew Flatt
6c195d521c cs: fix compilation of begin0 with only one expression
The problem was especially bad in the fallback interpreter,
where an ill-formed `begin` was created as a nested expression.
2019-03-29 10:06:26 -06:00
Robby Findler
7a9b1d065e Adjust ->i so that it sorts the pre/post conditions based on the dependency
order (like it does with the argument and result contracts), but ensuring
that the pre and post conditions come before the arguments (if possible)

closes #2560
2019-03-28 17:08:25 -05:00
Robby Findler
e1835074f5 refactor ->i implementation
so that it collects the pre/post conditions into sorted order with the
arguments (based on the dependencies), but then discards that
information and always evaluates the pre and post conditions after the
argument/result contract checks
2019-03-28 17:08:25 -05:00
bdeket
eea771ea64 improve accuracy of tanh function (#2565)
improve accuracy of tanh function

using the implementation of https://www.math.utah.edu/~beebe/software/ieee/tanh.pdf

by changing from (/ (- 1 exp2z) (+ 1 exp2z)) to (- 1 (/ 2 (+ 1 exp2z)) the accuracy after rounding is increased (I was comparing with bftanh) and removes the fluctuations around z=18.35
using the polynomial for z ϵ(1.290e-8 to 0.549) seems to increase the accuracy after rounding even further
see comparison: http://pasterack.org/pastes/48436

especially the fact that  (< (tanh 18.36)(tanh 18.37)) ;=> #t was tripping me up
the two extra conditions (z . < . 1.29e-8) and (z . < . 0.549) are optional to solve this
2019-03-28 05:36:18 -06:00
Matthew Flatt
82d5b46819 ELF tools: don't treat non-allocated section as allocated
For example, don't fail in shifting file offsets by misinterpreting an
unallocated section's null address as requiring a shift of virtual
addresses.
2019-03-27 15:07:08 -06:00
Matthew Flatt
db677018d0 remove unused debugging code
Closes #2564
2019-03-27 08:19:29 -06:00
Ryan Culpepper
0502e537d7 syntax/parse: update fix #1452
- Propagate disappeared uses from any pattern stx, not only those
  attached to forms that themselves have a disappearing use.
- Fix for new local-apply-transformer handling of scopes.
2019-03-26 18:30:43 +01:00
Ryan Culpepper
6c3031a5f7 add optional intro? argument to record-disappeared-uses 2019-03-26 18:30:43 +01:00
Georges Dupéron
85fe092ed9 Fixes #1452 syntax-parse discards the 'disappeared-uses property added by pattern-expanders 2019-03-26 18:30:43 +01:00
Georges Dupéron
c618ec803a Merge pull request #1691 from jsmaniac/syntax-parse-regexp
Adds built-in syntax classes which match regular expressions
2019-03-26 17:20:10 +01:00
Ryan Culpepper
22a9b0cf35 syntax/parse: fix spurious description for eh-alt-set
closes #2551
2019-03-26 16:58:46 +01:00
Alexis King
db3c1d4cb9 units: Avoid use-before-initialization errors in signature contracts
This commit fixes an issue with the fix for contracted bindings in
signatures implemented in commit 5fb75e9f82. While the previous fix
worked in simple cases, it introduced a problem: although signatures
that define contracted bindings were able to refer to other bindings
in the signature in the binding contracts, but anyone doing so was
at the mercy of the exporting unit’s definition order. For example,
given a signature

  (define-signature a^
    [(contracted
      [ctc contract?]
      [val ctc])])

then a unit exporting the signature would cause a
use-before-initialization error if its definition for val appeared above
its definition for ctc.

This limitation did not exist in the units implementation prior to the
introduction of the sets-of-scopes expander in Racket v6.3 (after which
contracted bindings were broken until the aforementioned fix in Racket
v7.2). However, the fact that they worked at all seems semi-accidental:
instead of properly indirecting references to signature bindings within
binding contracts, the contract expressions were simply placed in a
context in which the existing names were bound. However, this meant that
any export that renamed identifiers could cause problems, which the
implementation strategy taken in this commit handles just fine.
2019-03-25 13:58:51 -05:00
Lassi Kortela
1600bc5dc6 file/untar: allow leading as well as trailing blanks (#2553)
Some really old tar files can have both leading and trailing
blanks (nul/space characters) in the same octal number field in the
header.
2019-03-24 18:33:52 -06:00
Robby Findler
683492f6fe allow some redirections in the url that looks for the new version 2019-03-24 19:21:07 -05:00
Matthew Flatt
70e0cac062 compiler/cm: fix ".zo" file locking in -MCR mode 2019-03-23 14:47:36 -06:00
Matthew Flatt
3127b324c4 cs: more attempts to fix Chez Scheme submodule update
When `#:extra-repo-dir` is used in a site configuration, the
extra repos need to have a "master" branch to enable updates.
2019-03-23 10:40:59 -06:00
Matthew Flatt
32330c1327 cs: another fix for Windows build repo update 2019-03-22 20:35:47 -06:00
Matthew Flatt
0736898ccd cs: fix Windows build repo update
repair for 66efceee0e
2019-03-22 17:36:16 -06:00
Matthew Flatt
0fc4f69d1e cs: add needed header space for Mac OS executables 2019-03-22 11:55:24 -06:00
Matthew Flatt
66efceee0e cs: fix Windows script for updating Chez Scheme checkout 2019-03-22 08:41:08 -06:00
Matthew Flatt
e34dbdc4f4 defend against bad hash type in bytecode
The change to make `#hash()`, etc., unique made it easy for the fuzz
tester to crash the bytecode reader.
2019-03-22 07:34:36 -06:00
Matthew Flatt
3501fce192 expander: syntax-make-delta-introducer and mpi shifts
When the result of `syntax-make-delta-introducer` adds scopes,
it needs to carry along any shifts that might be relevant.

The new implementation risks adding lots of redundant shifts. In this
case, it might be worth spending extra effort at shift-transfer time
to check whether the shift is redundant.

Closes #2542
2019-03-22 07:18:06 -06:00
Matthew Flatt
7332060b69 raco make: fix parallel-build prefetch for relative submodule paths
Closes #2543
2019-03-21 18:58:20 -06:00
Matthew Flatt
0be2178f0e cs: fix build of cross-compile racket 2019-03-21 07:52:48 -06:00
Matthew Flatt
d0a98cb42a cs: update for LZ4 compression 2019-03-21 07:52:48 -06:00
Alexis King
8910ff0a39 units: Fix mistake in 86bb85931d that could cause compile-time failures
Specifically, if a contracted binding was applied as a function inside
another contract, it would lead to a syntax error.
2019-03-19 14:24:41 -05:00
AlexKnauth
780647f0eb return a procedure from make-variable-like-transformer
So that make-variable-like-transformer produces a value that passes both procedure? and set!-transformer?
2019-03-19 15:43:04 +01:00
Matthew Flatt
201015a4b6 cs: avoid uppercase in Windows header and library references 2019-03-18 13:10:43 -06:00
Matthew Flatt
f94fba12da struct: disallow #:extra-name with #:omit-define-syntaxes 2019-03-17 06:54:55 -06:00
Robby Findler
ed2381ee59 when collapsing use contract-stronger only on trustworthy contracts 2019-03-17 07:04:23 -05:00
Ben Greenman
a2d87c353e typo: rename 'provide/contract-struct-expandsion-info-id' 2019-03-16 17:11:55 -04:00
Robby Findler
ce324be9f8 adjust contract-out to use fresh scopes for mangled identifiers
closes #2469
2019-03-15 22:13:10 -05:00
Matthew Flatt
b6a7f7bc38 expander: keep reference that is needed after all
Part of e7744efb7d triggered a test failure (that I missed by somehow
running tests incorrectly). It turns out that phase -1 transformer
bindings can be used in phase-0 code via shifting.

This change does not effect the repair for building with
machine-independent bytecode.
2019-03-14 07:39:20 -06:00
Matthew Flatt
e7744efb7d expander: avoid unneeded namespace reference
This change avoids the stair-step effect that is depicted in the
"current Racket -M" build plot from the January 2019 blog post about
Racket on Chez Scheme.

The stair step in that plot is a result of a combination of effects,
but one key part is that the `.set-transformer!` linklet import (to
support macro definitions) has a reference back to the namespace.
While `.set-transformer!` normally would not be captured in any
closure, `db/private/generic/prepared` creates a thread that causes
the "prefix" part of a closure to be moved to a thread's runstack
before it can be pruned by the GC. The stair-step problem happens only
when running directly from machine-independent form, because that form
is recompiled in a way that doesn't optimize away the unused
`.set-transformer!` import. The change in this commit avoids a
reference to the namespace in some cases where it will not be useful,
which turns out to be sufficient to address the build problem.

A more complete repair would be to change the compiler to pair a
closure prefix on the runstack with a liveness mask. An even more
complete repair is to switch to Racket CS. Racket CS is immune to the
problem, even when running from machine-independent bytecode, because
its closures do not keep extra references (with the tradeoff that
there's less sharing).
2019-03-14 06:37:23 -06:00
Matthew Flatt
0257b5cf71 raco pkg: fix --source mode for some installations
Some package installation modes did not support `--source`
and similar strip modes on an intermediate directory.
2019-03-13 12:38:09 -06:00
Matthew Flatt
5a96e89f95 cs: reduce communication for cross compilation
Communicating in terms of S-expression is convenient but wasteful,
so communicate in bytes.
2019-03-13 10:40:10 -06:00
Matthew Flatt
4248f9bea0 fix hash-table sorting of symbols with non-ASCII characters
Non-ASCII characters sorted before ASCII characters, instead of after.
2019-03-13 09:32:33 -06:00
Matthew Flatt
6d9ea44830 add unsafe-make-srcloc
This function was already in Racket CS.
2019-03-13 09:32:33 -06:00
Matthew Flatt
861ddac5bc expander: sort submodule names in a linklet bundle 2019-03-13 09:32:33 -06:00
Matthew Flatt
7c0a978f28 cs: remove some incorrect kernel exports
Remove `make-date[*]`, `double-flonum?`, `f[xl]vector-copy`, and
`compile`, which should not be exported by built-in modules.
2019-03-13 09:32:33 -06:00
Matthew Flatt
e79f07b6cc racket/fasl: fixed representation for +nan.0
To make fasl writing as determinsitic and portable as possible, write
+nan.0 and +nan.f always with a specific bit pattern.

This choice risks losing information that is potentially useful, but
given the way that Racket treats all NaN encodings as equivalent, that
rick seems low.
2019-03-13 09:32:33 -06:00
Matthew Flatt
6a35d64e95 repairs for change for machine-independent bytecode
Fix problems with moving some VM-specific handlign to schemify, and
fix some interning issues that the change exposed.
2019-03-13 09:32:33 -06:00
Matthew Flatt
df8501d8f0 make empty immutable hash tables unique
For example, `#hasheq()` is `eq?` to `(hasheq)` and `(hash-remove
(hasheq 'x 2) 'x)`. Making empty hash table unique avoids some
potential and actual inconsistencies between traditional Racket and
Racket CS, such as in machine-independent bytecode.
2019-03-13 09:32:33 -06:00
Matthew Flatt
6e958b627f expander: avoid VM-specific expansion
Move different handling of serialized syntax data to the schemify
layer instead of te expander, so that the result of compiling in
machine-independent form is the same for traditional Racket and Racket
CS.
2019-03-13 09:32:33 -06:00
Matthew Flatt
d0d391d76b raco setup: add --recompile-only
The `--recompile-only` flag is intended to help dectect build
problems, especially distribution builds where packages are
supposed to be in built form.
2019-03-13 09:32:33 -06:00
Matthew Flatt
ce708478e7 raco setup: add time to section printouts 2019-03-13 09:32:33 -06:00
Alexis King
bb42476157 syntax/parse: Add prop:syntax-class 2019-03-11 12:18:36 -05:00
Sam Tobin-Hochstadt
25efc68b17 Make sql-null a transparent struct.
This allows it to cooperate better with Typed Racket, particularly
regarding the `Any` type. The guard and use of `#:authentic` also
check that it's still a singleton in all cases.
2019-03-11 14:02:57 +01:00
Matthew Flatt
de82588e08 cs: fix cross-compile fasl 2019-03-09 13:01:23 -07:00
Matthew Flatt
17e5a56569 raco setup: allow dependency checking to continue after error
When reading a bytecode file fails, record the error and continue.
2019-03-09 08:42:54 -07:00
Matthew Flatt
e46e791724 cs: delayed parsing of cross-linklet info
Avoid parsing cross-linklet optimization information until it is
needed. This change also avoids a problem with saving hash codes
that are platform-specific.
2019-03-09 08:13:03 -07:00
Matthew Flatt
b7e0d52b96 setup/dirs: improve host lib dir search for cross-compile
Insteda of just consulting `lib-search-dirs` in the host system's
config during cross-build mode, use `lib-dir` if set to arrive at
the expected default when `lib-search-dirs` is not set.
2019-03-08 18:21:34 -07:00
Matthew Flatt
e4517afb56 expander: reject internal sequence that ends in define-syntaxes
For example, don't allow

 (let ()
   8
   (define-syntax-rule (m) 9))
2019-03-08 15:40:33 -07:00
Matthew Flatt
d9d8d39f00 cs: fix truncation of path information in optimization info
Handle not-this-platform paths that manage to evade the heuristics for
converting paths to and from relative form. Otherwise, building can go
wrong on on Windows when using machine-independent starting files
generated on Unix-like systems.
2019-03-06 14:00:27 -07:00
Matthew Flatt
875e3b290d raco setup: add --error-out and --error-in
The `--error-out` and `--error-in` flags are meant to work together to
chain a sequence of `raco setup` steps where one of them might fail,
but other steps should proceed. The last step in that sequence should
use only `--error-in`, so that it exits with failure if any of the
steps failed.

The `both` target of the toplevel makefile uses `--error-out` and
`--error-in` to let a Racket CS build proceed as long as the
traditional Racket build made it to the last `raco setup` step, which
means that it survives package-build errors.
2019-03-06 09:43:18 -07:00
Matthew Flatt
fe6d243a71 repair for recent 32-bit MinGW 2019-03-06 08:05:02 -07:00
Matthew Flatt
fa972f0476 cs: unbreak cross compilation
Better checking in a7988c3813 exposed a problem with the expander's
recompiler in the case of cross compiling.
2019-03-06 06:44:17 -07:00
Matthew Flatt
ed807f8584 cs: use cross-compiler server for fasl
The Chez Scheme fasl format is not machine-independent when record
types are involved, so use the process that serves compilation to also
serve fasl encoding.
2019-03-06 06:25:18 -07:00
Matthew Flatt
f68248ee3b setup/setup: expose package-dependency functionality
Closes #2512
2019-03-05 20:43:09 -07:00
Matthew Flatt
828dc1f276 raco setup: allow catching cycle errors
In parallel build mode, if attempting to compile a file triggers a
cycle error that is caught and discarded, don't leave behind a
dependency (that is effectively resolved by the error) in the
parallel-worker manager.
2019-03-05 20:27:20 -07:00
Alexander McLin
01edfbbfcf *BSD: add "111" to libcrypto.rkt
Allows `libcrypto.so.111` to be discovered by racket on FreeBSD
variants such as TrueOS.
2019-03-05 20:27:11 -07:00
Matthew Flatt
a7988c3813 cs: fill in recompile-linklet
It doesn't do anything, but make it a conforming variant of the
identity function. Also, fill in checking for `compile-linklet`,
and correction documentation errors for `compile-linklet` and
`recompile-linklet`.
2019-03-05 18:11:19 -07:00
Matthew Flatt
85571bb542 cs: fix cross-compiler initialization
Disable debugging information, for example.
2019-03-05 11:47:22 -07:00
Matthew Flatt
853efb5ec9 cs: fix PLT_LINKLET_SHOW_CP0
Repair the internal call to `expand/optimize` to convert Racket
correlateds to Chez Scheme annotations.
2019-03-05 11:22:59 -07:00
Matthew Flatt
a00dd06793 further makefile and compiler/cm repairs for cross-build 2019-03-05 06:55:00 -07:00
Matthew Flatt
9981effa4b cs: revise cross-compilation protocol and fill in build steps
Makefile and configure refinements, including targets to let the
distro-build package drive a cross-build from scratch. A cross
build on Mac OS for Windows now works, for example.
2019-03-04 07:00:59 -07:00
Matthew Flatt
29ad80905e log-message: make data argument optional
The intent was never for the data argument to be optional, but a
mistake in traditional Racket's argument dispatch for `log-message`
made it optional in some cases, so the simplest way forward is to make
it consistently optional. Repair traditional Racket to use `#f`
instead of a random value when the data argument is not provided.
2019-03-03 20:37:07 -07:00
Matthew Flatt
d71d68e72a cs: add cross-compilation hooks for Racket
Add options to load a "plug-in" cross compiler, which should be a Chez
Scheme patch file plus declarations for the built-in libraries. Since
loading a patch file replaces the initial compiler, a separate
cross-compiler process is used to load the plug-in.
2019-03-03 08:04:25 -07:00
Matthew Flatt
f720220c41 io: fix file-truncate to return (void) 2019-03-02 20:17:58 -07:00
Matthew Flatt
17e873bee8 cs: unbreak Windows build 2019-03-02 19:51:31 -07:00
Matthew Flatt
2c09b2c86d cs: unbreak ffi/unsafe immobile cells 2019-03-02 11:02:00 -07:00
Matthew Flatt
068cfc6330 cs: unbreak Makefile for non-cross build 2019-03-02 06:42:40 -07:00
Matthew Flatt
c890edeea4 json: fix checking of word boundary after true, false, and null
Thanks to Greg Hendershott for pointing out the problem.
2019-03-02 05:38:06 -07:00
Matthew Flatt
33a5c30073 first step of Racket CS cross-compilation for Windows
Adjust build process to be able to generate Racket.exe, etc, for
Racket CS using MinGW. Much of this cross-compilation support can work
for building other platforms, too, but some of the details are filled
in only for generating Windows executables.
2019-03-02 05:33:26 -07:00
Matthew Flatt
472ac6c26e tcp-connect: repair for error on connect syscall
When `connect` returns an error immediately, save that error instead
of expecting it to be available later via `getsockopt`. That avoids a
problem on TrueOS, for example.
2019-03-01 14:42:23 -07:00
Matthew Flatt
a80714aeee fix JIT-inlined unsafe-fl<, etc., for > 2 args and CGC
Some parts of the implementation used for comparison were omitted when
allocation operations are not supported (but comparisons don't
allocate). This problem was unconvered by running the "jitinline.rktl"
tests with RacketCGC.
2019-02-28 10:01:47 -07:00
Matthew Flatt
d238007cf8 fix JIT-inlined unsafe-flrandom
Relevant to racket/typed-racket#807
2019-02-28 09:24:54 -07:00
shhyou
e970a6194a In case', report binding info of else' in error 2019-02-27 18:47:31 -06:00
Matthew Flatt
68312e43bd ffi/com: fix argument checking in com-get-property
Closes #2470
2019-02-27 16:15:28 -07:00
Matthew Flatt
0fefd6936a raco exe: fix problem with submodules
A recent revision to the way modules are instantiated for handling
runtime paths did not work right for modules from source (i.e., no
bytecode available) that have submodules.

Closes #2486
2019-02-27 15:31:06 -07:00
Matthew Flatt
f80c71e642 expander: handle strange local-expand under begin-for-syntax
Avoids internal errors (including unsafe behavior) in an example like

```
  #lang racket

  (begin-for-syntax
    (local-expand
     #'(#%plain-module-begin
        (begin-for-syntax
          (define x 42)))
     'module-begin
     '()))

  (begin-for-syntax
    (println x))
```

This example is weird, because it creates an `x` binding that doesn't
survive to the full expansion. Before the repair, the disappearing
binding created trouble for the expanded-to-linklet pass.

The example is weird for a second reason, which is that it uses uses
`local-expand` in a place where it will be triggered by visiting the
module. It turns out that raising a syntax error at that time (from
`#%plain-module-begin`) did not work correctly due to lazy
instantiation of the expansion context.

Closes #2458
2019-02-25 15:25:22 -07:00
Matthew Flatt
84837f4330 fix struct/c and struct/dc for new syntax arming of struct ids 2019-02-25 13:10:08 -07:00
Matthew Flatt
aa42163b70 fix place-channel handling of hash tables that contain impersonators
Closes #2504
2019-02-25 10:41:30 -07:00
Matthew Flatt
1c299e99db add some missing syntax-protects
Add `syntax-protect` to some macro expansions, especially macros in
contex where unsafe operations are imported, which means that a
combination of `local-expand` and `datum->syntaxa could provide access
to the unsafe bindings absent `syntax-protect`.
2019-02-25 07:48:04 -07:00
Matthew Flatt
685a1ff040 number-parsing repair for some inexact numbers
The fast path for inexact numbers didn't guard against underflow
correctly.
2019-02-25 07:48:04 -07:00
Matthew Flatt
078f697a0b JIT repair for eqv? on extflonums
Since `eqv?` recognizes extflonums, don't implement a comparsion to an
immediate extflonum as `eq?`.
2019-02-24 17:34:10 -07:00
Matthew Flatt
a3dfc1478a number-parsing repair for no-extflonum builds 2019-02-24 08:21:49 -07:00
Matthew Flatt
47a37f6bbe repair for number parsing
Fix a problem recognizing the range of characters for bases larger
than 10.
2019-02-23 21:09:16 -07:00
Matthew Flatt
0549bfb1e5 rewrite number parser
Inspired by the way the Chez Scheme number parser works, change the
one in the expander to be faster and probably clearer. This improved
performance brings number parsing almost back in line with the v6.12
parser's performance.

The revised parser is faster because it goes through an input string
just once. The new parser is also more xcomplete; it doesn't rely on a
host-system `number->string` (except for dummy extflonums when
extflonums are not supported).

If you're reading the commit history, beware that the note on commit
be19996953 is incorrect about the change to parsing divide-by-zero
errors. (It explains a change that was edited away before merging.)
This commit really does change the bahvior, though, again as a better
match for v6.12. Specifically, "/0" (with no hashes) always triggers
divide-by-zero in an otherwise well-formed number, even if `#i` is
used.
2019-02-23 17:25:54 -07:00
Matthew Flatt
be828b184c json: speed up JSON parser
Speed up JSON parsing (usually around x4 to x8) by avoiding regexp
matching and using more direct byte and character operations. Along
similar lines, compute parsed numbers directly instead of converting
to a string and then using `string->number`.

The revised reader behaves differently only in the case of a bad input
stream, where it may consume more bytes from the stream than the old
one due to eagerly reading bytes instead of tentatively matching
peeked bytes. Also, a UTF-8 decoding error is just `exn:fail` like
other input-parsing errors, and not `exn:fail:contract`.
2019-02-22 19:22:53 -07:00
Matthew Flatt
4d43c9884c io: fix file-buffer performance when driven by peeks 2019-02-22 18:47:08 -07:00
Matthew Flatt
75c8c3ce37 fix bytes-utf-8-ref to accept 5 arguments as documented 2019-02-22 18:46:36 -07:00
Matthew Flatt
c4a23595b9 json: faster parsing
Replace some regexœp operations with more direct `peek-char` and
read-char` operations.
2019-02-22 13:06:49 -07:00
Jesse Alama
1eafd1518e Offer 7.2 in .travis.yml
Bring the boilerplate .travis.yml up-to-date.
2019-02-22 11:34:39 -07:00
Paulo Matos
7a6536ab6d Remove unnecessary exit(0);
This was necessary to avoid warnings in a specific compiler but after
adding MZ_DECLARE_NORETURN, this is now unnecessary.
2019-02-22 08:52:09 -07:00
Paulo Matos
ef8b31b527 Use noreturn attribute only when MZ_DECLARE_NORETURN 2019-02-22 08:52:09 -07:00
Paulo Matos
5b837b895f Put all declarations with NORETURN in a single line
If declarations are not in a single line makex.rkt gets confused and
mis-parses the declarations.
2019-02-22 08:52:09 -07:00
Paulo Matos
0659e51b3f Mark other error functions as NORETURN
Related to PR #2472, marks a few other functions as NORETURN.
Namely:
	- scheme_signal_error
	- scheme_wrong_count
	- scheme_wrong_count_m
	- scheme_case_lambda_wrong_count
	- scheme_wrong_type
	- scheme_wrong_contract
	- scheme_wrong_field_type
	- scheme_wrong_field_contract
	- scheme_arg_mismatch
	- scheme_contract_error
	- scheme_wrong_return_arity
	- scheme_unbound_global

Unfortunately static analysis is done per compilation unit, so
although, for example, scheme_wrong_contract calls scheme_raise_exn
and the latter is already marked NORETURN, the analyzer does not know
this. Therefore we need to manually propagate the NORETURN for each
function declaration.
2019-02-22 08:52:09 -07:00
Matthew Flatt
b7654d9a84 cs: avoid uninitialized bytevectors via ffi/unsafe
Zeroing out allocated memory is required by the specification of
`alloc` from `ffi/unsafe`.

Possibly relevant to #2493
2019-02-21 08:39:06 -07:00
Matthew Flatt
858a925c16 remove another dead assignment to buf, which also causes leak
These leaks happen just once in startup code, so they
didn't matter in practice --- but, obviously, its better to
fix them.
2019-02-20 16:35:27 -07:00
Matthew Flatt
a119804827 remove unused call to GC_set
Closes #2339
2019-02-20 16:35:27 -07:00
Matthew Flatt
6a94ce5c04 fix error-message typo 2019-02-20 16:35:27 -07:00
Paulo Matos
6fa0e4fc64 Avoid dead initialization of boot_offset
Assuming here that ELF_FIND_BOOT_SECTION and WIN32 are mutually exclusive.
2019-02-20 16:35:19 -07:00
Philip McGrath
fe563735be ffi/unsafe/alloc: handle keyword arguments
closes https://github.com/racket/racket/issues/2484
2019-02-20 16:29:28 -07:00
Paulo Matos
be054f6149 free buf to avoid memory leak 2019-02-20 16:27:58 -07:00
Paulo Matos
490105ed53 Remove dead store for rator 2019-02-20 16:25:38 -07:00
Paulo Matos
10d721eaea Remove dead store for did_alt 2019-02-20 16:24:45 -07:00
Paulo Matos
7e856b3b4d Remove dead assignment to buf which also causes leak 2019-02-20 16:23:30 -07:00
Paulo Matos
671611e992 Remove dead store for closure_size 2019-02-20 16:22:24 -07:00
Ryan Culpepper
d185257a75
add unsafe-poll-fd, unsafe-fd->evt (#2414)
The unsafe-fd->evt interface is based on unsafe-{file-descriptor,socket}->semaphore. 
The main differences are that these events are level-triggered, not edge-triggered, and 
they do not cooperate with ports created by unsafe-{file-descriptor,socket}->port.
2019-02-20 13:53:11 +01:00
Paulo Matos
166c97ecea
Fix missing parens
There's a paren mismatch introduced by a previous commit
2019-02-19 11:22:54 +01:00
Gustavo Massaccesi
5c1b1bf8cf fix with-syntax* when it has no patterns
This also fix define-inline for 0-arity functions.
2019-02-18 20:07:45 -03:00
Gustavo Massaccesi
3c4f160346 make file-stream-port? and terminal-port? total 2019-02-18 20:07:19 -03:00
Matthew Flatt
66f7e0c3e3 cs: fix slowness in set!, vector, and box operations 2019-02-18 11:59:28 -07:00
Matthew Flatt
f14d7e06bb Make noreturn attribute valid only for GNUC implementations
.. with an `exit` call to make the declaration clearly true to the
compiler.
2019-02-17 07:14:34 -07:00
Matthew Flatt
6117d8aff4 Revert "Make noreturn attribute valid only for GNUC implementations"
This reverts commit d033dd1ed2.
2019-02-17 07:09:48 -07:00
Paulo Matos
0124210b0b Avoid conn memory leak if try_connect fails (#2481) 2019-02-17 07:04:32 -07:00
Paulo Matos
41b282d3ae Merge pull request #2480 from LinkiTools/pmatos-clanganal-9
Avoid memcpy from null pointer in do_inotify_add
2019-02-17 07:04:06 -07:00
Paulo Matos
d033dd1ed2 Make noreturn attribute valid only for GNUC implementations 2019-02-17 07:03:46 -07:00
Paulo Matos
3e301d22b5 Mark scheme_raise_exn as noreturn - regenerate schemex
scheme_raise_exn raises an exception and doesn't return.
Static analysis tools find a huge amount of problems with regards
to memory leaks that are actually false positives because the tools
are not aware the function does not return. Marking it as such aids
further inspection of real problems.
2019-02-17 07:03:46 -07:00
Matthew Flatt
0567527be4 io: fix unsafe-poller
When asking a poller to register wakup events, handle an
"event is ready" response by canceling the sleep.

Closes #2482
2019-02-16 19:35:01 -07:00
Ryan Culpepper
edeae791ab syntax/parse: fix #:attr-name-separator, used by honu macros 2019-02-15 12:25:10 +01:00
Matthew Flatt
30e260835f fix \D, \S, \W in string regexp
The documentation and implementation were confused about whether \D,
\S, and \W match non-ASCII characters. Now they do. The new regexp
implementation (as used in Racket CS) already matched them.
2019-02-14 11:50:58 -07:00
Paulo Matos
f4c48dd9b5 Assigned value at initialization is never read
Assigning variable instead to NULL.
2019-02-14 08:11:50 -08:00
Paulo Matos
5ea27fc972 Remove unused variable did
Used to be useful but now it's no longer the case.
2019-02-14 08:10:24 -08:00
Paulo Matos
1722e49c85 Remove dead code
I understand what the idea is in this file, except this code won't
work like the author expected it to. Variables marked for wiping won't
be wiped unless they are marked as volatile. The compiler will simply
remove the code wiping the variables and issue a warning, which is
what brought me to look into this code in the first place.
2019-02-14 08:09:26 -08:00
Paulo Matos
136ea767e2 Free memory stored when error occurs - otherwise buffer leaks 2019-02-14 08:08:27 -08:00
Paulo Matos
14499aa822 Free buffer in case of unknown error - avoids memory leak 2019-02-14 08:07:49 -08:00
Paulo Matos
4014b066d1 Remove assignment - value stored to cpos is never read 2019-02-14 08:06:39 -08:00
Paulo Matos
04e6422c72 Ensure copied is not overwritten by another strdup causing a leak 2019-02-14 08:04:38 -08:00
Matthew Flatt
e7e9d02c9e native-libs: patches to adjust Pango font-face matching 2019-02-14 08:57:51 -07:00
Matthew Flatt
ecf3766d96 io: reduce overhead on display and write-bytes 2019-02-13 16:18:22 -07:00
Matthew Flatt
17c46c9c36 io: fix file and TCP ports as place messages 2019-02-13 10:48:55 -07:00
Matthew Flatt
a4bd83011b io: fix result of file-stream-port? 2019-02-13 10:41:12 -07:00
Matthew Flatt
5339a36187 io: fix file-stream-buffer-mode on file output ports 2019-02-13 10:20:04 -07:00
Matthew Flatt
c2d53143c1 io: improve syntax of internal class forms 2019-02-13 10:08:58 -07:00
Matthew Flatt
d197e1b8f4 io: adjust read-[bytes-]line to use direct buffer 2019-02-13 10:08:58 -07:00
Matthew Flatt
e266da929d io: fix pipe slow path and GC
Make the slow path faster by reducing input- and output-end
coordination. Also, avoid retaining one end just because the other end
is retained.

This change involves adding an indirection for the fast-path buffers
so that management for both ends of a pipe can be centralized
independent of the ports.
2019-02-13 10:08:58 -07:00
Matthew Flatt
f0aa8573fe io: repair some buffer + counting interactions 2019-02-13 10:08:58 -07:00
Matthew Flatt
6fb4097fef io: make fd-output-port use the fast path 2019-02-13 10:08:58 -07:00
Matthew Flatt
45347465df io: add output fast path
Add a fast path for output that is like input, based on a exposed
buffer. Make bytes-output-port and pipe use it.
2019-02-13 10:08:58 -07:00
Matthew Flatt
d6af78cebd io: convert tcp-{input,output}-port to object style 2019-02-13 10:08:58 -07:00
Matthew Flatt
01d53378b2 io: partial streamline of fd ports
Further improvements to move away from the `data` field.
2019-02-13 10:08:58 -07:00
Matthew Flatt
a382c6ca72 io: clean up unneeded scaffolding
Everything is converted, so we don't need the scaffolding anymore.
2019-02-13 10:08:58 -07:00
Matthew Flatt
40f27f8153 io: convert make-output-port to object style 2019-02-13 10:08:58 -07:00
Matthew Flatt
c57b52eb70 io: convert make-input-port to object style
Sortof. This is where we especially take advantage of vtable
flexibility. The methods of the vtable are really closures,
because that's far more convenient for custom ports.
2019-02-13 10:08:58 -07:00
Matthew Flatt
6e85165b3c io: convert fd-output-port to object style 2019-02-13 10:08:58 -07:00
Matthew Flatt
c28a0f45dc io: (mostly) keep fast path when line counting is enabled 2019-02-13 10:08:58 -07:00
Matthew Flatt
e3b00715bc io: convert fd-input-port to object style 2019-02-13 10:08:58 -07:00
Matthew Flatt
95083d6add io: add peek-via-read layer as prep for fd and custom ports 2019-02-13 10:08:58 -07:00
Matthew Flatt
35ceb8e3b3 io: convert pipe to object style 2019-02-13 10:08:58 -07:00
Matthew Flatt
78136c0613 io: convert bytes-output-port to object style 2019-02-13 10:08:57 -07:00
Matthew Flatt
d8521e8486 io: start conversion to classes
Change the internal port representation to an object-with-vtable
representation. The syntax looks similar to the class system of
`racket/class`, but everything is first-order: no class values, no
mixins, etc. Also, the vtable can contain non-procedures (like #f for
"not supported" or a port to mean a direcirection).

Using objects will make port instaces smaller and support a
reorganization to eliminate ad hoc `data`-field extensions. It will
also replace a half-step was was in place for byte input

Along with the conversion, change the way the fast path for writing
works: When possible, expose a shared buffer and index into that
buffer.

Only byte string input ports are really converted, so far. A
compatibility layer maps the old protocol to the new one, so
conversion can continue piecewise.
2019-02-13 10:08:57 -07:00
Matthew Flatt
e60b24c1a9 io: fix (find-system-file 'pref-file)
Corrects a mistake in 5c775fa04c.
2019-02-09 10:48:25 -07:00
Matthew Flatt
44368147f2 cs: small shortcut for mark lookup 2019-02-09 10:48:25 -07:00
Matthew Flatt
3c030b143b expander: extend "illegal use of syntax" error
Show the compile-time value that is not a procedure. While
this runs some risk of exposing details that are meant
to be private to a macro/language, a macro/language can
use an applicable structure to provide a more specific
error message. Meanwhile, showing the value is likely to
help for someone who needs to debug a macro problem.
2019-02-09 10:48:25 -07:00
Robby Findler
4ed5d7d98b added struct-guard/c 2019-02-09 09:18:58 -06:00
Matthew Flatt
5c775fa04c io: find-system-path and directory results
Use `path->directory-path` to ensure consistent trailing slashes.

Closes #2461
2019-02-07 09:12:12 -08:00
Matthew Flatt
2754d4e5a0 cs: avoid cont-mark conversion on capture
A conversion from assoc list to hash table is a leftover of a previous
stretegy, and it does not seem useful anymore.
2019-02-05 08:48:08 -08:00
Matthew Flatt
2abe2a48b4 bump version to sync cs changes 2019-02-05 08:23:37 -08:00
Matthew Flatt
e1cc9b2a80 cs: speed up sync on combination with never-evt 2019-02-04 06:42:33 -08:00
Matthew Flatt
61ca9ef474 cs: speed up break-enabled slightly 2019-02-04 06:23:15 -08:00
Matthew Flatt
b1bdcacabc io: slightly faster read-line 2019-02-03 15:28:18 -08:00
Matthew Flatt
af24a0318f io: faster read-char 2019-02-03 14:46:02 -08:00
Matthew Flatt
9823cbba4d io: reduce overhead on read-byte and read-char 2019-02-03 13:52:20 -07:00
Matthew Flatt
5ffb96e62d cs: reduce the cost of entering & exiting atomic mode 2019-02-03 10:33:15 -07:00
Matthew Flatt
80f84f2132 fix extflvector-length for platforms where it's not inlined 2019-02-02 19:38:41 -07:00
Matthew Flatt
db760fe748 makefile: avoid stderr more for Chez Scheme build 2019-02-02 13:13:22 -07:00
Matthew Flatt
acb2cfc465 git-checkout: doc repairs 2019-02-02 13:00:32 -07:00
Matthew Flatt
608005ac06 git-checkout: faster discovery of commit in common case
When the desired reference is not an advertised commit, then try
pulling just a few commits --- at depth 8, 16, and 32 -- from the
"master" branch to check whether the commit can be found that way. If
not, fall back to the exhaustive search that requires a full download.

This should help with the common case that a package reference into
the Racket repo is a few commits behind the current master branch
(because the package server hasn't scanned the repo recently enough).
It's much faster to disover that the commit is within the first 32,
which is almost always is, than to download the entire repository.
2019-02-02 11:13:10 -07:00
Matthew Flatt
7ea98c671c makefile: fix reconfigure for -MCR mode 2019-02-02 10:22:21 -07:00
Matthew Flatt
1affe4e7ad unbreak clean Mac OS build 2019-02-02 08:20:39 -07:00
Matthew Flatt
1b11111da3 raco pkg migrate: don't promote auto-installed
Upgrading an auto install to an explicit install runs into trouble if
the auto install is in a wider scope. It doens't seem necessary to
promote already-installed packages for migration, anyway.
2019-02-01 09:42:55 -07:00
Matthew Flatt
afd8c8fcac bump version for change to racketcs internals 2019-02-01 05:24:50 -07:00
Matthew Flatt
85edde8132 cs: use source names in errors about defined identifiers 2019-01-31 15:04:27 -07:00
Matthew Flatt
8b4075bd3d cs: reject certain srclocs in marshaled form 2019-01-31 15:04:27 -07:00
Matthew Flatt
cf72bace95 cs: fix printing of some symbols
Commit bd6cf17f92 wasn't the right repair.
2019-01-31 15:04:27 -07:00
Matthew Flatt
63fb08905b makefile: adjust in-place CGC/3m install to preserve CS install
Also, make an in-place CS install clean old versions in the same way
as a CGC/3m.
2019-01-31 15:04:27 -07:00
Ryan Culpepper
5ada142ee9 wrap-expr/c: improve performance, add #:arg?, fix pos/neg args
- Improve performance by using make-apply-contract, lifting,
  fast path for dependent flat contracts.
- The positive blame party now consistently means the *macro def*
  and the negative party means the *macro use*. The #:arg? argument
  controls blame swapping.
2019-01-31 15:38:39 +01:00
Ryan Culpepper
5f77da9f5d split out and provide make-apply-contract 2019-01-31 15:38:39 +01:00
Matthew Flatt
ccfa41e22c pkg: add missing flush to some status printouts 2019-01-30 16:40:19 -07:00
Matthew Flatt
4e39054b91 ffi/unsafe/objc: fix expand-time check of (system-type 'vm)
Don't make expansion depend on `(system-type 'vm)`, because expansions
should be VM-inpendent. For example, distribution builds use a single
expansion and finish up from there for different Racket
implementations.
2019-01-30 16:18:06 -07:00
Matthew Flatt
b9a28b368f expander: fix ".zo" mismatch errors to be exn:fail:read 2019-01-29 19:35:04 -07:00
Matthew Flatt
ed301f8a7c cs: skip check for module as an extension
The "extension" module protocol predates the modern FFI and depends on
the C API. Since it's not supported on Racket CS, skip the check for
extension modules.

Skipping the check can reduce load time considerably. We should
consider depracting the extension protocol for traditional Racket.
2019-01-29 19:34:49 -07:00
Matthew Flatt
33d7840a93 cs: fill in missing command-line flags 2019-01-29 14:59:14 -07:00
Matthew Flatt
c628414d6c avoid stderr output for cs build 2019-01-29 09:18:07 -07:00
Matthew Flatt
1cbc331532 unbreak no-places, no-futures build 2019-01-28 07:03:37 -07:00
Matthew Flatt
737ee9eba5 expander: fix flattener in machine-independent mode 2019-01-26 16:42:10 -07:00
Matthew Flatt
c9e3788d42 make effect of JIT_EAGER_JIT more complete 2019-01-25 19:20:03 -07:00
Matthew Flatt
13cb9bfc06 show peak code bytes in GC logging output 2019-01-25 15:39:36 -07:00
Matthew Flatt
bd6cf17f92 cs: fix printing of symbols that start #% 2019-01-25 14:39:58 -07:00
Matthew Flatt
a4821716d9 cs: wrap command-line eval in #%top-interaction 2019-01-25 14:39:40 -07:00
Matthew Flatt
f8448c4795 raco exe: disable --embed-dlls on RacketCS, for now
The RacketCS DLL currently doesn't work as embedded.
2019-01-25 12:42:17 -07:00
Matthew Flatt
7bc0364ec7 raco exe: fix --collects-dest for non-default "compiled" 2019-01-25 12:36:55 -07:00
Matthew Flatt
a80952e05f fix struct->vector on some renamed procedures
The repair is to give the structure type a name symbol. The rest is
cleanup and tests.

Closes #2454
2019-01-25 12:04:43 -07:00
Matthew Flatt
a97b3739a3 cs: add conversion to exn:fail:contract:non-fixnum-result 2019-01-24 19:44:04 -07:00
Matthew Flatt
77e362b27c io: fix 'update mode to not create a file 2019-01-24 19:30:29 -07:00
Matthew Flatt
74387d683b update racket/HISTORY.txt for 7.2
Please merge to v7.2
2019-01-24 08:26:58 -07:00
Matthew Flatt
0ae5ff7c1e fix typo in previous commit 2019-01-23 19:56:57 -07:00
Matthew Flatt
917a8f3aeb cs: fix GRacket-startup process-global registrations
This repair avoids an extra bounce and confused menu bar for DrRacket
startup, for example.
2019-01-23 19:51:09 -07:00
Matthew Flatt
8e5e5b9467 cs: improve procedure-result-arity 2019-01-22 17:34:49 -07:00
Matthew Flatt
3b99688275 regexp: repair extracting positions from string match 2019-01-22 10:32:36 -07:00
Matthew Flatt
82d8184ca9 cs: initial cut at procedure-result-arity 2019-01-22 10:32:36 -07:00
Matthew Flatt
602b797443 cs: eq? on flonums
Take advantage of a Chez Scheme patch that makes `eq?` work on
flonums.
2019-01-22 10:32:36 -07:00
Matthew Flatt
7bcf6afb62 cs: fix error message for vector* and box* operations 2019-01-22 10:32:36 -07:00
Matthew Flatt
1d7080fbb0 schemify: cover all too-early variable uses
Don't defer any too-early variable checks to Chez Scheme, because the
schmeify-inserted checks use the right names and include a reference
to the enclosing module.
2019-01-22 10:32:36 -07:00
Matthew Flatt
c47cbbf6c5 cs: add missing prompt-tag checks in mark lookup 2019-01-22 10:32:36 -07:00
Matthew Flatt
aed8d4f3e5 cs: left associativity for +, *, and variants 2019-01-22 10:32:36 -07:00
Matthew Flatt
fdb98da0b1 cs: repair primitives incorrectly exported in unsafe form 2019-01-22 10:32:36 -07:00
Matthew Flatt
299d80e830 cs: rewrite some error messages from Chez Scheme
At least interpose on the value->string part of constructing an
error message and use the Racket-level error-value->string handler.
2019-01-22 10:32:36 -07:00
Ryan Culpepper
218ed485e1 fix {DYLD,LD}_LIBRARY_PATH for starter with embedded dll-dir
closes #2450
2019-01-21 15:01:24 +01:00
Matthew Flatt
725af574fd io: fix some error corners of encoding conversion 2019-01-20 16:38:45 -07:00
Matthew Flatt
25a4f67912 fix char-numeric?
The `char-numeric?` function was missing some Unicode characters that
have the numeric property, because it was calculated from the wrong
field of UnicodeData.txt.
2019-01-20 15:04:42 -07:00
Matthew Flatt
53d4cdd2c7 cs: unbreal seconds->date 2019-01-20 09:33:05 -07:00
Matthew Flatt
dee990ff18 cs: implement phantom bytes
Mostly just connect to the implementation as a Chez Scheme addition.
2019-01-20 09:04:26 -07:00
Matthew Flatt
dc047d8922 cs & thread: enforce custodian limit on immediate allocations
For large vector, string, and byte string allocations, check
for limits on the current custodian.
2019-01-19 17:24:05 -07:00
Matthew Flatt
e93088dd2c cs: reject overlarge _array type
x
2019-01-19 15:07:43 -07:00
Matthew Flatt
c55c922e44 cs: fix callbacks from arbitrary threads
The "wakeup" function needs to be retained from the place
that will run the callback.
2019-01-19 15:03:03 -07:00
Matthew Flatt
dc58fccc4c cs: immutable string in seconds->date result 2019-01-19 13:54:24 -07:00
Matthew Flatt
bf2fac74f2 io: use PWD to initialize current-directory 2019-01-19 13:54:24 -07:00
Matthew Flatt
24121798bd io: more repairs to subprocess
Fix backwards tratment of `force?` in `subprocess-kill`, and
check for subprocess as valid supplied group.
2019-01-19 13:54:24 -07:00
Matthew Flatt
b4cc2d849c regexp: repair match results on large string 2019-01-19 13:54:24 -07:00
Matthew Flatt
74b34c210d io: fix decoding in get-output-bytes 2019-01-19 13:54:24 -07:00
Matthew Flatt
09b3b2fb3c io: fix file-stream? to always return a boolean 2019-01-19 13:54:24 -07:00
Matthew Flatt
cd56b670ca io: fix subprocess group creation 2019-01-19 13:54:24 -07:00
Matthew Flatt
21712fecc9 cs: print results of -e command-line expressions
Also, wrap an individual prompt around each evaluation.
2019-01-19 13:54:24 -07:00
Matthew Flatt
2fe2b7a8a7 cs: fix thread initial prompt and parameterization
The initial parameterization needs to be inside the initial prompt,
not outside.
2019-01-19 13:54:24 -07:00
Matthew Flatt
a2b1fbea3f io: speed up read-line a little 2019-01-19 13:54:24 -07:00
Robby Findler
962c7d4397 fix a bug in define/merge-cache
please include on the release branch
2019-01-18 21:08:36 +00:00
Jay McCarthy
7c08ded63b Fixes #2440 2019-01-18 16:20:47 +00:00
Matthew Flatt
422d5579b3 atan: exception on exact 0+1i or 0-1i, exact 0 on positive x
Change from treating exact 0+1i and 0-1i like the corresponding
inexact values.

Also, change from treating `(atan 0 x)` as exact 0 only when x is
exact. That's consistent with `angle` producing exact 0 for a positive
real number.
2019-01-17 20:08:49 -07:00
Matthew Flatt
f27c9330a5 magnitude: return +inf.0 for a complex with [+-]inf.0
... even if the oyther component is +nan.0. This change makes
`magnitude` consistent with the hypot() C-library function.
2019-01-17 19:58:39 -07:00
Matthew Flatt
f5babc4246 cs: more divide-by-zero exception conversions 2019-01-17 19:58:39 -07:00
Matthew Flatt
22b721be8a io: require absolute path for current-load-relative-directory 2019-01-16 21:29:01 -07:00
Matthew Flatt
a044c2ad05 io: conform to print-vector-length and print-struct 2019-01-16 21:15:34 -07:00
Matthew Flatt
11f12d69bd cs: fix hashing on vector cycles 2019-01-16 20:50:41 -07:00
Matthew Flatt
cddcd57267 regexp: fix O(size) behavior for large strings 2019-01-16 20:39:23 -07:00
Matthew Flatt
6c8ba483a1 regexp: fix consumption of bytes from a port 2019-01-16 20:39:19 -07:00
Matthew Flatt
b19671f0f5 regexp: fix matching on port given prefix bytes 2019-01-16 18:23:57 -07:00
Matthew Flatt
be19996953 read and string->number: fix large-exponent cutoff and # in fractions
The cutoff point for large-magnitude exponents (forcing a +inf,0 or
0.0 result) was wrong for bases below 10, and its did not take into
account the mantissa magnitude for some number forms.

Also, change the parsing of numbers with both `/` and `#` to be more
consistent. A `#` anywhere in the number should trigger an inexact
teratment 0 in the denominator (so inifnity or not-a-number instead of
divide-by-zero), even if `#` is only in the numerator. Meanwhile,
setting `read-decimal-as-inexact` to #f should count `#`s as `0`s and
not trigger inexact treatment.
2019-01-16 14:50:02 -07:00
Matthew Flatt
345339990f cs: repair some number-test failures 2019-01-15 20:30:53 -07:00
Matthew Flatt
349207d19f cs: repair procedure name, arity, and error-message support
The "procs.rktl" tests now pass.
2019-01-15 20:30:53 -07:00
Gustavo Massaccesi
c5a74c173e fix typos in error messages 2019-01-15 15:52:48 -03:00
Matthew Flatt
0aa2fdc476 cs: fix Mac OS install to include "Starter.app" 2019-01-14 20:04:44 -07:00
Matthew Flatt
95367b4b52 schmify: add some unsafe conversions
Explicitly substitute unsafe some non-primitives, which won't be
automatically substitued in Chez Scheme by compiling in unsafe mode.
2019-01-14 18:38:46 -07:00
Matthew Flatt
94a4f6d703 io: streamline bytes output port 2019-01-14 18:16:27 -07:00
Matthew Flatt
0e6c441f37 thread: break-suspend as a faster virtual register
Slightly speeds up atomic mode for io.
2019-01-14 18:03:21 -07:00
Matthew Flatt
ad2c0624b5 cs: fix struct proc names from make-struct-type 2019-01-14 14:53:49 -07:00
Matthew Flatt
40bc59d512 schemify: fix handling of #<void> as 'inferred-name
It's not supposed to suppress a srcloc-based name.
2019-01-14 09:07:42 -07:00
Matthew Flatt
8b9525f1c9 io: fix udp-set-receive-buffer-size! error reporting 2019-01-14 08:56:57 -07:00
Spencer Florence
75550e79cc fix finding first argument of make-pipe when more than one argument is provided 2019-01-14 08:45:47 -06:00
Matthew Flatt
2fe5f40dd7 io: fix logger bugs 2019-01-13 21:04:15 -07:00
Matthew Flatt
0602c7e21b cs: fix prop:chaperone-unsafe-undefined-triggered error 2019-01-13 18:13:14 -07:00
Matthew Flatt
4c53d3c380 cs: add missing unsafe-struct*-cas! 2019-01-13 09:42:50 -07:00
Matthew Flatt
f287f21ab2 cs: fix unsafe-[us]16vector-{set,set!} 2019-01-13 09:38:51 -07:00
Matthew Flatt
e9593749eb fix procedure names on syntax-source and related 2019-01-13 09:26:41 -07:00
Matthew Flatt
df93054d18 cs: dsiable srclocs for Rumble in stack trace by default 2019-01-13 08:41:53 -07:00
Matthew Flatt
6b52f9eedb cs: fill in procedure-name and srcloc interaction
Infer procedure names based on source locations, and suppress a
procedure name when it has #<void> for its 'inferred-name property.

Threading this information through the Chez Scheme layer involves a
hack, where a name starting with "[" indicates either "no name" or
"inferred from path".
2019-01-13 08:41:53 -07:00
Matthew Flatt
3b76e44730 cs: path adjustments on write and read of compiled code
Use `current-write-relative-directory`, etc.
2019-01-13 08:41:53 -07:00
Matthew Flatt
56846a9ca2 cs: guard against cyclic quoted constants
But only mutable hash tables and prefabs are relevant, since
no other serializable data has cycles and can get through
`datum->syntax`.
2019-01-12 14:25:58 -07:00
Matthew Flatt
a039248b9f cs: unbreak unsafe-get-place-table 2019-01-11 20:10:43 -07:00
Matthew Flatt
11120977b8 cs: add PLT_LINKLET_SHOW_CP0 2019-01-11 20:09:17 -07:00
dharmatech
0108bf43a9 cs/README.txt - fix typos 2019-01-09 15:31:28 -03:00
Matthew Flatt
7810232b67 no warning for unsupported long-term poll set operations 2019-01-08 18:52:32 -07:00
Matthew Flatt
1888663702 cs: fix unsafe-f64vector-{ref,set!} 2019-01-08 18:52:32 -07:00
Matthew Flatt
77c7b2b147 make-readtable: fix argument checking 2019-01-08 18:52:32 -07:00
Matthew Flatt
9aa0965aaa cs: switch to some system primitives
Replace some hacks with other hacks that are slightly more
respectible.
2019-01-08 18:52:32 -07:00
Matthew Flatt
eb3ba2052e cs: repair prompt around top-level evaluation 2019-01-08 18:52:32 -07:00
Matthew Flatt
8777d89eaf cs: fix exception raised by check-not-unsafe-undefined 2019-01-08 18:52:32 -07:00
Vincent St-Amour
09d25777d6 Post-release version for the v7.2 release 2019-01-07 10:29:01 -06:00
Matthew Flatt
53baa3f8cc src/makefile: adjust cs target to explain configure 2019-01-05 19:16:59 -07:00
Matthew Flatt
edcd1833e7 cs: move build/cs to build/cs/c
Use "cs/c" to be parallel to the source tree, because making them
different is asking for trouble (e.g., using `configure` without
a separate "build" directory goes wrong).
2019-01-05 19:00:32 -07:00
Matthew Flatt
f9c2a9395b remove "2018"s and "PLT Design"s 2019-01-05 16:31:57 -07:00
Matthew Flatt
52358ec42e small adjustments to udp-set-receive-buffer-size!
Minor adjustments to a commenably complete addition.
2019-01-05 16:31:57 -07:00
Greg Hendershott
4cd34ce10d Add udp-set-receive-buffer-size! 2019-01-05 14:56:25 -07:00
Greg Hendershott
ea663550a9 Fix rktio_create_console decl
The rktio/parse.rkt grammar doesn't handle empty argument lists and
was choking on this line, before it even got to my new line adding
rktio_udp_set_receive_buffer.

Fix by following example of using `(void)` instead of `()`. Two notes:

- I forget which variation of C or C++ requires (void) instead of ().

- Strictly speaking, this commit isn't part of the theme of this PR.
  If I squash the other commits down to one, maybe I should leave this
  separate.
2019-01-05 14:56:25 -07:00
Matthew Flatt
e99de2bf79 cs: implement custodian memory limits 2019-01-05 11:02:27 -07:00
Matthew Flatt
bcc9b2264e improve reporting of primitive-count startup error 2019-01-03 10:24:05 -07:00
Matthew Flatt
5a12d7bf71 cs: remove bound-identifier=? from '#%kernel table 2019-01-02 10:41:41 -07:00
Matthew Flatt
9731394e2a cs: ensure that arguments to foreign functions are retained
Make a call to a foreign function behave as in traditional Racket: the
arguments are considered reachable un their unwrapped forms until the
foreign function returns.
2019-01-01 16:30:39 -07:00
Matthew Flatt
709f327e4e io: remove incorrect symbol shortcut for format and "~s"
As exposed by a "print.rktl" test, the shortcut was wrong for symbols
that write with escapes.
2019-01-01 14:33:26 -07:00
Matthew Flatt
f85d18aed6 io: fix printing of '|| 2019-01-01 13:58:48 -07:00
Matthew Flatt
13e2817a2d fix typo in comment and sync "startup.inc" 2019-01-01 13:58:39 -07:00
Matthew Flatt
c60a081115 expander: fix bootstrap to work on RacketCS
The expander relies on an extra primitive when running on RacketCS.
2019-01-01 13:43:04 -07:00
Matthew Flatt
b9e1d23f0d cs: allow unsafe-undefined in variables
Distinguish "not initialized" from "value is unsafe-undefined".
Otherwise, `(dynamic-require 'racket/unsafe/undefined 'unsafe-undefined)`
 fails.
2019-01-01 13:27:05 -07:00
Matthew Flatt
dbabafa147 cs: support second argument to primitive-table
The two-argument mode is needed to support building RacketCs using
RacketCS.
2019-01-01 13:14:07 -07:00
Matthew Flatt
7797d3672b fix 'interior mode for malloc 2019-01-01 11:30:11 -07:00
Matthew Flatt
5cec8d52c2 schemify: fix quoted box in interpret mode 2019-01-01 09:19:18 -07:00
Matthew Flatt
7e83a6038a schemify: fix pessimization of constructor applications
A missing `unwrap` caused references to structure constructors to be
treated as potentially non-primitive procedures, which significantly
slows down calls to the constructor.

Probably, this started going wrong at a point where original names
were more consistently associated to defined identifier.
2018-12-31 14:16:31 -07:00
Matthew Flatt
21bbf1b42e cs: vfasl for Windows and Unix variants 2018-12-31 11:24:35 -07:00
Matthew Flatt
47d42d88cb cs: add -luuid for linking Chez Scheme on Linux 2018-12-31 10:09:24 -07:00
Matthew Flatt
846c40ff6c cs: restore vfasl 2018-12-31 08:16:45 -07:00
shhyou
c21beab167 Add sub-range-binder for define-logger 2018-12-30 18:39:34 -06:00
Matthew Flatt
e7c6efdaa8 cs: disable vfasl for now
Further testing uncovered a problem with vfasl loading.
2018-12-30 16:10:35 -07:00
Matthew Flatt
3c2003d01e cs: fix for fasl-related definition 2018-12-30 14:00:05 -07:00
Matthew Flatt
1052bc8dff unbreak cify build 2018-12-30 06:10:11 -07:00
Matthew Flatt
59246a0107 cs: fix call-with-immediate-continuation-mark and chaperones
Also, repair `call-with-immediate-continuation-mark` in tail
position with respect to a prompt.
2018-12-30 06:00:50 -07:00
Matthew Flatt
e37199cd7a cs: fix letrec
Report source name when accessing a variable too early, and allow
multiple returns (based on continuation capture) for the right-hand
side of a `letrec`.

The repair directly implements `letrec` as needed in terms of `let`
and `set!`, instead of relying on Chez Scheme's `letrec`, unless
right-hand sides are simple enough. Implementing `letrec` that way
risks losing Chez Scheme optimizations, but schemify takes care
of many improvements already.
2018-12-30 05:18:16 -07:00
Matthew Flatt
cea82c1ddc cs: use vfasl for boot files 2018-12-30 05:18:16 -07:00
Matthew Flatt
326e555146 expander: adjust stx serialization for RacketCS
Get more of the benefit of traditional Racket's lazy bytecode
unmarshaling by using an explicit `fasl->s-exp` stap on the serialized
form of syntax objects. This approach also avoids generating pointless
machine code for constructing the serialized form, effectively using
`fasl->s-exp` as an interpreter. The result is significantly smaller
".zo" files for RacketCS and slightly faater load times.
2018-12-30 05:18:16 -07:00
Matthew Flatt
75c30b4e2e cs: faster srcloc unmarshaling 2018-12-30 05:18:16 -07:00
Matthew Flatt
2c1cf20d17 cs: fix build to uncompress boot files
The uncompress step was broken by the switch to use "setup-go.rkt".
2018-12-22 18:35:56 -07:00
Matthew Flatt
86bbdab1de cs: reduce startup code size 2018-12-22 18:35:56 -07:00
Matthew Flatt
2fc594fcc4 cs: make public udp-bound? and udp-connected? safe 2018-12-20 21:31:43 -07:00
Matthew Flatt
d14238ae31 cs: fix udp-receive!
Closes #2433
2018-12-20 21:24:55 -07:00
Matthew Flatt
b38d437a00 file/untar: allow \0s for user and group ids
Some .tar packer (on Windows?) zeros out the user and group fields,
and `file/untar` doesn't use them anyway.
2018-12-19 19:34:39 -07:00
Sam Tobin-Hochstadt
9a42fab7fe Rebuild expander for b1e765ca31. 2018-12-13 16:00:17 -05:00
Sam Tobin-Hochstadt
c77388eeef Include radix in low-level error message. 2018-12-13 16:00:17 -05:00
Sam Tobin-Hochstadt
d2fdfe973e Fix expander demo to go with 19e709d27b. 2018-12-13 16:00:17 -05:00
Dan Feltey
a0fdee59b4
Add support for collapsible contracts (#2367)
* Add support for space-efficient vector and arrow contracts.

When an eleventh contract would be applied to a function or vector,
switch representation for the wrapper and try eliding redundant
checks. The resulting value keeps a constant number of
chaperone/impersonator wrappers regardless of the number of contracts
applied to it, and won't run any (provably) redundant checks.

This avoids a pathological case where, e.g., a function crosses a
boundary inside a loop, and gets wrapped N times (or worse, 2^N).

The optimization for function contracts currently only applies for
fixed-arity functions and contracts, and only for functions with known
result-arity of 1. These limitations are not fundamental.

Checking specific checks is not as optimized as for regular arrow
contracts yet. (Specifically: arity-specific wrappers and
tail-marks-match support is missing.) Again, not a fundamental
limitation.

Further described in the OOPSLA 2018 Paper: "Collapsible Contracts: Fixing a Pathology of Gradual Typing"

In collaboration with Ben Greenman, Christophe Scholliers, Robby Findler, and Vincent St-Amour.
2018-12-13 14:58:56 -06:00
Alexis King
15d0ccc2c0 Fix splicing-parameterize around begin 2018-12-13 14:28:50 -06:00
Alexis King
1d1245b092 Allow explicitly providing a parent logger to define-logger 2018-12-13 10:22:31 -06:00
Matthew Flatt
347f5b8ccf compiler/cm: unbreak dependency checking
Recent changes to adapt cm to cross-multi mode also attempted to
improve dependency checking to avoid prematurely committing to
compiling an old dependency, but that improvement was broken.
2018-12-12 08:44:06 -07:00
Matthew Flatt
aded42468e expander: fix use of root namespace for readers 2018-12-10 20:38:42 -07:00
Sam Tobin-Hochstadt
b1e765ca31 Check result of reading linklet hash. 2018-12-10 10:40:52 -05:00
Sam Tobin-Hochstadt
404964ea08 Reduce some build system dependencies. 2018-12-10 10:40:52 -05:00
Caner Derici
48cf9e54e3 regexp: add a target for writing the zo 2018-12-10 05:50:22 -07:00
Matthew Flatt
140043fb65 in-indexed: repair call to wrapped continue-after-pos+val?
Closes #2418
2018-12-09 12:27:29 -07:00
Matthew Flatt
24aeea28c1 file-position: repair for OS pipe after peek
Closes #2419
2018-12-09 12:16:10 -07:00
Matthew Flatt
db2ac559a7 compiler/cm: avoid rewriting machine-indepedent files
The multi-cross mode, don't rewrite a machine-indepedent file
by recompiling it to itself. This shouldn't matter, but not
touching files makes the result cleaner.
2018-12-09 11:02:09 -07:00
Matthew Flatt
344b72b4f8 cs: reconstruct let* in fallback interpreter
Representing nested `let`s as `let*` avoids a limitation
in Chez Scheme's `fasl-read`, for now.
2018-12-09 08:54:23 -07:00
Matthew Flatt
476bc8b879 schemify: lift "empty" closures to top of a module body
When a `[case-]lambda` form's only free variables are at the module
level, the Schemified form is a `[case-]lambda` form whose only free
variables are in an enclosing `lambda` for a linklet. Since those are
not completely closed, to make the allocation pattern consistent with
traditional Racket, Chez Scheme needs a hint to allocate the closures
once per linklet instantiation.
2018-12-09 08:54:23 -07:00
Matthew Flatt
0261332ac3 io: avoid closure allocations for pipes and byte-string ports 2018-12-09 08:54:23 -07:00
Matthew Flatt
bcf6492d56 io: reduce overhead of a byte string output port
Make it a thinner wrapper around the output half of a pipe.
2018-12-09 08:54:23 -07:00
Matthew Flatt
9f27b90e31 io: change port from table of functions to table of methods
Adjust the internal port representation to that it doesn't inherently
require allocating lots of closures.
2018-12-09 08:54:23 -07:00
Ben Greenman
0c2ada98ff json: improve 'bad input' error message (#2420)
When 'read-json' finds "bad input", print the input to try to show what
went wrong.
2018-12-08 16:31:58 -05:00
Matthew Flatt
a66038a427 io: shortcut for common format patterns 2018-12-07 11:03:53 -07:00
Matthew Flatt
0f413d38c5 cs: faster path for simple foreign calls 2018-12-07 09:53:49 -07:00
Matthew Flatt
45046f4c5d fix placement of "instantiate" starting counter 2018-12-07 07:53:56 -07:00
Matthew Flatt
99feebf070 ephemeron-value: add optional "retain" argument
When an ephemeron is accessed through a weak mapping from the same key
that is used in the ephemeron, and when the key is not otherwise
reachable, there can be a race between extracting the value from the
ephemeron and performing a GC that reclaims the key. Avoid that race
by supplying the key back to `ephemeron-value`, which ensures that the
key remains reachable until the value is extracted.

In many cases, supplying the key as the second argument would also
work --- since that argument is used as a replacement value when the
key is inaccessible, but the key can't become inaccessible if it's
pending as a replacement value. A separarate optional argument to
`ephemeron-value` seems clearer and more general, though.
2018-12-07 06:31:18 -07:00
Matthew Flatt
9ce4dd8770 raco exe: fix excessive memory use
Avoid retaining namespaces that are created to gather runtime paths.
If expansion generates a lot of instances with a lot of type
information, for example, this repair can save a lot of space.
2018-12-07 05:31:43 -07:00
Matthew Flatt
f9551bcaa5 remove accidentally committed debugging file 2018-12-06 16:48:49 -07:00
Matthew Flatt
beb8445d14 cs on Windows: almost support embedded DLLs
Wire in the pieces to make embedded DLLs work, but a DLL based
on Chez Scheme doesn't actually work as embedded, yet.
2018-12-06 16:46:48 -07:00
Matthew Flatt
fed7e5e95c reader: immutable vectors and boxes from read-syntax
Closes #1745
2018-12-05 16:26:57 -07:00
Gustavo Massaccesi
561fe7e2e7 cs: more pure primitives 2018-12-04 22:03:27 -03:00
Gustavo Massaccesi
ff5f2ae69a optimizer: (cdr <list?>) is a <list?>
In case it is not an error, the result is a list.
2018-12-04 18:34:21 -03:00
Ben Greenman
88b165314a
fix pair accessor error messages (#2413)
Change the error message for some functions like `caddr` so they
describe pair structures that they expect
2018-12-04 16:04:01 -05:00
shhyou
8043768b4c Support unsyntax-splicing in vector quasisyntax
If the sub-template inside #(...) is unsyntax-splicing instead
of list, produce the template #((~@! . ????)) instead of calling
(datum->syntax o list->vector o syntax->list). Fixes #2402.
2018-12-04 12:00:01 -06:00
Philip McGrath
b3104a6acd add #:result clause to for/lists and for*/lists 2018-12-04 10:12:43 -07:00
Matthew Flatt
6d8596bae3 raco setup: repair more problems with multi-cross mode
Fix some race conditions involving concurrent setup tasks that are
each trying to generate both machine-independent bytecode and
machine-specific bytecode.
2018-12-04 06:05:53 -07:00
Ben Greenman
b38ce36c92
glob: add 'glob-quote' (#2397)
add a function to escape any glob wildcards in a path or string

also add a private `glob-element->filename` function so that, e.g., the pattern
`a\*` matches the file named `a*` (previously, the match would fail and
I think it was impossible to match for only `a*`)
2018-12-04 00:21:14 -05:00
Matthew Flatt
e729d35915 bump version number
Should have bumped with 37929f2191.
2018-12-03 20:24:13 -07:00
Matthew Flatt
37929f2191 cs: make interp layer safe-for-space
Fix the fallback interpreter (which is used for the "outside" of a
module that is too big to compile) so that it's safe-for-space.

This change is unlikely to repair any immediate problems, but space
safety problems are difficult to detect and avoid when the underling
implementation is not safe-for-space so fixing the interpreter is
likely worthwhie in the long run.
2018-12-02 15:58:59 -07:00
Matthew Flatt
74abc61f03 cs: fix module-prompt handling in interpret mode 2018-12-01 09:33:23 -07:00
Matthew Flatt
0c6d22a04a hash-ref: guard against fixnum argument when JIT-inlined
Closes #2409
2018-12-01 06:22:08 -07:00
Matthew Flatt
3a19809268 compiler/cm: protect a ".dep" use against old versions 2018-12-01 06:00:49 -07:00
Matthew Flatt
b94f84a909 expander: load modules on demand for recompile 2018-11-30 22:54:10 -07:00
Matthew Flatt
68e105c0ed cs: prompts for module-body expressions
Module definitions and expression need to have a prompt around them to
delimit continuation capture, variable assignment needs to happen at
the right point to ensure that reassignment is guarded and
non-assignment is detected. But avoid the prompt when it's not needed,
such as around function definitions.

Closes #2398
2018-11-30 22:54:10 -07:00
Matthew Flatt
6f0748108c cs: fix module-variable initialization order
Similar to a255def019, but for side effects potentially
exposed by definition RHS expressions, instead of
expressions not in a definition. Improve that commit and
this one by only forcing variable assignments at non-simple
expressions.
2018-11-30 22:54:10 -07:00
Matthew Flatt
8b15ad971c cs: fix embedded modules in places 2018-11-30 22:54:10 -07:00
Matthew Flatt
f2fb2ebc55 racketcs: fix command-line handling after non-flag argument 2018-11-30 22:54:10 -07:00
Philip McGrath
bd7de80d98 raco pkg new: Remove deprecated sudo: false from .travis.yml
Travis is eliminating its container-based infrastructure
and deprecating the `sudo` keyword.

This commit also updates the example build matrix to use
more recent Racket versions.

Corresponds to https://github.com/greghendershott/travis-racket/pull/29
2018-11-29 19:21:13 -05:00
Matthew Flatt
2e3b16f77c makefile: fix redundant path separators 2018-11-29 10:08:19 -07:00
Matthew Flatt
e607ae09de makefile: speed up make in "cs" build directory
Take advantage of ".d" files that are already generated to speed up a
`make` in the "cs" build dierctory when nothing needs to be done.
2018-11-29 09:41:49 -07:00
Philip McGrath
2798608ccd cs: fix error message from raise-argument-error
Closes https://github.com/racket/racket/issues/2400
2018-11-28 06:19:12 -07:00
Matthew Flatt
a7499ab854 expander: more determinsitic machine-independent "bytecode"
Discard local-variable names to avoid `gensym` artifacts in the same
way that a more complete compilation would discard the names. This
change does not affect function names, which are preserved through
separate properties.
2018-11-27 20:01:43 -07:00
Matthew Flatt
8c6af1a234 expander: avoid format in common paths
Use `string-append`, `symbol->string`, etc., instead of `format` for
constructing some symbols.
2018-11-27 19:26:59 -07:00
Matthew Flatt
432dfcdb4a hash-{map,for-each}: strengthen try-order? guarantee
Promise a specific order for a hash table that uses only certain
primitive, non-compound datatypes for keys.
2018-11-27 17:50:48 -07:00
Matthew Flatt
5f940e462e call-with-atomic-output-file: option to make Windows moves more atomic
It most cases, it's more important for `compiler/cm` to reliably
replace a file that might be busy than to make the file update atomic.
To suport that kind of use, `call-with-atomic-output-file` implemented
a fairly reliable, multi-step, non-atomic process for replacing a file
on Windows.

For recompilation of bytecode in machine-independent form, however,
`compiler/cm` now really wants to atomically write a replacement
bytecode file. That's not generally possible on Windows (except on
NTFS with transactions, which are discouraged...), but MoveFileEx work
atomically in some cases and it's likely to work for the cases needed
by `compiler/cm`. Probably.

So, add a mode to `call-with-atomic-output-file` to get "more atomic"
updates on Windows. This mode is enabled by a callback that makes the
caller responsible for deciding what to do with the move fails, such
as waiting a while and trying again. And `compiler/cm` now waits a
while and tries again, up to a limit, which should be good enough for
recompilation.
2018-11-27 09:47:11 -07:00
Robby Findler
b68866db0f added object=-hash-code 2018-11-27 16:00:24 +01:00
Matthew Flatt
a001b5b231 raco setup: multi-machine cross-compile support
Enable `raco {setup|make}` to build two sets of compiled files: one
set that is suitable for the current machine, and another set that is
suitable for a different machine or for all machines (i.e.,
machine-independent bytecode).

In the long run, this new `raco setup` mode support cross compilation
where the build machine and target machine have different bytecode
formats --- unlike the current cross-compliation mode, which relies on
there being a single bytecode format in traditional Racket for all
platforms.

In the short run, the new mode enables the faster creation of
Racket-on-Chez distribution builds. The build server can send out
machine-independent bytecode to client machines while using
machine-specific bytecode for itself to drive the build process.

The new compilation mode relies on a somewhat delicate balance of the
`current-compile-target-machine` and `current-compiled-file-roots`
parameters (as reflected by the `-M` and `-R` command-line flags for
Racket) as well as cross-compilation mode (as enabled by the `-C`
command-line flag).
2018-11-26 19:49:33 -07:00
Matthew Flatt
4a080ada04 system-type: add 'target-machine
The 'target-machine result from `system-type` reports the
default value of `current-compile-target-machine`.

Also, fill in pieces to make `setup/cross-system` work
for RacketCS, although cross-compilation is still several
steps away.
2018-11-25 12:10:09 -07:00
Matthew Flatt
7cdf9f1c0b raco setup: remove -M/--compile-any
This commit mostly reverts 9441f7075f, because it looks like relying
on `racket`-level configuration is the right idea after all.
2018-11-25 12:10:09 -07:00
Matthew Flatt
695e270197 compiler/cm: avoid race in recompile
The new path for recompiling from machine-independent files
trues to read a ".zo" file without holding the recmopilation
lock and without an `exn:fail:filesystem` handler.
2018-11-25 08:11:21 -07:00
Matthew Flatt
3833a22f75 setup: leave cm trace handler alone in places
When `--vv` is not provided, leave the default `compiler/cm` trace
handler in place so that logging works as intended.
2018-11-25 08:06:28 -07:00
Matthew Flatt
055642a40a raco setup: less eager removal of ".zo" files
Wait until replacement is more assured before deleting an existing
".zo" file.

Also, don't delete a ".zo" file that is later in the
`current-compiled-file-roots` search path than the one being written.
This refinement supports setting up a search path to try
machine-specific compiled files and fall back to machine-independent
files, for example.
2018-11-24 19:39:01 -07:00
Matthew Flatt
a70c1b5242 compiler/cm: add missing version check 2018-11-24 12:02:41 -07:00
Matthew Flatt
1d2a7dec62 raco setup: show target machine in startup info 2018-11-24 11:46:36 -07:00
Matthew Flatt
9441f7075f raco setup: add -M/--compile-any
Add `-M`/`--compile-any` to `raco setup`, `raco pkg install`, etc., to
build machine-independent bytecode, which is useful in the process of
building distributions.
2018-11-24 11:19:09 -07:00
Matthew Flatt
0bc010d972 raco setup: avoid recompilation in parallel mode
The `parallel-lock-client` protocol expects a #f back when a
file was meanwhile compiled by another process. So, don't
just forget about a file after it is compiled, in case there
is still a lock request on the way for that file.
2018-11-23 18:14:42 -07:00
Matthew Flatt
4946196c91 recompile-linklet: accept option argument
Add an options argument for consistency with `compile-linklet`.
2018-11-23 18:04:48 -07:00
Matthew Flatt
ac70e9a058 compiler/cm: detect and take recompilation shortcut
When a module is compiled to platform-independent form, recompile from
that form for the current platform, instead of recompiling from source.
2018-11-23 17:59:20 -07:00
Matthew Flatt
1c437793a6 expander: fix another recompilation problem
Fix merging of extra-inspector sets, which recompilation ignores
anyway.
2018-11-23 11:28:51 -07:00
Matthew Flatt
600a6b4c29 expander: fix compiled-expression-recompile
Linklets other than the body linklet may need conversion from
machine-independent form to machine-specific form.
2018-11-23 09:58:02 -07:00
Matthew Flatt
d6802444fa cify: repair bytes-ref and bignum handling
These problems were exposed by cifying `racket/fasl`.
2018-11-23 08:03:45 -07:00
Matthew Flatt
f47f685af9 schemify: fix srcloc marshaling
Partly fix it, anyway. More is needed in general to reduce
recording build-time paths in compiled code.
2018-11-22 19:31:46 -07:00
Matthew Flatt
19e709d27b revise compile-target parameter
Replace `compile-machine-independent` with
`current-compile-target-machine` to set up
better for future cross-compilation support.
2018-11-22 17:36:31 -07:00
Matthew Flatt
c5f000c4fc expander: recompile converts from machine-independent to -specific
Actually, the machine-independent-to-specific part is trivial. The
hard part was making `compiled-expression-recompile` enable
cross-linklet optimization as it recompiles, since that involves
pulling apart metadata and putting it back together afterward.
2018-11-22 16:39:55 -07:00
Matthew Flatt
2bbaa64cd6 add machine-independent compilation mode
The `compile-machine-indendent` parameter controls whether `compile`
creates a compiled expression that writes (usually in a ".zo" file) to
a machine-independent form that works for anhy Racket platform and
virtual machine. The parameter can be set through the
`-M`/`--compile-any` command-line flag or the `PLT_COMPILE_ANY`
environment variable.

Loading machine-independent code is too slow for many purposes, but
separating macro expansion from backend compilation seems likely to be
a piece of the puzzle from cross-compilation and faster distribution
builds.
2018-11-22 13:41:36 -07:00
Matthew Flatt
d84d35870a expander: fix set! in namespace from module->namespace
Closes #2369
2018-11-22 07:21:30 -07:00
Matthew Flatt
ad14cca1e8 expader: fix caching for flattening 2018-11-22 06:39:38 -07:00
Matthew Flatt
fd462604bd cs: make gensym add a counter for the printed form
Although the counter doesn't make the generated symbol any more
distinct, it's often a helpful hint.

Closes #2396
2018-11-22 05:43:53 -07:00
Sam Tobin-Hochstadt
df88852e24 Additional files to ignore. 2018-11-21 12:39:56 -05:00
Sam Tobin-Hochstadt
18afdb54d6 Use linklet functions from '#%linklet instead of from lower level. 2018-11-21 12:39:56 -05:00
Matthew Flatt
744d440ab9 schemify: ensure that deserialized constants are immutable
Closes #2394
2018-11-21 10:16:19 -07:00
Matthew Flatt
669e51768d io: normalize path to current-directory[-for-user]
Closes #2393
2018-11-21 09:58:16 -07:00
Matthew Flatt
299692a38a io: fix initial print-as-expression value
Closes #2391
2018-11-21 09:48:14 -07:00
Matthew Flatt
e5bfba5f3c cs: repairs for byte-string comparison operators 2018-11-21 09:38:32 -07:00
Matthew Flatt
7231f11b60 cs: don't treat crashes as constract errors
Converting "invalid memory reference" to an `exn:fail:contract` (which
is the default conversion) hides crashes as success when a test
expects an error.

Also, fix a bug that was hiding as an expected excdeption.
2018-11-21 09:28:28 -07:00
Matthew Flatt
701854a404 expander: remove unused require of racket/fasl 2018-11-21 09:08:48 -07:00
Matthew Flatt
13fa23e79a unbreak cify build 2018-11-21 08:37:48 -07:00
Matthew Flatt
6f6d121611 move linklet bundle and directory to expander layer
The Racket and RacketCS implementations had separate copies of
linklet-directory and linklet-bundle reading and writing. Move the
implementation into the expander layer.

The primitive '#%linklet instance now omits directory and bundle
operations and `read-compiled-linklet`. It intead must provide
`write-linklet-bundle-hash`, `read-linklet-bundle-hash`, and
`linklet-virtual-machine-bytes`.
2018-11-21 07:23:50 -07:00
Robby Findler
8cee5a09da improve the redundancy checking for class contracts
In particular, when there isn't any redundancy detected, then
just make a single call into the projection and create just a single
class.

This seems to help on at least one of the configurations of
dungeon, which completes in about 6 minutes with this commit
and I gave up waiting after 15 minutes for the version of
racket that didn't have it
2018-11-20 21:30:39 -06:00
Gustavo Massaccesi
b4e3030a0d rumble: fix some type checks in bytes.ss 2018-11-20 16:50:50 -03:00
Sam Tobin-Hochstadt
940e46df6c Rebuild expander.
Should have been included in 1258d9d28.
2018-11-20 11:56:28 -05:00
Sam Tobin-Hochstadt
1258d9d28a
Point to body forms in missing-expression error. (#2356)
Improves the error message for:

```
(define-syntax (like-lambda stx)
  (syntax-case stx  ()
    [(_ e) #'(lambda () e)]))

(like-lambda (define x 1))
```

Based on a report from @pkoronkevich.
2018-11-20 11:43:28 -05:00
Matthew Flatt
daed85e1dc setup/dirs: fix cases where paths are unavailable
When an executable distibution is created, some path become
unavailable at run time, such as the result of `find-links-file`.

Change the contract on those functions and adjust the implementation
to return `#f` in those cases. This is a backward-compatible change in
the sense that uses that now return `#f` would have crashed before
(although it does shift the blame in that case).

Based on an initial patch by Shu-Hung.

Closes #2352
2018-11-19 19:15:49 -07:00
Sam Tobin-Hochstadt
c1d2e4031e
Guard free-identifier=? comparisons in shared. (#2382)
Fixes #2381.
2018-11-17 22:26:11 -05:00
Alex Feldman-Crough
c4189ff934 untar: treat the tag #\nul as a synonym for #\0
The GNU Tar manual (at
https://www.gnu.org/software/tar/manual/html_node/Standard.html) says
that older archives may have the typetag AREGTYPE (\0) instead of
REGTYPE ('0'), and that AREGTYPE should silently be treated as
REGTYPE.
2018-11-17 18:00:15 -07:00
Matthew Flatt
ef9e9e3f7e cs: check initialization of variables on instance linking 2018-11-17 16:44:08 -07:00
Matthew Flatt
a255def019 cs: fix state of module instance interrupted by error
Closes #2380
2018-11-17 16:30:56 -07:00
Matthew Flatt
d47d036239 cs: fix dynamic-wind on chaperoned procedure 2018-11-17 15:58:46 -07:00
Matthew Flatt
64069a5792 cs: initialize error-value->string-handler per place
Closes #2377
2018-11-17 15:15:23 -07:00
Matthew Flatt
f6eb956199 cs: fix error with a single symbol argument
Closes #2379
2018-11-17 15:06:55 -07:00
Matthew Flatt
c1c110f662 makefile: accomodate current Mingw-64
As of version 5.0.5, Mingw-64 adds an ".exe" extension even if it's
not in the `-o` argument. Adjust the makefiles to consistently use
".exe".
2018-11-17 15:03:15 -07:00
Matthew Flatt
c44c8b9cc0 cs: implement best-effort-ordered hash table traversal 2018-11-16 16:53:54 -07:00
Matthew Flatt
a6e37fc947 racket/fasl: improve determinism of output
When traversing hash tables, try to sort the keys.
2018-11-16 16:36:56 -07:00
Matthew Flatt
624918d399 expander: remove obsolete and broken to-source? compile mode
Source mode was a leftover from early iterations of the expander. A
bootstrapping mode that uses replacement `compile-linklet`, etc.,
turned out better.
2018-11-16 16:21:28 -07:00
Matthew Flatt
709258d88c reorganize and update "README.txt"s about sources and builds
Integrate Racket-on-Chez information better and reorganize information
to reflect the way that the makefiles and build scripts have evolved.
2018-11-16 07:49:53 -07:00
Matthew Flatt
337aec3436 cs: fix -C flag to set (system-type 'cross) 2018-11-15 18:17:05 -07:00
Matthew Flatt
7c1326a120 io: fix subprocess waiting for Windows 2018-11-15 14:57:09 -07:00
Caner Derici
331b383103 fasl: make sure every write-bytes know where to write (#2373)
adding tests that fail without this fix
2018-11-15 16:53:53 -05:00
Matthew Flatt
06101ffb89 cs & io: fix current-directory initialization 2018-11-15 10:02:57 -07:00
Matthew Flatt
6d1b287467 io: fix (find-system-path 'orig-dir) 2018-11-15 09:37:28 -07:00
Matthew Flatt
a6cc19648f cs: allow Racket framework to find itself not in "CS"
The installer-signing process can copy the framework to an application
directory that does not have "CS" in its name.
2018-11-15 06:35:03 -07:00
Matthew Flatt
a9b02d5956 schemify: fix some function names when saving "bytecode" 2018-11-15 05:29:36 -07:00
Matthew Flatt
3e480f1c93 io: fix current-directory and related parameters
For consistency with traditional Racket, the guards need to be
implemented through derived parameters instead of chaperones.
2018-11-15 05:29:36 -07:00
Matthew Flatt
caf28648e3 cs: fix schemify of non-rator call-with-values 2018-11-15 05:29:36 -07:00
Matthew Flatt
4068b9097d io: fix some test failures 2018-11-15 05:29:36 -07:00
Matthew Flatt
1e726581ef io: TCP port does not count as a file-stream port 2018-11-15 05:29:36 -07:00
Matthew Flatt
bf7eee0f65 thread: fix atomic-timeout-callback implementation
Closes racket/drracket#238
2018-11-14 16:59:16 -07:00
Sam Tobin-Hochstadt
cf34c22380
fasl: find shared values in hash tables. (#2371)
Also, add test to check sharing of uninterned symbols.
2018-11-14 18:45:54 -05:00
Matthew Flatt
c51616ecfd cs: fix typo in Windows build script 2018-11-14 15:47:57 -07:00
Matthew Flatt
60a6dc1796 setup: adjust command-name hack for case-insensitive Windows 2018-11-12 14:58:30 -08:00
Matthew Flatt
0b7072eed3 cs: communicate DLL directory to rktio
rktio needs the DLL directory path to load iconv.
2018-11-12 15:50:14 -07:00
Paulo Matos
28a28e4244 Use constant defined in header 2018-11-12 15:34:44 -07:00
Matthew Flatt
ccbef59e96 io: print: handle paths that don't convert cleanly to a string 2018-11-12 14:33:09 -08:00
Matthew Flatt
7abfdab35e io: repair directory-list for Windows 2018-11-12 14:25:44 -08:00
Matthew Flatt
9e4ebd9196 rktio Windows: fix truncate-file to not move file position
A call intended to restore the position was in place, but it
was wrong.
2018-11-12 09:37:02 -08:00
Matthew Flatt
8e4cecf215 io: flush before performing file truncate
For consistency with traditional Racket and currently matters on
Windows. The Windows implementation of file-truncate should probably
not move the file position as it does, though.
2018-11-12 09:59:35 -07:00
Matthew Flatt
0d4674a6e1 cs Windows: fix manifest on GRacket 2018-11-11 07:18:34 -08:00
Matthew Flatt
7ab69142f4 cs: fix exec-file and run-file setup
Allow embedded command-line argument to adjust exec-file, for
example.
2018-11-11 08:11:17 -07:00
Matthew Flatt
f10e6d43bf rktio: avoid triggering console when starting a place 2018-11-11 05:57:03 -08:00
Matthew Flatt
67b721e5b7 Windows: move on-demand console to rktio
In GUI-application mode (e.g., running GRacket), a console is allocated
on demand if a program tries to use the original ports. Move that
on-demand handling into rktio, where it's simpler and works for
RacketCS.
2018-11-11 06:14:22 -07:00
Matthew Flatt
7fa31684e9 io: show a string as a port name 2018-11-10 15:18:09 -07:00
Matthew Flatt
d0fab4027b net/win32-ssl: repairs for CS 2018-11-10 14:17:07 -08:00
Matthew Flatt
350ecf3d49 expander: don't duplicate properties in 'origin handling
One more take on the problem addressed by 990e1f1e30. This adjustment
avoids copying properties from the original form to the identifier
that is preserved in 'origin.
2018-11-10 07:52:04 -07:00
Paulo Matos
fca1c430af Fix typo 2018-11-10 08:43:12 -03:00
Matthew Flatt
90aac96cde expander: fix taint problem with 'origin handling
Repairs a problem with commit 990e1f1e30.
2018-11-09 20:50:10 -07:00
Matthew Flatt
990e1f1e30 expander: fix origin tracking for int-defn contexts
Closes #2346
2018-11-09 13:51:16 -07:00
Alexis King
bc34ba884b Reinstate the stop list after #%module-begin performs partial expansion 2018-11-08 19:13:03 -06:00
Matthew Flatt
b7c2359026 compiler/cm: adapt as intended to old .dep files
Try again on 1293674ddb.
2018-11-03 17:05:34 -04:00
Matthew Flatt
1293674ddb compiler/cm: don't misue old .dep files
The `get-compiled-file-sha1` function assumed that a ".dep" file is
up-to-date when present. That may not be consistent with all uses,
including in `file-stamp-in-paths` as used by DrRacket for "populate
compiled", and an old file can go wrong with the recent ".dep" format
change. Make `get-compiled-file-sha1` at least check the version on
the ".dep" content before trying to use it.

Relevant to #2354
2018-11-02 20:28:08 -06:00
Alexis King
93def1f753 Fix stream contracts to work with impersonator contracts 2018-11-02 11:24:39 -05:00
Matthew Flatt
62a674fa80 io: exn:fail:network for TCP-port errors 2018-11-02 05:00:16 -07:00
Matthew Flatt
6a7f9773d1 cs: fix _stdbool 2018-11-01 16:49:10 -06:00
Kevin Robert Stravers
22cf2750a7 cmdline: three/four items -> three items 2018-11-01 14:48:20 -05:00
Leif Andersen
209a90d281
Make racket/private/serialize-struct cross-phase (#2270)
This makes sense because a serializable struct should probably remain
serializable, even if it was inserted into a bit o' 3d syntax.
2018-10-30 15:41:08 -04:00
Matthew Flatt
c0fac954e1 windows: declare Windows 10 compatibility in manifest 2018-10-30 09:55:33 -07:00
Matthew Flatt
7e926d1d86 raco exe: fix alignment in PE resource writer 2018-10-30 09:55:33 -07:00
Matthew Flatt
b9c042329b cs makefiles: fix a make that should be $(MAKE)
Relevant to #2344
2018-10-29 20:42:03 -06:00
Matthew Flatt
0242a46396 cs: more portable approach to errno
Have the main Racket executable export a function to get errno, which
avoids portability problems trying to access it via the FFI.

Related to #2344
2018-10-29 20:39:01 -06:00
Matthew Flatt
063fa65872 cs: add (system-type 'machine)
Closes #2343
2018-10-29 20:10:13 -06:00
Ryan Culpepper
ec406dd301 cs: fix lookup-errno 2018-10-29 11:12:58 +01:00
Matthew Flatt
933e3c14b5 bytecode: fix "preserves marks" annotation w.r.t call/immediate-mark
A function that uses `call-with-immediate-continuation-mark` in tail
position should not be flagged as "preserves marks", because the JIT
needs to bump the mark stack if the function is called in non-tail
position.

Closes #2333
2018-10-28 18:52:41 -06:00
Matthew Flatt
d1fe6a6e3e repair allocation bug in delimited continuations
The repair is more precisely a repait to xform, which incorrectly
parsed a C function definition that starts "struct" as a struct
declaration. (The function starts "struct" because the return type is
"struct Scheme_Overflow_Jmp *".) Since the function wasn't recognized,
xform didn't convert it to cooperate with the garbage collector.

Closes #2341
2018-10-28 17:09:45 -06:00
DarrenN
2dc96b365a Implement hash/c random generate and exercise 2018-10-28 14:37:59 -05:00
Matthew Flatt
dbcc9dddc3 xform: updates for recent MinGW 2018-10-28 13:14:14 -06:00
Matthew Flatt
b5084977c0 cs Windows: fill in GUI mode for GRacket
Still need to create console on demand.
2018-10-28 13:14:14 -06:00
Matthew Flatt
a24c6fe4f9 cs Windows: move kernel and boot files to DLL 2018-10-28 11:37:04 -06:00
Matthew Flatt
c6a3d4629d cs: register a nul-terminated byte string for WM_CLASS 2018-10-27 15:22:00 -06:00
Matthew Flatt
a08aed7dde configure help: clarification on --enable-sgcdebug
Closes #2340
2018-10-27 13:43:38 -06:00
Paulo Matos
c6a2843ba2 Fix simple typo in configure help message 2018-10-27 13:42:24 -06:00
Paulo Matos
071406d10d Mark variables as used so they are not removed by LTO
Fixes #2324
2018-10-27 13:39:12 -06:00
Matthew Flatt
de53dc3c5e cs: add Windows GRacket.exe 2018-10-27 13:23:40 -06:00
Matthew Flatt
c128c5aad6 cs: support ptr-ref and ptr-set! on string types 2018-10-27 11:14:42 -06:00
Matthew Flatt
3f6a7b3e06 cs: add icon and other resources to RacketCS.exe 2018-10-27 11:14:42 -06:00
Matthew Flatt
457a673506 Windows: avoid environment variables with empty name 2018-10-26 13:42:16 -07:00
Matthew Flatt
29a80fd7e5 io: repairs for Windows environment variables 2018-10-26 14:19:54 -06:00
Matthew Flatt
23648ba165 cs: repairs relevant to running `racket/gui/ programs on Unix 2018-10-26 14:05:33 -06:00
Matthew Flatt
3b9bc21304 cs: repairs to Windows build client 2018-10-26 11:04:45 -06:00
Matthew Flatt
7d86fddbdc cs: add strip on install for CS executables 2018-10-25 11:30:17 -06:00
Matthew Flatt
c0f14373ab cs: on Linux record embedded boot relative to ".rackboot" section 2018-10-24 21:06:11 -06:00
Matthew Flatt
8c3956a272 cs: update Windows build
Support non-"CS"-suffix mode, and avoid installing bytecode for
traditional Racket when builing a bootstrap traditional Racket.
2018-10-24 18:44:23 -07:00
Alexis King
af554933ef Fix arity mask upper bound calculation in curry
fixes #2332
2018-10-24 12:16:09 -05:00
Matthew Flatt
fce5554695 io: fix tcp-abandon-port so that the socket gets closed 2018-10-24 09:53:00 -06:00
Ryan Culpepper
e8832fbcc7 cs: remove plumber flush callback when custodian closes fd output port
Previously, the following program would print "error writing to
stream port" on program exit.

  (define cust (make-custodian))
  (define out
    (parameterize ((current-custodian cust))
      (open-output-file "test.data" #:exists 'truncate)))
  (write-string "This needs flushing...\n" out)
  (custodian-shutdown-all cust)
  (exit 0)
2018-10-24 17:46:29 +02:00
Ryan Culpepper
ddba2812ba cs: fix unsafe-file-descriptor->port mode 2018-10-24 17:46:29 +02:00
AlexKnauth
df19625c6c syntax/parse: fix Check-Syntax arrows within syntax classes 2018-10-24 17:45:30 +02:00
Matthew Flatt
23f6d2b43f cs: setup compiled subdirectory for gracket like racket 2018-10-23 21:38:43 -06:00
Sam Tobin-Hochstadt
423ce5e5a2 This file doesn't need match. 2018-10-23 11:56:49 -04:00
Matthew Flatt
8473666af3 cs install: remove old file before coying new files into place 2018-10-23 09:45:53 -06:00
Ryan Culpepper
d4691fb219 fix flush-output when write-out is port indirection 2018-10-23 12:00:31 +02:00
Matthew Flatt
31d35ebe88 cs: another fix for racketcs linking configure on Linux 2018-10-22 20:38:29 -06:00
Matthew Flatt
76f868f287 cs: fix racketcs linking configure for Linux 2018-10-22 20:32:07 -06:00
Matthew Flatt
f8e6b22544 cs: fix makefile chaining for bootstrap Racket variant 2018-10-22 20:14:50 -06:00
Matthew Flatt
7481eb6fed update another test for the VM identifier in bytecode 2018-10-22 19:53:21 -06:00
Matthew Flatt
cbd195201a cs: disable use of ncurses when building Chez Scheme
RacketCS doesn't currently access the Chez Scheme expeditor, and
avoiding curses make the build work in a more mininal environment.
2018-10-22 19:18:35 -06:00
Matthew Flatt
aa6ec1f0cd comiler/compile-file: adapt to use-compiled-file-paths setting 2018-10-22 17:14:49 -06:00
Matthew Flatt
9498c521cf cs: make build without "cs" suffix use "compiled" directly
When building RacketCS as just "racket", put compiled files in
"compiled" instead of a platform-specific subdirectory.
2018-10-21 18:27:00 -06:00
Matthew Flatt
8bed64f44f add virtual-machine identifier to bytecode and ".dep" files
So far, bytecode for traditional Racket has been kept separate from
RacketCS bytecode by using a different "compiled" subdirectory for
RacketCS. That makes sense for development work to allow the
implementations to coexist, but it creates trouble for packaging and
distributions, and it (hopefully) won't seem necessary in the long
run. Treating the different virtual machines like different versions
seems more generally in line with our current infrastructure.
2018-10-21 17:33:24 -06:00
Matthew Flatt
e3f25a6159 reorder configure scripts
Run last one of the scripts that can show the
installation-directory information correctly.
2018-10-21 08:07:45 -06:00
Matthew Flatt
3c4fa62e28 cs: configure and makefile corrections for --prefix installation 2018-10-21 07:40:18 -06:00
Matthew Flatt
abc5c9cdef cs: propagate CC, etc., to Chez Scheme configure 2018-10-21 06:38:12 -06:00
Matthew Flatt
51258bc77c cs: add support for -A 2018-10-21 05:59:00 -06:00
Matthew Flatt
de98529c13 cs configure: support SDK options
For example, enable a 32-bit Mac OS build.
2018-10-21 05:59:00 -06:00
Matthew Flatt
3591a685fc reorganize configure to better support racketcs
Rearrange the configure scripts so that it will be possible to build
RacketCS from a source distribution and have it installed in the right
place. Also, when building Racket3m just to bootstrap RacketCS, don't
install Racket3m.
2018-10-20 20:19:36 -06:00
Matthew Flatt
0f18df2c1a makefile: set up for cs client build 2018-10-20 20:19:36 -06:00
Matthew Flatt
18f7b96828 makefile: add way to build RacketCS as racket 2018-10-19 11:19:44 -06:00
Matthew Flatt
8f7a5b6dd5 Add Racket HISTORY.txt note for v7.1 2018-10-19 07:42:55 -06:00
Matthew Flatt
b1dfb61223 racocs exe: fill in implementation 2018-10-17 12:55:53 -06:00
Paulo Matos
703deedb66 Avoid integer overflow
A runtime error was detecting and overflow on e which this fixes.
Fixes part of #2314.
2018-10-17 07:57:39 -06:00
Matthew Flatt
eb6705be3c thread: fix futures in a non-main place 2018-10-17 07:41:38 -06:00
Matthew Flatt
65e464e626 cs: fix concurrency problems in prefabs & interned datums 2018-10-17 07:41:38 -06:00
Alexis King
86bb85931d units: Fix an improper use of syntax instead of quote-syntax 2018-10-16 18:23:13 -05:00
Alexis King
5fb75e9f82 Fix handling of the scopes of contracted signature bindings
fixes #1652
2018-10-16 16:52:45 -05:00
Matthew Flatt
8b22ebbfbe cify: fix more GC problems 2018-10-16 15:03:45 -06:00
Paulo Matos
6d7ab42b56 Fix fasl read fasl string.
Add a new test for the failing case.
2018-10-16 09:29:55 -06:00
Matthew Flatt
a7ae05a414 thread: fix place-channel ephemeron problem
Retains a strong link to a place-channel write end when there's at
least one waiting thread. This is symmetic to keeping a strong link to
the read end when the place-channel queue is non-empty. The change
repairs a problem building documentation with places in `racocs
setup`.
2018-10-16 09:29:55 -06:00
Paulo Matos
c78787a259 Simplify copy-port
Simplify copy-port by removing the several `(let loop...` constructs.
2018-10-16 09:26:41 -06:00
Matthew Flatt
fa6bd87bcd jit: fix nary unsafe-{fx,fl}{=,<,>,<=,>=}
Fix a incorrectly nested "tiny jump" mode that turned off the
surrounding "short jump" mode.

Closes #2313
2018-10-15 21:03:57 -06:00
Matthew Flatt
e9855fa64f cs: fix assignment to auto struct fields 2018-10-15 17:22:14 -06:00
Matthew Flatt
c347bc0c99 cs: clone ChezScheme repo with --depth 1 2018-10-15 17:22:11 -06:00
Matthew Flatt
f9a69105bc cs: small repairs for chaperones
The "struct.rktl" and "chaperone.rktl" tests now pass.
2018-10-15 08:52:13 -06:00
Matthew Flatt
7bb3750ebc cs: fix some structure and imperonsator problems 2018-10-15 08:52:13 -06:00
Matthew Flatt
2b39e61c4e cs, thread, io: fix problems with evt chaperones 2018-10-15 08:52:13 -06:00
Matthew Flatt
7ecb663a6f cs: fix procedure-name problems 2018-10-15 08:52:13 -06:00
Ryan Culpepper
2166c56179 fix typo in error message 2018-10-15 10:50:59 +02:00
Matthew Flatt
48f7082bdc cs: fix problems with procedures, arity, and impersonators 2018-10-13 13:06:06 -04:00
Matthew Flatt
2051bdfc6a schemify: don't incorrectly inline a recursive function 2018-10-13 13:06:06 -04:00
Matthew Flatt
9310b1e14c cs: recognize more Scheme errors
We'll want a better approach eventually.
2018-10-13 13:06:06 -04:00
Matthew Flatt
a7989924fa regexp: don't equate #rx and #px 2018-10-13 13:06:06 -04:00
Matthew Flatt
c43e42c903 cify: fix a GC problem 2018-10-13 13:06:06 -04:00
Robby Findler
b97811d4db improve error checking in the struct form of contract-out
closes #2303
2018-10-12 20:37:39 -04:00
Matthew Flatt
51e08c48f1 thread: repair for killing a thread blocked on itself 2018-10-12 05:56:39 -06:00
Matthew Flatt
e260aef958 cs: fix more printer problems exposed by "print.rktl" tests 2018-10-11 20:32:22 -06:00
Paulo Matos
ad7797e2cf Fix memory leak
Free env variable if it was allocated.
2018-10-11 09:34:42 -06:00
Paulo Matos
9020f5aac5 Clarify the use of foff as a base pointer in foreign malloc
Fixes #2285.
2018-10-11 09:34:03 -06:00
Matthew Flatt
9f839c1161 expander: avoid retaining some syntax objects
During the expansion of an internal-definition contexts, don't
retain full forms, and instead keep just enough to perform
syntax tracking, if any.
2018-10-11 06:55:04 -06:00
Matthew Flatt
26f785e64e cs: fix some printer problems exposed by "print.rktl" tests 2018-10-11 06:01:07 -06:00
Matthew Flatt
d25058c94a cs: fix problems exposed by "read.rktl" tests 2018-10-11 06:01:07 -06:00
Matthew Flatt
16347b434d cs: fix raise-result-arity-error 2018-10-11 06:01:07 -06:00
Matthew Flatt
191d17461f hash-ref: adjust error message for bad failure thunk
Refines 2ef8d60cc6 to avoid characterizing the failure as a `(-> any)`
contract on `hash-ref`, since `hash-ref` doesn't enforce that contract
in general. Go back to an `exn:fail:contract:arity` error, but keep
the specialization of the error message to clarify that it's from
`hash-ref`. Also, bring RacketCS into sync.
2018-10-11 06:01:07 -06:00
Alexis King
15280640d4 Track disappeared define-syntaxes in internal definition contexts 2018-10-10 11:54:44 -05:00
Matthew Flatt
2b9c0c4689 avoid using directory-exists? as part of a contract
Although a `directory-exists?` check is useful for providing better
error messages, it's fundentally a race condition, since an external
process can always remove a directory between the check and a use of
the directory. Because of that limitation of `directory-exists?`, we
normally avoid making it part of a contract. This commit adjust
937aa3cdb1 to follow that convention while preserving the helpful
check and documentation improvements.
2018-10-10 06:26:57 -06:00
Alexander McLin
937aa3cdb1 pkg: fix check-strip-compatible and generate-stripped-directory
Their semantics assume all directory `path-string?` arguments point
to existing directories in the filesystem but they do not actually
check to verify resulting in unhelpful inner exceptions
breaking the functions' semantic abstractions.

Fixed by adding appropriate checks.

Test cases included too.

Documentation updated to reflect the requirement for paths to
refer to existing directories.

Also added note that `generate-stripped-directory` does not
compile or render source files.
2018-10-10 05:51:20 -06:00