Commit Graph

3045 Commits

Author SHA1 Message Date
Matthew Flatt
93834adc99 rktio: move udp over to rktio
Still doesn't work...
2017-06-19 06:45:17 -06:00
Matthew Flatt
2b439fc554 rktio: most of switch to rktio fd
Doesn't work, yet...
2017-06-19 06:45:17 -06:00
Matthew Flatt
63505d3e16 rktio: switch to rktio envvars 2017-06-19 06:45:17 -06:00
Matthew Flatt
49e30ea6fb rktio: better file size and timestamp types 2017-06-19 06:45:17 -06:00
Matthew Flatt
d9d8c7758d rktio: fix MzCOM projects 2017-06-19 06:45:17 -06:00
Matthew Flatt
2d21523b2d rktio: fixes for Windows build 2017-06-19 06:45:17 -06:00
Matthew Flatt
75e835351a rktio: add MSVC projects 2017-06-19 06:45:17 -06:00
Matthew Flatt
6e06329c61 rktio: fix scheme_os_getcwd() wrapper 2017-06-19 06:45:17 -06:00
Matthew Flatt
0402075f2b rktio: repairs to file & directory operations 2017-06-19 06:45:17 -06:00
Matthew Flatt
6268cd7ce9 rktio: switch file & directory operations to rktio 2017-06-19 06:45:17 -06:00
Matthew Flatt
425fe36fa5 rktio: initial import of librktio to racket 2017-06-19 06:45:16 -06:00
Matthew Flatt
636b1637b4 rktio: add date & time 2017-06-19 06:45:16 -06:00
Matthew Flatt
c006e951f4 rktio: add file locking 2017-06-19 06:45:16 -06:00
Matthew Flatt
03c3655b1f rktio: more repairs exposed by warnings 2017-06-19 06:45:16 -06:00
Matthew Flatt
2f5797f1d5 rktio: use -Wall and fix warnings 2017-06-19 06:45:16 -06:00
Matthew Flatt
a929c58712 rktio: compiles for Windows using MinGW 2017-06-19 06:45:16 -06:00
Matthew Flatt
9bfaaf3ab3 rktio: wide-string handling for Windows 2017-06-19 06:45:16 -06:00
Matthew Flatt
4ffb01c6fa rktio: more configure for rktio 2017-06-19 06:45:16 -06:00
Matthew Flatt
2187e77e65 rktio: add filesystem-change events 2017-06-19 06:45:16 -06:00
Matthew Flatt
19776f6bb9 rktio: fix some leaks 2017-06-19 06:45:16 -06:00
Matthew Flatt
b5e88e70c2 rktio: environment variables 2017-06-19 06:45:16 -06:00
Matthew Flatt
a767ea38fc rktio: improve organization 2017-06-19 06:45:16 -06:00
Matthew Flatt
c5ddf79721 rktio: small repairs 2017-06-19 06:45:16 -06:00
Matthew Flatt
9e68886b26 rktio: processes 2017-06-19 06:45:16 -06:00
Matthew Flatt
6c2f71bf80 rktio: UDP 2017-06-19 06:45:16 -06:00
Matthew Flatt
e9d5260295 rktio: dup and socket addresses 2017-06-19 06:45:16 -06:00
Matthew Flatt
9461c0e72a rktio: repairs for dynamic fd_set support 2017-06-19 06:45:16 -06:00
Matthew Flatt
72b0351331 rktio: repairs for Linux 2017-06-19 06:45:16 -06:00
Matthew Flatt
6e1d519711 rktio: fix network problems 2017-06-19 06:45:16 -06:00
Matthew Flatt
3065773b31 rktio: add networking 2017-06-19 06:45:16 -06:00
Matthew Flatt
adedf861b2 rktio: finish epoll/kqueue layer 2017-06-19 06:45:16 -06:00
Matthew Flatt
04130638fc rktio: add kqueue/epoll layer 2017-06-19 06:45:16 -06:00
Matthew Flatt
09703b94f7 rktio: put "globals" in an rktio_t
Avoid thread-local state by threading a `rktio_t`
record through everything.
2017-06-19 06:45:16 -06:00
Matthew Flatt
68352ef86a rktio: more progress 2017-06-19 06:45:16 -06:00
Matthew Flatt
64146e94dc rktio: first cut at moving Racket OS wrappers to a library
The world doesn't need yet another cross-platform I/O library, but
it's getting one. This one has exactly the things that Racket needs,
and pulling it out will make it reusable from other VMs while
improving the Racket code organization.

This first step just gets started.
2017-06-19 06:45:16 -06:00
Matthew Flatt
dc14a68162 fix performance problem in expander
For a term

 (lambda (arg-id ...) (define def-id _rhs) ... (arg-id def-id) ...)

