Commit Graph

1758 Commits

Author SHA1 Message Date
Vincent St-Amour
1079b2b790 Move unstable/socket to its own package. 2015-08-18 14:03:03 -05:00
Matthew Flatt
629697d14a remove accidentally added file 2015-08-17 12:36:51 -06:00
Matthew Flatt
1b493f2146 fix MzCOM's atexit replacement 2015-08-17 10:16:02 -06:00
Matthew Flatt
641c56b6e9 repair leak in managing OS-level locks 2015-08-17 09:51:20 -06:00
Matthew Flatt
693cdc673d GC: use ofm_malloc() and ofm_free() for admin allocation
Using ofm_....() makes it easier to check that memory allocated for GC
administrtation is itself reclaimed.
2015-08-17 09:39:11 -06:00
Matthew Flatt
fea2b1ce5e repairs for MinGW build
Fix compiler warnings and installation bugs related to the
".exe" extension.
2015-08-17 08:32:12 -06:00
Geoff Hill
be66fde64c write-xexpr: consistently use parameter port. 2015-08-15 00:41:46 -07:00
Gustavo Massaccesi
1753335d34 Fix string-replace when the string is mutable
The `from` string argument is converted to a regexp and cached. When `from` is
a mutable string this can cause wrong results in the following calls
to string-replace. So the string is first converted to an immutable string to
be used as the key for the cache.
2015-08-14 21:17:48 -03:00
Matthew Flatt
80aac79507 change place to create a submodule
When `place` expands, the body of the `place` form is placed into a
`(module* place-body-<n> #f ....)` submodule.

