Commit Graph

4462 Commits

Author SHA1 Message Date
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