the expander could take quadratic time in the number of `def-id`s
due to walking an environment to remove use-site scopes. (The
variant of the expander rewritten in Racket didn't have this
problem.)
2017-06-08 07:01:31 -06:00
Matthew Flatt
ff26c2f29b fix complexity of type merging in bytecode optimizer
Merge a smaller table into a larger one to avoid an overall
quadratic-time computation.
2017-06-08 07:01:30 -06:00
Leif Andersen
5c27f5550c Add mzrt_sema_trywait to the mzrt library.
This commit add mzrt_sema_try_wait to the functions that operate
on semaphores. The existing ones are:

* int mzrt_sema_create(mzrt_sema **sema, int init);
* int mzrt_sema_post(mzrt_sema *sema);
* int mzrt_sema_wait(mzrt_sema *sema);
* int mzrt_sema_destroy(mzrt_sema *sema);
2017-06-05 10:46:24 -04:00
Leif Andersen
5510a76dca
scheme_add_atexit_closer now uses scheme_atexit.
This is because calling atexit is not correct in all
situations, namely on old operating systems.
2017-06-04 08:56:07 -04:00
Leif Andersen
a8fa5d4ebb
Add scheme_atexit c function.
This way programs can actually call atexit. (Otherwise atexit
is frequently not provided in libc as a symbol.)
2017-06-03 20:47:34 -04:00
Leif Andersen
2f6c42f3c1 Add a #:make-c-id flag to define-ffi-definer
This make-c-id allows an author to specify a convention for how
to connect and identifier defined with define-ffi-definer and
the actual symbol in the file.

* Adds docs.
* Adds tests.
* Adds history.
2017-06-02 10:26:57 -04:00
Matthew Flatt
f459dd9eb7 make collapse-module-path-index work on a "self" modidx 2017-06-01 19:37:18 -06:00
Matthew Butterick
4c5f66ff4a fix typo
`that do` → `that does`
2017-05-30 11:05:40 -04:00
Matthew Flatt
06b69c625f repair chainges to ffi/file
Bring back the exported `_file/guard`, `_file/r`, and `_file/rw`;
restore/move tests in "file.rktl" test suite; and add docs for new
functions.
2017-05-27 07:29:47 -06:00
Matthew Flatt
87c0ca84a8 add ffi/unsafe/global and switch openssl to use it
Continues the move away from using the FFI to access unsafe Racket
functionality.
2017-05-26 17:49:16 -06:00
Matthew Flatt
bf83d1126d add some unsafe operations as an alternative to FFI access
Accessing unsafe functionality through the FFI seemed like a good way
to avoid writing C code, but it made things more complicated instead
of easier, and it interacts badly with a more agressive shift away
from C (such as porting to Chez Scheme). So, add functions to the
primitive `#%unsafe` module, instead.
2017-05-26 16:26:06 -06:00
Matthew Flatt
7f1ab90806 raco exe on Mac OS: ensure that "PkgInfo" is writable
Relevant to #1680
2017-05-25 13:01:12 -06:00
Matthew Flatt
f27be30c15 fix error message 2017-05-25 13:01:08 -06:00
Jay McCarthy
07f35d248c Abort if munmap or protect_pages fails
On Linux, munmap can fail when you run out of mappable regions.

