Commit Graph

3535 Commits

Author SHA1 Message Date
Matthew Flatt
b00779863f fix Windows OpenSSL native library build 2018-05-23 20:46:39 -06:00
Matthew Flatt
1faa0433fa expander: fix local-expand and dropped macro definition
If `local-expand` with a 'module-begin context introduces a macro
definition, but the definition is dropped while a non-macro definition
is later introduced, then make sure references go to the non-macro
definition.

This change also addresses a related scenario, where a
`local-expand`-discovered macro definition is not dropped, but it is
given an extra scope --- which amounts to the same thing from the
expander's perspective.
2018-05-23 15:19:35 -06:00
Matthew Flatt
37dde6dc1e expander: fix related to (local-expand .... 'module-begin ....)
When a module body is expanded with `local-expand`, then submodules
can remain declared even if the submodule is discarded in the final
expansion. Since that's the way it has always been, leave it that way.
But also guard against a way of generating an import cycle via those
leftover declarations.
2018-05-23 12:30:52 -06:00
Matthew Flatt
ab7dffa420 expander: repair for module with (#%declare #:empty-namespace)
Repair a corner of `namespace-attach-module` on modules that include
`(#%declare #:empty-namespace)`.
2018-05-22 14:19:16 -06:00
Robby Findler
1ee5786e2d fix substruct contract blame setup
closes #2093
2018-05-22 08:43:10 -05:00
Matthew Flatt
fadac92003 dump-memory-stats: repair for non-backtrace build
Fix `(dump-memory-stats 'count ....)` to avoid crashing immediately.
2018-05-21 06:33:48 -06:00
Matthew Flatt
c990bbf1f7 Windows: fix Console output for non-UTF-8 bytes
A repair for the preceding commit: Writing non-UTF-8 output to a
console will write something unspecified, but it shouldn't crash
or freeze Racket.
2018-05-20 09:47:14 -06:00
Matthew Flatt
f5f4e6cf03 Windows: Unicode I/O for console ports
Use WriteConsoleW and ReadConsoleW to support Unicode input and output
for a console independent of it's code page.

Closes #2087
2018-05-20 07:46:20 -06:00
Gustavo Massaccesi
293beac7ff fix mode in rumble:equal?/recur 2018-05-19 09:49:22 -06:00
Matthew Flatt
628c177480 expander: fix code-inspector management during macro expansion
Specifically, don't incorrectly preserve the current macro's code
inspector when triggering another macro via `local-expand`.
2018-05-19 07:12:26 -06:00
Caner Derici
55011ce282 racket/src/expander: add -B
adding -B option into the expander to write the bytecode of the extracted linklet
2018-05-18 19:25:51 -06:00
Robby Findler
54989bddec use preserved thread cells for the knot-tying cache
(this makes a difference in the acquire gradual typing
benchmark, which uses nested threads via the sandbox library)
2018-05-17 08:42:08 -05:00
Alexis King
774b02a0b8 syntax/parse: Add #:track-literals and syntax-parse-track-literals 2018-05-16 14:07:58 -05:00
Robby Findler
be7fe82ea8 adjust implementation of recursive contract to cope with
the fact that blame object equality now works right and
adding context to a blame object doesn't produce an equal?
blame object

also it appears that blame-add-unknown-context is not actually
being called so lets just get rid of that functionality
(but preserve reasonable backwards compatibility in
case someone is actually calling that function or
supplying #f to blame-add-context)

And the interning of blame objects was not intended to be
in 0b3f4b627e, so get rid of it here

closes racket/typed-racket#722
2018-05-15 21:06:53 -05:00
Jay McCarthy
06c7318eaf reformat and fix up reconnecting 2018-05-14 10:17:47 -04:00
Robby Findler
0b3f4b627e streamline the representation of blame objects
and improve the context tracking support
to allow a choice of how much context to save
2018-05-12 17:28:55 -05:00
Matthew Flatt
44b8e56ed0 bytecode optimizer: allow inline of unsafe-undefined
Restores some function inlining that was lost by the change to
optional-argument expansion.
2018-05-12 07:49:12 -06:00
Alexis King
bbbdee2853 Adjust local-require to be more deliberate about syntax-local-introduce
This ensures macro-introduction scopes don’t unintentionally end up on
lifted pieces of syntax, which causes problems for Check Syntax, since
it affects the syntax-original?-ness of the require spec.
2018-05-11 16:52:17 -05:00
Ben Greenman
a539825dc9 fix: allow missing fields in object/c-common-fields-stronger?
Change `object/c-common-fields-stronger?` to only compare the fields
common to both objects.
2018-05-11 11:50:14 -04:00
Robby Findler
8ec3edaa95 add contract-equivalent?
and use it to get rid of the change in 4de050552,
avoiding the exponential blowup in a way that
doesn't compromise on contract-stronger?'s result
2018-05-09 21:32:29 -05:00
Matthew Flatt
c927a004d2 expander: fix problems with syntax-local-make-definition-context
Allow `syntax-local-make-definition-context` in places where the
created scope is not accumulated for stripping from `quote-syntax`.
Refine the docs to clarify those situtations.

A test for the repair exposed a problem with use-site scopes
and `quote-syntax`, so fix that, too.

Closes #2062
2018-05-06 20:23:39 -06:00
Matthew Flatt
f9821f9f15 variable-reference->namespace: repair namespace availability
Internally, the namespace must be set to the returned one while making
it available. Otherwise, the current namespace can get mangled.

Closes #2067
2018-05-06 20:23:39 -06:00
Robby Findler
76c404dffc fix contract-stronger bug 2018-05-06 21:21:44 -05:00
Matthew Flatt
f231cb2003 expander: fix problem related to (local-expand 'module-begin ...)
When `local-expand` is used for a 'module-begin context, use a fresh
binding -> definition-unreadable-symbol table for the nested
expansion. That way, the table used for the main expansion is
unchanged, and re-expanding or evaluating the expanded module will
arrive at the same unreadable symbols as the initial expansion.

The report and example are from Alexis.
2018-05-06 07:59:54 -06:00
Matthew Flatt
662a9022c0 refine implementation of keyword and optional arguments
The old implementation turns a single optional argument into two
arguments: the optional value and a boolean to indicate whether the
optional value is supplied.

The new expansion uses `unsafe-undefined` in place of not-supplied
arguments, in the general case. If the default-value expression is
simple enough, however, it is copied to call sites that would
otherwise supply `unsafe-undefined`. In the common case where the
default value is `#f`, for example, no run-time test is needed in the
core implementation function to check whether the default is supplied,
because a `#f` will be filled in for callers.

The performance improvement is tiny to non-existent for realistic
programs, but the simpler and reduced generated code may help in the
long run.
2018-05-06 07:59:54 -06:00
Robby Findler
4de0505525 block possible exponential explosion in stronger check 2018-05-06 08:58:21 -05:00
Asumu Takikawa
5eceb3d051 Guard FFI union functions with type checks (#1375)
* Guard FFI union functions with type checks

Also add unit tests for unions
2018-05-06 00:10:14 -04:00
Robby Findler
69eb5ee055 change the representation of blame objects
so that blame-swap (when no context is added)
is more efficient
2018-05-04 14:40:31 -05:00
Robby Findler
143d15eaa5 add the ability to not track context information in contract violation error messages 2018-05-04 06:38:59 -05:00
Robby Findler
3f4cbcbfd8 memoize the creation of the name in the blame object 2018-05-02 19:01:20 -05:00
Tucker DiNapoli
822938d9ae Handle symbol changes between openssl-1.0 and 1.1
In openssl-1.1 (specifically libcrypto) the functions sk_num, sk_value and sk_pop_free are prefixed by 'OPENSSL_'.
Now both symbol names looked for to support both version 1.0 and 1.1.
2018-05-02 06:26:08 -04:00
Sam Tobin-Hochstadt
73c3341001 Implement read-eval-print-loop using #%kernel.
Makes the repl faster to load when using a very small language
such as `racket/kernel/init`
2018-05-01 13:35:05 -04:00
Sam Tobin-Hochstadt
ba8c79f502 Avoid some dependencies for racket/kernel/init.
This is useful when loading without bytecode. Motivated by use in
Pycket, which does not load bytecode.
2018-05-01 13:35:05 -04:00
Sam Tobin-Hochstadt
409ad2d73b Avoid some uninitialized variables. 2018-05-01 13:35:05 -04:00
Sam Tobin-Hochstadt
3fc964faaf Fix name of the racket/private/top-int.rkt module. 2018-05-01 13:35:05 -04:00
Matthew Flatt
6f31650539 repair for re-expansion of an implicit-form expansion
The repair in 385f9588f8 propagates the
must-be-bound callback too far. It shouldn't be propagated anymore after
a non-rename transformer is applied.

Closes #2048
2018-04-30 21:05:09 -06:00
Matthew Flatt
53c1b5b1db fix generated makefile dependencies to work when a file is deleted 2018-04-30 19:57:22 -06:00
Robby Findler
ff588f93eb add contract-pos/neg-doubling and use it in various places 2018-04-29 21:50:32 -05:00
Alexis King
96b69d0366 Add interned scopes and make-interned-syntax-introducer 2018-04-27 20:12:11 -05:00
Robby Findler
8dbedc6a26 the commit 2a1c8a78 contained stuff that was meant to be in bff0c41
so when it was reverted, we have to bring back that stuff
2018-04-27 18:59:10 -05:00
Robby Findler
ef8101bde3 Revert "change the strategy for recursive-contract's knot tying"
This reverts commit 2a1c8a78a5.

something goes wrong with large recursive nests with this commit
2018-04-27 15:04:03 -05:00
Matthew Flatt
53ffd28e0f expander: atomic update of a module-path-index table
A module path index used to expand a module must be interned, and the
intern table is an `equal?`-based weak hash table, which means there's
an internal lock on the table that can be damaged if the current
thread is terminated while using the table.

I don't see an easy way to fall back to `eq?`-based tables, so I'm
resorting to an atomic region (which I had managed to avoid until
now).
2018-04-27 12:59:58 -06:00
Matthew Flatt
cb921cd1d9 configure: fix --disable-cify 2018-04-26 13:48:09 -06:00
Robby Findler
bff0c4113d lift out some work from object contracts from the post-value application
of the projection to the pre-value (after getting the blame object)
2018-04-26 14:30:58 -05:00
Robby Findler
2a1c8a78a5 change the strategy for recursive-contract's knot tying
this change speeds up this microbenchmark by about 10x:
2018-04-26 14:06:17 -05:00
Milo
026d368a38 Improve some errors from match and friends (close #1431, #1615) (#1974)
* More specific error for no-clause match-lambda** (close #1615)

* Remove unused orig-stx parameter from racket/match internals

* Use of match-XYZ/derived for better errors (fix #1431)

* Tests for the exceptions produced by racket/match
2018-04-25 17:17:39 -04:00
Matthew Flatt
bc55560f8d raco pkg update: add ---unclone as a kind of alias for --lookup
It's difficult to remember that the opposite of `--clone` is
effectively `--lookup`.
2018-04-25 09:54:06 -06:00
Alexis King
e2ef7cdd5c Make syntax-local-lift-require not affect syntax-original?-ness 2018-04-25 10:52:14 -05:00
Alexis King
b87793640b Add quote-syntax and #%plain-module-begin to kernel-form-identifier-list 2018-04-24 15:10:11 -05:00
Robby Findler
b8c398cc69 add obligations for instanceof/c 2018-04-24 14:48:11 -05:00
Matthew Flatt
77d0b0b8f4 syntax-local-lift...: correct error for module-begin context
Relevant to #2052
2018-04-24 08:22:37 -06:00
Matthew Flatt
88d8ba00e0 bytecode compiler: fix for call-with-immediate-continuation-mark
The converstion from calling `call-with-immediate-continuation-mark`
to an internal `with-immediate-continuation-mark` form did not handler
a mutable argument variable.
2018-04-23 21:13:10 -06:00
Alexis King
3531cb24f4 Restore binding-introduction behavior of parent definition contexts
This behavior was in Racket 6, but was not preserved in the new
expander.
2018-04-23 11:19:20 -05:00
Matthew Flatt
b1f9f2caad expander: no #%expression in fully expanded
Ensure that `#%expression` appears only around a top-level form in
a fully expanded form.
2018-04-22 08:15:44 -06:00
Alexis King
7d556d4006 Preserve some coercion behavior of old internal-definition-context-apply
mzlib/unit200 relies upon this behavior, even though it appears to have
been mostly accidental, so this maintains it for the sake of
backwards-compatibility.
2018-04-20 20:42:14 -05:00
Daniel Feltey
51decc085d remove unused definition 2018-04-20 17:00:25 -05:00
Matthew Flatt
07473865a6 fix continuation-mark splicing across composable combinations
Although splicing was set up for applying a composable
comtinuation to most kinds of continuations, it was not
set up right for applying a composable continaution in tail
position for a just-applied composable continuation.

Thanks to Spencer Florence for the report and example.
2018-04-20 12:02:59 -06:00
Alexis King
6834e4a12c Document and generalize some things for first-class definition contexts
This commit adds a section to the reference to document how the expander
tracks information about local bindings, and it extends some
syntax-local functions to allow them to accept multiple definition
contexts instead of just one. In addition, it improves the documentation
on how first-class definition contexts interact with local-expand,
syntax-local-value, and syntax-local-bind-syntaxes, and it also
clarifies what it means to create a child definition context.
2018-04-20 11:47:23 -05:00
Alexis King
e5b5747566 Make local-require work with phase shifted require specs
fixes #2049
2018-04-19 15:16:18 -05:00
Matthew Flatt
65217898d1 repair gui native-lib metadata generation 2018-04-17 15:44:03 -06:00
Matthew Flatt
3b1ddc6ee4 update native-library notes for PPC Mac OS 2018-04-16 07:40:58 -06:00
Matthew Flatt
ee695bc317 native libs: add ATK to native-library builds for all platforms 2018-04-16 06:34:13 -06:00
Matthew Flatt
70020785b2 JIT: fix more misuses of jit_retval
Older mistakes that are the same as in 82517622c7.
2018-04-16 06:34:13 -06:00
Matthew Flatt
7bccfa7824 ffi/unsafe/obj: ignore NULL protocols
If the `#:protocols` clauses of a `define-objc-class` form includes
errors, but it simplifies the declaration of protocols that are
introduced in different versions of a framework, and it's effectively
more compatible with the implementation before dc0898f5ef.
2018-04-16 06:34:13 -06:00
Matthew Flatt
d2ef35082a repair JIT-inlined hash-ref
The attempt in 82517622c7 was wrong. Using `JIT_R0` for
the result in the internal ABI is fine, and the problem
was using a register for two purposes in the called
stub.
2018-04-15 17:23:39 -06:00
Matthew Flatt
c79fba4ca6 native-library build-script updates for PPC Mac OS 2018-04-15 16:48:28 -06:00
Matthew Flatt
8100438afc unsafe-fxlshift: fix constant folding
Closes #2034
2018-04-15 11:10:48 -06:00
Matthew Flatt
ecd0aee2b7 db: avoid Racket C API
Also, the use of `scheme_make_sized_byte_string` was incorrect, since
it expects 3 arguments.
2018-04-15 08:16:47 -06:00
Matthew Flatt
69f5395d5d cs: repairs for Linux build 2018-04-15 08:16:47 -06:00
Matthew Flatt
82517622c7 repair JIT-inlined hash-ref
Direct of `JIT_R0` instead of `jit_retval` is wrong on PowerPC.
2018-04-15 08:16:47 -06:00
Matthew Flatt
abb601558d 3m: avoid reinstall of write-barrier signal handler for places
Redundantly setting the signal handler hasn't matter, but it's
confusing and now matters for implementing W^X via a different signal
handler.

Closes #2038
2018-04-14 15:46:10 -06:00
Matthew Flatt
385f9588f8 expander: adjust rename-transformer handling for implicit forms
For consistently with the old expander, treat `#%app` and `#%datum`
like unbound if they're bound to a rename transformer whose identifier
does not untimately refer to macro or primitive syntactice form.

Closes #2042
2018-04-14 10:36:45 -06:00
Ben Greenman
8b797a10a8
fasl: use longer fasl prefix
Change fasl prefix from `rkt:` to `racket/fasl:`, in the hope that future civilizations will be able to decipher these binary files.
2018-04-13 22:44:35 -04:00
Matthew Flatt
fb635c0d97 repair for raise-result-arity-error
Classic misuse of provided string as a formatting template.

Closes #2040
2018-04-13 06:36:39 +02:00
Matthew Flatt
b1dc723acd Mac OS: fix build script for libgmp 2018-04-11 22:00:12 +02:00
Michael Ballantyne
4be2c523b6 fix dynamic-require with symbol to not make available
to match behavior in docs and racket 6.
2018-04-11 21:59:53 +02:00
Gustavo Massaccesi
8d08264b41 schemify: fix boolean-or-fixnum?
Also, add null? to equal-implies-eq?
2018-04-11 13:28:09 -03:00
Matthew Flatt
a5d0d38ae0 cs: use O_BINARY only on Windows 2018-04-11 06:47:58 +02:00
Matthew Flatt
fcfa72e73a add raise-result-arity-error
Use it to provide some proper errors from the expander.

Closes #2029
2018-04-11 06:47:58 +02:00
Alex Knauth
f66b3312df match: check duplicate identifiers across list-no-order patters (#2000)
* match: check duplicate identifiers across list-no-order patters

* match: document that list-no-order doesn't support duplicate ids between sub-pats

* match: put duplicate id docs in a margin note between the two variants
2018-04-11 00:00:14 -04:00
Robby Findler
1e93424f67 adjusted the blame objects so that equality tests (and equal hashing) work better 2018-04-09 14:00:29 -05:00
Robby Findler
853f14b9a5 adjust make-wrapper-class and make-wrapper-object to cooperate better with the way projections are curried 2018-04-09 14:00:05 -05:00
Ryan Culpepper
a48259ba29 syntax/loc: only use loc arg if it has source or position 2018-04-09 11:40:12 +02:00
Ryan Culpepper
7f12dc567c bump version 2018-04-09 11:40:12 +02:00
Ryan Culpepper
84ca256029 rename ??,?@ to ~?,~@ (see PR #2031) 2018-04-09 11:40:12 +02:00
Matthew Flatt
5bb2c1f16e upgrade native libraries
Update the build scripts, patches, and notes.
2018-04-09 09:14:05 +02:00
Kieron Hardy
e0668d895b Update simple.rkt
Fix typo in comment.
2018-04-07 16:06:11 -04:00
Ryan Culpepper
93a899cf4c db/sqlite3: support create-{function,aggregate} 2018-04-04 12:31:54 +02:00
Ryan Culpepper
aadbe1a7d2 db/sqlite3: add support for loading extensions 2018-04-04 12:31:54 +02:00
Ryan Culpepper
1e40af55bc db: more db/../function updates, factor out checks better 2018-04-04 12:31:54 +02:00
Ryan Culpepper
7c50113ced db: move some non-essential code to db-lib pkg
Also provide more from private modules to allow impl sharing.
2018-04-04 12:31:54 +02:00
Ryan Culpepper
bcb6299b4b wrap-expr/c: don't put build-time paths in expansion (closes #2006) 2018-04-01 02:50:29 +02:00
Ryan Culpepper
262ed468d0 remove rename-transformer (causes demodularizer problems) 2018-04-01 01:42:17 +02:00
Ryan Culpepper
6f628b2531 fix error messages 2018-03-30 12:43:36 +02:00
Matthew Flatt
d3aa7e90e7 rktio: fix Windows file timestamp dst correction
The old correction was broken in at least a couple of ways; use
the more tested DST calculation in the implementation of
`seconds->date`.
2018-03-29 20:45:26 -06:00
Matthew Flatt
e95c3fe6d5 sgc: fix unmapping of temporary GC space
Instead of unmapping directly, return temporary space to
the page-allocation cache.
2018-03-29 14:48:11 -06:00
Ryan Culpepper
0f3f338b22 delay evaluation of default-make-fail argument until use
This reverts part of 778b1845.
2018-03-29 11:48:59 +02:00
Ryan Culpepper
0083f5c858 fix error reporting for define/syntax-parse (closes #2003) 2018-03-29 11:41:01 +02:00
Ryan Culpepper
c2eab77cec update version number and fix history for syntax/?@/?? 2018-03-29 11:40:35 +02:00
Ryan Culpepper
8d607b83f9 merge syntax/parse's template into core (syntax, syntax/loc, etc) 2018-03-29 11:40:35 +02:00