The `place` form previously placed its body in a lifted function,
where the function's exported name was based on
`(current-inexact-milliseconds)`. The generated submodules have
deterministic names, so that compilation is deterministic, and
submodule names don't collide (unlike exported function names) when
multiple `place`-using module are imported into some other module.
Also, using a submodule avoids the problem that the clock doesn't
change fast enough on Windows.
2015-08-14 17:55:47 -06:00
Matthew Flatt
0caf079637 add syntax-local-lift-module 2015-08-14 16:52:56 -06:00
Matthew Flatt
dbd5470805 move call/cc and call/ec to racket/private/more-scheme
Those aliases were moved out of `#%kernel` as part of the
determinstic-bytecode changes, but putting them in
`racket/private/pre-base` meant that they weren't included in
`mzscheme` or Pretty Big. The new location is with `let/cc`, which
makes more sense, and makes them picked up by `mzscheme` and Pretty
Big.
2015-08-14 07:45:47 -06:00
Matthew Flatt
111a7e085d fix prefab checking in printer
Mishandling of a chaproned prefab when, for example, determining
whether to use quoted printing caused the `tests/compiler/zo` test to
sometimes fail.
2015-08-14 07:28:37 -06:00
Matthew Flatt
e82e61e84c restore needed call in unresolver
Add back a call incorrectly removed in bd82646d81.
2015-08-13 18:22:51 -06:00
Matthew Flatt
cfa1d39166 add compiler/exe-dylib-path
Provide a clean interface to a private library for updating
dynamic-library paths in Mac executables.
2015-08-13 17:06:55 -06:00
Gustavo Massaccesi
07816f2ca4 Use scheme_getenv in eval.c 2015-08-13 19:05:40 -03:00
Matthew Flatt
15eadbb868 copy-directory/files: add #:preserve-links? argument 2015-08-13 15:13:46 -06:00
Blake Johnson
12315ec964 using correct inspector for unresolved module 2015-08-13 15:13:46 -06:00
Juan Francisco Cantero Hurtado
f3098a946a Fix an error in racket-test-core/number.rktl on OpenBSD-current/sparc64
"Errors were:
(Section (got expected (call)))
((numbers) (0.0 -0.0 (#<procedure:round> -0.0)))
((numbers) (125.0+0.0i 125.0-0.0i (#<procedure:z-round> 125.00000000000023-0.0i)))
((numbers) (100.0+0.0i 100.0-0.0i (#<procedure:z-round> 99.99999999999999-0.0i)))"
2015-08-13 15:13:46 -06:00
Matthew Flatt
33cf716835 include phantom bytes consistently in memory-use reports 2015-08-13 15:13:46 -06:00
Alex Knauth
3c5ed5d8e1 syntax-parse: keep more srclocs in attribute bindings
to cooperate more with DrRacket check-syntax arrows
2015-08-13 15:35:35 -05:00
Vincent St-Amour
033d5afb19 Revert adding in-pairs to racket/sequence.
`in-dict` is more general, and `for` loops optimize it already.
2015-08-13 14:43:57 -05:00
Vincent St-Amour
9508c251ee Move rest of unstable/sequence to unstable-lib. 2015-08-13 14:43:56 -05:00
Vincent St-Amour
36bb0e568c Merge part of unstable/syntax with racket/syntax. 2015-08-13 14:43:56 -05:00
Vincent St-Amour
1a7b71fb20 Improve the implementation of in-slice. 2015-08-13 14:43:56 -05:00
Matthew Flatt
bd82646d81 avoid compiler warnings 2015-08-13 11:57:06 -06:00
Matthew Flatt
7741b4b361 local-expand: fix argument checking
Also, fix contract in the docs, since the first argument is allowed to
be an S-expression.
2015-08-13 11:48:20 -06:00
Matthew Flatt
86ee9c5071 signature-members: adjust element ids based on reference
Make the resulting content ids compatible with binding and reference
at a use site, as needed for the new macro expander.
2015-08-13 10:44:26 -06:00
Ryan Culpepper
aee93fb200 added racket/struct with make-constructor-style-printer 2015-08-12 18:42:29 -04:00
Ryan Culpepper
0f6e2f8029 change sets to use make-constructor-style-printer 2015-08-12 18:42:29 -04:00
Ryan Culpepper
59300afbef add racket/private/custom-write 2015-08-12 18:42:29 -04:00
Matthew Flatt
02574d2501 SGC: use PRIdPTR and PRIxPTR
Avoid compiler warnings by using the right format string.
2015-08-12 14:48:11 -06:00
Tim Brown
3f53d214c6 url-exception? exported wrongly 2015-08-12 11:20:10 -05:00
Tim Brown
9473f394b7 url-strings: Separate URL parsing from URL actions
`net/url` provides functions for both converting strings
and paths to and from URLs.

`net/url` also includes functions for creating (pure and import)
network ports. This functionality `require` the HTTP client stack
which is unnecessary when URLs simple need parsing for their
"bits".

New library: `net/url-strings` handles `url->string` and `string->url`
(and also the related `path->url` and `url->path` functions). This is
required by net/url for compatability.

`net/url-exception.rkt` is factored out for use by both libraries.

- See also racket/net changes for T&D

url-string.rkt changes requested by mflatt

url-strings.rkt is now called url-string.rkt

identifiers from url-string.rkt are reprovided by url.rkt
using (all-from-out "url-string.rkt") instead of explicit
exports
2015-08-12 11:20:10 -05:00
Ryan Culpepper
3e2b916f5b annotated common version list for openssl libs 2015-08-11 18:43:35 -04:00
Ryan Culpepper
49dc0625d4 more detail in openssl error 2015-08-11 18:43:34 -04:00
Matthew Flatt
956d538164 fix missing zero of allocated atomic memory in unresolver 2015-08-11 16:01:54 -06:00
Blake Johnson
d39801c937 ref_args off by one 2015-08-11 16:01:54 -06:00
Matthew Flatt
13bd013528 fix JIT-inlined set-cpointer-tag! for non-x86 2015-08-11 16:01:53 -06:00
Matthew Flatt
820ab7126c fix enum mismatch in ARM JIT
Also, recognize `__ARM_ARCH_6ZK__`.
2015-08-11 16:01:53 -06:00
Daniel Feltey
b16f0b24b7 Improvements to unit/c contracts in preparation for unit support in typed/racket
Changes:

 - Allow unit contracts to import and export the same signature.
 - Add "invoke" contracts that will wrap the result of invoking a unit contract,
   no wrapping occurs when a body contract is not specified
 - Improve error messages
 - Support for init-depend clauses in unit contracts.
 - Fix documentation to refelct the above
 - Overhaul of unit related tests

Handling init-depend clauses in unit contracts is a rather large and somewhat
non-backwards-compatible change to unit contracts. Unit contracts must now
specify at least as many initialization dependencies as the unit value being
contracted, but may include more. These new dependencies are now actually
specified in the unit wrapper so that they will be checked by compound-unit
expressions.

This commit also adds more information to the first-order-check
error messages. If a unit imports tagged signatures, previously the errror
message did not specify which tag was missing from the unit contract. Now
the tag is printed along with the signature name.

Documentation has been edited to reflect the changes to unit/c contracts
made by this commit.

Additionally this commit overhauls all tests for units and unit contracts.
Test cases now actually check that expected error messages are triggered when
checking contract, syntax, and runtime errors. Test forms now expand into uses
of rackunit's check-exn form so only test failures are reported and all tests in
a file are run on every run of the test file.
2015-08-11 16:30:39 -05:00
Matthew Flatt
1757348b23 repairs for MSVC
Don't use `for (int i ....`, which is too modern.
2015-08-10 17:14:09 -06:00
Blake Johnson
fbe8537f18 add compiled-expression-recompile
Uses an unresolver pass, which is expanded to work on more programs.
2015-08-10 16:39:43 -06:00
Matthew Flatt
2661d46929 toward deterministic bytecode generation
Progress toward making the bytecode compiler deterministic, so that a
fresh `make base` always produces exactly the same bytecode from the
same sources. Most changes involve avoiding hash-table order
dependencies and adjusting scope identity. The namespace used to load
a reader extension is also better defined. Plus many other little
changes.

The identity of a scope that is unmarshaled from a bytecode file now
incorporates the hash of the file, and the relative order of scopes is
preserved in a bytecode file. This combination allows compilation to
start with modules that loaded and compiled in different orders
(including delayed loading of bytecode fragments within one file).

Formerly, a reader extension triggered by `#lang` or `#reader` was
loaded in whatever namespace happens to be current. That's
unpredictable and can pollute a module build at the level of bytecode.
To help make builds deterministic, reader extensions are now loaded in
a root namespace of the current namespace.

Deterministic compilation in general relies on deterministic macros.
The two most common ways for a macro to be non-deterministic are by
using `gensym` (use `generate-temporaries`, instead) and by using an
unsorted hash-table traversal (don't do that).

At this point, bytecode generation is unlikely to be completely
deterministic, since I uncovered non-determinism mostly by iterating
attempts over the base collections. For now, the intent is not to
provide guarantees outside of the compilation of the base collections
--- but "more deterministic" is likely to be useful in the short run,
and we can improve further in the long run.
2015-08-07 15:48:39 -06:00
Matthew Flatt
a55eed9718 fix data/integer-set for 32-bit platforms 2015-08-07 05:30:26 -06:00
Matthew Flatt
0efd052218 fix single-float hashing 2015-08-07 05:30:25 -06:00
Matthew Flatt
6bcb449b55 fix impersonator-property:application-mark propagation
Propagate the mark value only if it's on the current continuation
frame, as originally intended. Adjust the docs to clarify.
2015-08-07 05:30:25 -06:00
Matthew Flatt
0480f55f67 add with-immediate-continuation-mark bytecode form
Specialize a
  (call-with-immediate-continuation-mark _key (lambda (_arg) _body) _def-val)
call to an internal
  (with-immediate-continuation-mark [_arg (#%immediate _key _def_val)] _body)
form, which avoids a closure allocation and more.

This optimization is useful for contracts, which use
`call-with-immediate-continuation-mark` to avoid redundant
contract checks.
2015-08-07 05:30:25 -06:00
Matthew Flatt
c308915047 minor streamlining of foreign-call path
JIT-inline `cpointer-tag` and `set-cpointer-tag!`, plus minor
shortcuts and GC hints in Racket->C conversion.
2015-08-06 14:44:30 -06:00
Matthew Flatt
d34416ea02 define-inline: fix call with multiple keyword arguments 2015-08-06 14:44:30 -06:00
Vincent St-Amour
7b70a42361 Move unstable/syntax to unstable-lib. 2015-08-05 13:11:55 -05:00
Vincent St-Amour
5ee37920f5 Move phase-of-enclosing-module to a private syntax/parse module. 2015-08-05 13:11:55 -05:00
Vincent St-Amour
d836a427cc Remove unused dependency on unstable/syntax.
This revealed a missing dependency to racket/syntax elsewhere.
2015-08-05 13:11:55 -05:00
Vincent St-Amour
2c21d61870 Move syntax-source-* to syntax/location. 2015-08-05 13:11:55 -05:00
Vincent St-Amour
7e93b7d426 Move make-variable-like-transformer to syntax/transformer. 2015-08-05 13:11:54 -05:00
Vincent St-Amour
21c44635f6 Move unstable/macro-testing to syntax/macro-testing. 2015-08-05 13:11:54 -05:00
Vincent St-Amour
102fbff5d2 Rename unstable/wrapc to syntax/contract. 2015-08-05 13:11:54 -05:00
Daniel Feltey
265b777b93 Fix unit contracts for new expander 2015-08-03 16:08:18 -06:00
Matthew Flatt
bf76ced8ba work around EPERM error from access()
On OS X, it seems that access() can sometimes fail with EPERM
when checking for execute permission on a file without it.
I've previously seen this result when running as the superuser,
but that's apparently not the only possibility; a long path
may also be relevant.
2015-08-01 21:59:19 -06:00
Matthew Flatt
086d02003a fix linking of compiled reference to a top-level variable
Re-linking in a new namespace doesn't need the namespace of
compilation.

A "namespac.rktl" test exposed this problem, where the "transfer a
definition of a macro-introduced variable" test could fail if a GC
occurred between compilation in one namespace and evaluation in
another.
2015-07-31 11:17:25 -06:00
Matthew Flatt
1f2e0dacb3 minor adjustments
SGC header correction plus extra assert.
2015-07-31 07:32:34 -06:00
Gustavo Massaccesi
a1f04604df JIT: Inline keyword? 2015-07-30 21:27:26 -03:00
Matthew Flatt
51747e86c5 fix raco pkg conflict checking
When a module is currently installed as bytecode, but without
corresponding source and without a "info.rkt" specification that
bytecode should be preserved without source, then `raco pkg` should
not count that module bytecode as a conflict (since `raco setup`
will remove it).
2015-07-30 14:12:05 -06:00
Matthew Flatt
3dc1dc80e3 add setup/collection-search 2015-07-30 14:12:04 -06:00
Matthew Flatt
9a7d046062 raco setup: clean collections before compiling any
In case a collection "a" is composed from two places, and in
case the first place has a bytecode file for "x.rkt" while
only the second place has the source of "x.rkt" (probably it
was recently moved), then `raco setup` should delete the
sourceless bytecode so that any dependency on "x.rkt" will
reference the right version.
2015-07-30 14:12:04 -06:00
Jay McCarthy
2602ff530d Adding no major collection guarantee to collect-garbage minor collections 2015-07-30 11:42:13 -06:00
Jay McCarthy
2f22f86c0a Adding minor collections to collect-garbage 2015-07-30 11:42:13 -06:00
Matthew Flatt
26158a51d2 raise-syntax-error: fix srcloc reporting on #f as 3rd arg 2015-07-29 11:54:18 -06:00
Matthew Flatt
99f29ce8ee repair for nexted splicing forms that define the same name
Nested splicing forms would lead to an "ambigious binding" error
when the nested forms bind the same name, such as in

 (splicing-let ([a 1])
   (splicing-let ([a 2])
     (define x a)))

The problem is that splicing is implemented by adding a scope to
everything in the form's body, but removing it back off the
identifiers of a definition (so the `x` above ends up with no new
scopes). Meanwhile, a splicing form expands to a set of definitions,
where the locally bound identifier keeps the extra scope (unlike
definitions from the body). A local identifier for a nested splicing
form would then keep the inner scope but lose the outer scope, while
a local identifier from the outer splicing form would keep the outer
scope but no have the inner one --- leading to ambiguity.

The solution in this commit is to annotate a local identifier for a
splicing form with a property that says "intended to be local", so the
nested definition will keep the scope for the outer splicing form as
well as the inner one. It's not clear that this is the right approach,
but it's the best idea I have for now.
2015-07-29 06:11:13 -06:00
Alex Knauth
3a3d17dbb5 Fix check-syntax arrows within units 2015-07-28 15:45:01 -06:00
Vincent St-Amour
496cd97351 Rename open-place to place/context. 2015-07-28 16:14:29 -05:00
Matthew Flatt
e3ed57633e syntax/module-reader: add a #:module-wrapper option
A `#:module-wrapper` option is useful for adding a scope to an
entire `module` form.
2015-07-28 14:55:02 -06:00
Matthew Flatt
7864436594 fix top-level scope introduction
Although `eval-syntax` is not supposed to add the current namespace's
"outer edge" scope, it must add the "inner edge" scope to be consistent
with adding the inner edge to every intermediate expansion (as in
other definition contexts).

In addition, `eval`, `eval-syntax`, `expand`, and `expand-syntax`
did not cooperate properly with `local-expand` on the inner edge.
2015-07-28 13:14:00 -06:00
Vincent St-Amour
5d9c0cf1c7 Move markparam to its own package/repo. 2015-07-28 13:05:54 -05:00
Rui Paulo
84996ff2ac sconfig: FreeBSD uses clang. 2015-07-25 20:57:59 -06:00
Rui Paulo
6dd1aa0cd8 sconfig: add FreeBSD/arm. 2015-07-25 20:57:40 -06:00
Matthew Flatt
98bd78e7f0 remove unused counter 2015-07-25 20:56:09 -06:00
Matthew Flatt
5e2b6c2b74 JIT: repair some runstack-pointer syncs
Some failure paths were missing an update before calling failure
code, and the new failure paths need to unconditionally update the
runstack pointer (because the common stub doesn't know whether the
calling context needs an update).
2015-07-25 20:49:58 -06:00
Gustavo Massaccesi
8430daa628 Jitinline string-length and bytes-length
Previously only the unsafe versions were inlined in the jit compiler.
2015-07-25 20:31:44 -03:00
Matthew Flatt
20728278bf raco setup: fix bootstrap phase to recognize indirect dependencies
Recent changes introduced an indirect dependency in the core of
`raco setup` --- possibly the recent addition to `racket/place`.
2015-07-25 16:24:43 -06:00
Matthew Flatt
9593b4c806 make-syntax-introducer: add optional argument to change kind of scope
Genereating a use-site scope, instead of a macro-introduction scope,
prevents the scope's presense from triggering a #f result from
`syntax-original?`.
2015-07-25 14:37:54 -06:00
Vincent St-Amour
0f2d02cdd2 Move part of unstable/logging to racket/logging.
... and improve and extend its interface at the same time.
2015-07-23 12:22:51 -05:00
Vincent St-Amour
4ee1864941 Merge unstable/place with racket/place. 2015-07-23 12:22:50 -05:00
Vincent St-Amour
91c422bb66 Merge unstable/future with racket/future. 2015-07-23 11:43:37 -05:00
Matthew Flatt
1d380864e9 remove accidentally committed debugging change 2015-07-23 09:09:03 -06:00
Matthew Flatt
f4d05aaba8 fix bytecode-marshaling problem related to rename transformers 2015-07-23 08:04:34 -06:00
Matthew Flatt
120f1329c6 change bytecode marshaling of scopes
This change mostly reverts 1465ff25fc, which turned out to be a hassle
because it created more cyclic structure.

A simpler strategy is to allow a phase-specific scope to be detached
(perhaps temporarily, due to on-demand loading of bytecode) from its
group; when that's possible, the scope is not reachable from a place
where it can be moved to other syntax objects, so it's ok to be
detached. Debugging output needs to handle that gracefully, though.
Also, in case of broken bytecode, fix up a detached scope if it
does end up in an unexpected place.
2015-07-23 08:04:34 -06:00
Sam Tobin-Hochstadt
960fc831fc Provide promise/name?. 2015-07-22 14:33:30 -04:00
Matthew Flatt
2cf01f0257 raco exe: fix interaction of submodules and using source
Also, fix the interaction of submodules plus `--collects-dest`, but
there's room for improvement there in pruning unused submodules.
2015-07-22 10:54:31 -06:00
Matthew Flatt
176777b05f adjust transfer of compiled in one namespace and run in another
Formerly, compiling a definition in one namespace and evaluating it in
another would cause the definition to take place in the original
namespace --- unless the compiled code is marshaled to a byte string
and back. Adjust the "linking" process to redirect the variable
definition and any references to the new namespace. (This is a change
relative to the compiler with the old macro expander.)

Also, repair a compiled `require` form along similar lines. (This is
*not* a change relative to the compiler with the old macro expander;
the mismatch is part of the motivation for changing `define`
handling.)
2015-07-22 10:54:31 -06:00
Robby Findler
4899200177 add what appears to be the right missing argument, judging from other uses
of simultaneous-installs and the fact that the build seems to go through now
2015-07-21 22:21:42 -05:00
Matthew Flatt
1465ff25fc in ".zo", keep module's set of scopes together
For a set of phase-specific scopes that correspond to the "inside
edge" of a module, make sure the whole set is marshaled together.
2015-07-21 12:50:48 -06:00
Matthew Flatt
444518b344 racket/unit: fix problem with contracts
Part of the expansion to handle contracts confused internal and
external names of signature elements. The new macro expander is less
tolerant of the mistake.
2015-07-21 10:19:40 -06:00
Matthew Flatt
ea612d255f don't export old-case from racket/base
Reverts a change that was accidentally included in the set-of-scopes
switch.
2015-07-20 15:05:09 -06:00
Vincent St-Amour
1083a31965 check-duplicate -> check-duplicates
For consistency with remove-duplicates.
2015-07-20 16:00:53 -05:00
Vincent St-Amour
7700b3d736 Move contents of unstable/hash to racket/hash. 2015-07-20 16:00:52 -05:00
Vincent St-Amour
952df81877 Move remf from unstable/list to racket/list.
Add remf* for consistency.
2015-07-20 16:00:52 -05:00
Vincent St-Amour
c0408de912 Move various common prefix functions from unstable/list to racket/list.
Make their interface consistent with the rest of racket/list.
2015-07-20 16:00:52 -05:00
Vincent St-Amour
067ed4ccac Move list-update and list-set from unstable/list to racket/list. 2015-07-20 16:00:52 -05:00
Vincent St-Amour
5e23ad6ccf Move group-by and cartesian-product from unstable/list to racket/list. 2015-07-20 16:00:52 -05:00
Vincent St-Amour
6b9fc4551d Add error checking to check-duplicate.
To replace its original contract, and avoid introducing a dependecy to contracts.
2015-07-20 16:00:52 -05:00