If protect_pages fails, then you can't install a write barrier
2017-05-25 13:38:33 -04:00
Milo Turner
cc25a27f87 fix id-set-symmetric-difference, same as 4716a6e fixed for sets 2017-05-24 15:55:03 -04:00
Stephen Chang
7620bfcb7c fix and actually run id-set tests 2017-05-24 13:25:15 -04:00
Stephen Chang
42152ed31c add neg-party arg to id-set-contract-check 2017-05-24 10:01:43 -04:00
Robby Findler
6a145244d6 add missing adjust-location call 2017-05-23 09:05:30 -05:00
Ben Greenman
b36c35ac7e typo: 'an mutable' => 'a mutable' 2017-05-21 02:00:00 -04:00
Ryan Culpepper
c082f130cb support string, bytes (bindings from racket) as stxclass refs
add compile-time table as alternative to stxclass binding
2017-05-18 12:54:26 -04:00
Daniel Feltey
1bdaf0b231 Fix typo for chaperone-vector* error messages 2017-05-17 12:50:05 -05:00
Daniel Feltey
8bc9cef7a9 Fix typo in vector contract implementation leading to wrong error message 2017-05-15 17:33:24 -05:00
Robby Findler
f2a29515d1 adjust invariant-assertion error message to avoid blame
closes #1681
2017-05-13 11:12:25 -05:00
Matthew Flatt
f43234e1cb add prop:authentic and (struct .... #:authentic ....)
An authentic structure type is one whose instances cannot be
impersonated or chaperoned. The intended use of `prop:authentic` is to
annotate a library-private data structure where impersonators are
never needed internally for the data structure, and the declaration
lets the compiler produce less code and fewer branches by omitting
impersonator support.
2017-05-12 12:40:57 -06:00
Robby Findler
65beb4de4c fix cons/dc's predicate 2017-05-12 11:26:49 -05:00
Robby Findler
8f34b702ab improve flat-contract test suite so that it checks
the predicate-ness of the contracts
2017-05-12 11:26:49 -05:00
Matthew Flatt
e6793c4598 fix variable-reference->module-path-index on primitive refs 2017-05-09 20:28:25 -06:00
Matthew Flatt
26c4dd6909 add #%unsafe exports to implement ffi/unsafe/atomic
Export functions through the usual `#%unsafe` primitive module,
instead of using the FFI to get at unsafe operations.
2017-05-09 09:32:34 -06:00
Matthew Flatt
e68e4bd6f6 minor configure --help format repairs 2017-05-09 09:32:34 -06:00
Robby Findler
79cef0a96e clean up a bunch of contract names 2017-05-06 22:10:41 -05:00
Matthew Flatt
de0d84f7b3 racket/serialize: repairs for structs that have auto fields
Closes #1650
2017-04-29 13:20:25 -07:00
Vincent St-Amour
13443dec92 Add chaperone-vector*, unsafe-chaperone-vector, and property-only vector chaperones.
By analogy with the procedure chaperone equivalents.
2017-04-28 14:27:53 -05:00
Vincent St-Amour
541015ba3b Update raco pkg new for v6.9.
(cherry picked from commit 351dcfe14d0f3aa7f7b5b1491d882c887a971c24)
2017-04-27 11:50:13 -05:00
Matthew Flatt
d469265a6e Makefile: support both cross-platform and non-cross installers
In non-cross mode, `-C` needs to go after `-G` and `-X` when setting
up a "bundle" directory to turn into an installer, because that mode
needs to use foreign libraries (such as SQLite) at build time, and it
can use the instances that are being set up for the installer.

Meanwhile, improve the advice for setting `PLAIN_RACKET` to use `-C`
for a cross-platform build mode, even though things tend to work
anyway without it.
2017-04-26 15:59:04 -06:00
Matthew Flatt
6de3659664 repair for hash-keys-subset?
When comparing a part of a hamt that is a collision node versus a
subtree node, a "hash code" was extracted from the collision node ---
but that's really a code for an integer key is that used for the
collision element. The comparison should instead use a code extracted
from the reference to the collision node (which is the code that is
common to all colliding keys).
2017-04-26 15:27:39 -06:00
Matthew Flatt
f8aeed279b Windows: fix 64-bit mzdyn.exp
Also, make the `raco exe` tests more accommodating to uncooperative
Windows configurations.
2017-04-25 16:31:51 -07:00
Matthew Flatt
c917434a86 improve cross-platform support
Detangle the target and host DLL and library directories by
making `get-lib-search-dirs` and `get-dll-dir` report the
host system's directories, and add `get-cross-lib-search-dirs`
and `get-cross-dll-dir`.

A new `-C`/`--cross` flag causes `racket` to save a host config and
collection directory and make them available via `(find-system-path
'host-{config,collects}-dir)`, while plus `(system-type 'cross)`
reports whether `-C` mode is in effect. Besides making the host paths
available, this change allows a same-platform build to run in
corss-platform mode.

The immediate problem to solve was the creation of Windows installers
on Windows, where recent changes to support 'gui-bin-dir configuration
need a clear distinction between the host Racket and the target Racket
being built, even if they're the same platform. (The "GRacket.exe"
executable didn't work, for example.)

The changes in this commit are more than needed for the immediate
problem, but they naturally build on the necessary `-C` flag, and they
support cross-platform package setup where native libraries are needed
during setup.
2017-04-25 08:31:26 -06:00
Matthew Flatt
83bf0e49ff add more auto-detected Visual Studio versions 2017-04-24 13:05:17 -06:00
Matthew Flatt
a71d87c5a9 optimizer: remove incorrect assertion 2017-04-21 14:28:57 -06:00
Matthew Flatt
9cb8c8fdd9 avoid O(n^2) GC time with ephemeron chains
Avoid the well-known possibility of quadratic handling of ephemeron
chains, where all ephemerons are immediately known, no keys are
immediately known, and each link in the chain has a value that refers
to the next link's key.

To aviod quadratic behior, attach a list of ephemerons to each page of
allocated objecst, where marking any object on the page triggers a
rescan of the ephemerons without waiting to rescan all ephemerons.
2017-04-20 20:48:55 -06:00
Matthew Flatt
3bc3fe9e26 fix dynamic-wind matching for continuation jumps
Thanks to Gustavo and Robby for tracking down the relevant feature
of a complex example that was found by random testing.
2017-04-19 07:00:34 -06:00
Matthew Flatt
fae55e83e2 history note for v6.9 2017-04-17 13:12:07 -06:00
Matthew Flatt
803d8ff0d5 fix launcher creation for gracket[-text] on Mac OS
The repair in 71a43f34c8 fixed the creation of some launchers, but it
broke GUI launchers with a relative reference on Mac OS.
2017-04-16 15:51:28 -06:00
Ryan Culpepper
995f320918 fix in-query result checks with grouping
closes racket/db#8

merge to release branch
2017-04-15 12:19:31 -04:00
Leif Andersen
922b5f06e9 Make log also accept a base. (#1667)
Make `log` in `racket/base` optionally accept a second argument.

The second argument is the log `base`. The docs also recommend
`fllogb` when precision is important.

* Error message when base is 1
* Added docs.
* Add tests.
2017-04-15 10:40:41 -04:00
Robby Findler
6492226411 add a #:name argument to flat-contract-with-explanation 2017-04-13 10:19:20 -05:00
Ben Greenman
1e29362dad typo: error message in parse-command-line 2017-04-12 14:51:32 -04:00
Matthew Flatt
662fd84eda raco: fix command name selection by prefix
Repairs a problem with 409321c03b.

Merge to v6.9
2017-04-10 08:22:49 -06:00
Matthew Flatt
016b8009c5 repair "info-cache.rktd" assumption of relative paths
Fix for 459a74455c to handle the case that a path
to record is not relative. The `raco pkg` tests
exposed the problem.
2017-04-09 10:53:05 -06:00
Matthew Flatt
459a74455c avoid platform-specific path conventions in "info-cache.rktd"
Store relative paths in "info-cache.rktd" (which corresponds,
roughly, to packages) in a platform-independent form, instead
of using the current platform's convention.

Using the current platform's covention works badly when
cross-compiling for Windows on Unix, since relative paths are used as
keys in the "info-cache.rktd" table. For example, updating a
pre-installed package on Windows mangles the mapping if the installer
is created from a cross-compiled installation.
2017-04-09 08:16:56 -06:00
Ben Greenman
3bb131ecb2 add #:generate keyword to build-flat-contract-property
the public function was missing the `#:generate` keyword,
 added this and documented why `#:exercise` is missing
2017-04-08 21:37:39 -04:00
Sam Tobin-Hochstadt
9d26d675a7 Provide srcloc when constructing define in define/contract. (#1660) 2017-04-08 14:38:59 -04:00
Vincent St-Amour
73d28d88d2 Post-release version for the v6.9 release 2017-04-07 13:30:52 -05:00
Matthew Flatt
5fb86dc55e fix ad-hoc hash-ref optimizaiton
Optimization to convert `(hash-ref <ht> <key> (lambda () <constant>))`
to `(hash-ref <ht> <key> <constant>)` didn't check that the `lambda`
for had zero argument.

Closes #1648
2017-03-30 18:45:26 -04:00
Matthew Flatt
92a0dcbcb0 fix problems with chaperoning/impersonating keyword functions 2017-03-29 12:26:48 -06:00
Ben Greenman
30aa951db8 gzip: use path-add-extension as default
instead of `string-append`-ing the extension,
 because that doesn't work for all path strings
2017-03-26 20:58:59 -04:00
Ben Greenman
2cbd44d64d add optional 'sep' argument to path-add-extension
New optional argument to 'path-add-extension',
 a byte string to replace for the '.' in the argument path.
2017-03-26 20:58:53 -04:00
Matthew Flatt
e22a5da06c find-relative-path: case-normalize for comparison by default
This change affects programs only on Windows. For example, `C:\a\b`
relative to `c:\A\c` is `..\b`, instead of not relative.

Closes #1603
2017-03-24 20:00:03 -06:00
Matthew Flatt
41e3deab97 racket/cmdline: fix table filtering when #:ps is used 2017-03-24 17:28:22 -06:00
Alex Knauth
7163c6ad98 generics: optional scope argument for private macros (#1644)
* generics: optional scope arg for private macros

To make them more friendly to macros that expand to generics

* add tests for generic-method-table macro
2017-03-24 15:52:44 -07:00
Gustavo Massaccesi
409321c03b raco: show all the matching commands for an ambiguous prefix 2017-03-24 13:16:36 -06:00
Matthew Flatt
424906af0a ffi/com: fix unsigned-int test
Closes #1633
2017-03-22 12:26:02 -06:00
Marc Burns
1309cf1649 Add procedures like port->X but close the port (#1634) 2017-03-16 15:52:43 -04:00
Robby Findler
9b987800fb adjust things so that integer-in contracts can have other names 2017-03-08 09:31:33 -06:00
Robby Findler
f5c5db3b3d fix a bug in recent and/c improvements and add proper printing for integer-in 2017-03-07 20:40:26 -06:00