Commit Graph

1863 Commits

Author SHA1 Message Date
Robby Findler
e76d1f7b8d update to match new, more accurate contract-stronger? 2016-01-02 17:19:48 -06:00
Robby Findler
f6e58fc7c7 remove some mzlib/contract exports that were unintentional,
copied from racket/contract because racket/contract/combinator
had some (provide (except-out (all-from-out <private-file>) ...))
that ended up accumulating things it shouldn't have over the years
2015-12-20 17:05:38 -06:00
Robby Findler
f9f77329a7 unbreak mzlib/contract's version of object-contract 2015-12-20 07:43:24 -06:00
Sam Tobin-Hochstadt
f2236ea54b Revert "Fix mzlib contract test for new or/c behavior."
This reverts commit cafefcf721.
2015-11-06 14:01:10 -05:00
Sam Tobin-Hochstadt
ed7f3e639e Make robby responsible for the mzlib tests. 2015-11-02 10:58:30 -05:00
Sam Tobin-Hochstadt
cafefcf721 Fix mzlib contract test for new or/c behavior. 2015-11-01 22:24:03 -05:00
Matthew Flatt
c28d032620 fix test
Some tests failed after commit 6e80609998, which adjusted the macro
system's handling of use-site scopes so that they're preserved by
`quote-syntax`. Those scopes get in the way of the test, which
is using macros to juggle syntax objects that include pieces
used as bindings via `eval`.
2015-10-02 14:59:29 -06:00
Alex Knauth
fb9aba2b8d Add test for handling of prefab structs
goes with https://github.com/racket/pconvert-lib/pull/4

Closes #2.
2015-09-20 19:34:15 -04:00
AlexKnauth
f376519eed tests for changes to mzlib/pconvert on immutable hash-tables
goes with https://github.com/racket/pconvert-lib/pull/2
2015-08-25 04:27:39 -05:00
Matthew Flatt
be6ae83cbd move racket/package tests to "compatibility-test"
The tests were formerly in the "racket-test" package.
2015-07-21 13:09:39 -06:00
Matthew Flatt
328c3d3276 racket/package: fix package-begin 2015-07-21 13:07:53 -06:00
Matthew Flatt
78f2ab8fa1 fix taint handling for package bindings 2015-05-15 09:42:52 -06:00
Matthew Flatt
35af3d14d0 re-implement racket/package for the new macro system
The new implementation is considerably simpler than the old
implementation, and it avoids `syntax-local-make-definition-context`,
`syntax-local-get-shadower`, and `syntax-local-make-delta-introducer`.
2015-05-15 09:42:52 -06:00
Matthew Flatt
f540a6c108 adjust syntax-set to use syntax-local-identifier-as-binding 2015-05-15 09:42:52 -06:00
Matthew Flatt
746e8ff1fb fix getpid for Windows ro use winapi instead of 'stdcall 2015-04-18 09:21:28 +01:00
Sam Tobin-Hochstadt
6943457ea1 Add standard .gitignore file. 2014-12-06 17:46:37 -05:00
Sam Tobin-Hochstadt
c8256f8b9d Remove extra directories. 2014-12-02 09:43:08 -05:00
Sam Tobin-Hochstadt
55f040676e Remove stray reference to Racket in LICENSE files.
Related to PR 14842.

original commit: 3bbdd134b1754d51422eeaec1c35e9c62d45144c
2014-11-25 14:09:57 -05:00
Robby Findler
d5921fc59c fix mzlib test for eaf48bbbf
original commit: 9ea9d0eaf8b2b6dd6b7b76aa377bf75b03e4d756
2014-09-21 05:33:19 -05:00
Matthew Flatt
20347c4964 add update-implies to package "info.rkt"s
original commit: eb9cbe20bf7b4ebc1eee63e2ca079ae566ff8c05
2014-08-14 16:49:53 +01:00
Robby Findler
6f008db1b2 fix real-in naming test cases
original commit: 60516049edd6f3dc25f86e77303d2e790379b4fc
2014-07-28 18:32:30 -05:00
Matthew Flatt
91eb4c90ac fix collection-file-path & related for binary package installation
Binary package installation failed in the case of collection
splicing, because module-name resolution via `collection-file-path`
did not check for compiled files along hte search path of
registered collection directories.

original commit: 43d81b06daab9d74493311d02f95eb1c64517f5e
2014-06-02 11:57:08 +01:00
Robby Findler
26b2b6c4d7 fix mzlib contract tests for or/c stronger improvements
original commit: aef9f1924b38c8a9ababd43fa16845004b783a64
2014-05-07 19:25:23 -05:00
Matthew Flatt
a67c0c7250 fix mzlib tests for use-before-initialization
original commit: 1727e4dbfcc223d0230cd05e598b0863f69395a8
2014-04-20 20:20:34 -06:00
Sam Tobin-Hochstadt
faa3058442 Fix mzlib/unit tests for new undefined handling.
original commit: 4872bdfb2fe6f1896d801145c5ef8530f59b23ca
2014-04-17 10:05:29 -04:00
Asumu Takikawa
c0cbbeccfb Remove the mzlib/class100 library.
Uses of mzlib/class100 have already been removed. The library's
removal was promised in the release notes for Racket v5.3.2.

original commit: 5711e9002fc6b926c4ecefe20b846e1931821f2a
2014-04-16 00:28:55 -04:00
Matthew Flatt
f97e6c799e mzlib/unit200: fix for undefined
original commit: b4c99eba170cbac1ea06ebd53f7ae3cfcdc10fba
2014-04-15 20:15:05 -06:00
Claire Alvis
230df670ea all necessary changes to check references to uninitialized letrec variables
includes a new pass, letrec_check, two new primitives, and
changes to packages that grabbed the letrec undefined value

original commit: 72c958df628690ebc52a626d35cd4edcab0c7089
2014-04-15 15:03:10 -06:00
Matthew Flatt
498efb4072 LGPL by reference
original commit: 981701d2378179d4ada54b7fd2608df3b89748fd
2014-02-27 15:56:11 -07:00
Robby Findler
cae54d2649 add one more missing require from recent class/c file rearrangement
original commit: 4ecba66b8d412191b609b2f1cebc888c836ad198
2014-01-31 09:07:51 -06:00
Robby Findler
8297a42801 move the class/c implementation into its own file
original commit: a12ebdeff9836f8ad9582261b41ec0c6d3aab9e3
2014-01-30 16:32:05 -06:00
Eli Barzilay
728322cbbd 2013 -> 2014
original commit: c61a549840ee0ba5f2e5da56523fd3b26efeb895
2014-01-21 15:02:21 -05:00
Matthew Flatt
b3bdbe33ed copy responsible info to "info.rkt" files
It seems more ideal that `pkg-authors` would be specific enough
responsibility, but our existing allocations of responsibility are
more fine-grained, and we keep them for now.

original commit: 19f8f30f63ece380105f69796c046c7a00aa4f97
2014-01-01 07:27:15 -07:00
Robby Findler
454cd422f0 Change contract system so that projections are more first-order friendly
The main changes are the addition of a new way to specify projections,
using the #:val-first-projection keyword argument; the main goal of the
new API is that more information can be supplied to the projection on
the server side of the contract boundary. In addition, the arrow contracts
will now, internally and in some cases (see define-module-boundary-contract)
return functions that accept one additional argument than the original
function did and then insert the name of the negative party into call sites.

The rough idea is that if you have a program like this one:

  #lang racket/base
  (define (f x) (+ x 1))
  (provide (contract-out [f (-> integer? integer?)]))

then the contract system produces something much closer to this:

  #lang racket/base
  (define (f x) (+ x 1))

  (provide (rename-out [external-f f]))
  (define (external-f neg-party x)
    (check-integer neg-party x)
    (define ans (f x))
    (check-integer neg-party ans)
    ans)

  (define local-blame-information ...)
  (define (check-integer neg-party v)
    (unless (integer? v)
      (raise-blame-error local-blame-information
                         #:missing-party neg-party
                         ...)))

where 'raise-blame-error' can now cope with blame objects that don't
have negative part information in them (when the #:missing-party
argument is supplied, essentially just reassembling the original blame
record at that point)

Then, on the client side, if we had

   (f x)

it gets transformed into

   (f '<<my-modules-name>> x)

and if we had

   (let ([g f])
     ...)

you get a slow path:

    (let ([g (lambda (x) (f '<<my-modules-name>> x))])
      ...)

(where we don't create a wrapper lambda, of course, we actually create
a procedure chaperone)

The performance improvements seem pretty good (see below for the
precise programs that I ran and the numbers I got):

  first order contract microbenchmark: 6x speedup
  higher-order contract microbenchmark: 1.5x speedup
  first-order TR contract interop micro benchmark: 6x speedup

This also improves the memory use for DrRacket by about 3% (from about
236.8 mb to 231.3 mb), presumably because more of the data structures
created by the contract system can be created only once, on the server
side.

Be aware, however, that not all combinators are using the new
projections and the code that translates between the two APIs
is slow.

Also there are a bunch of other changes that got made while I was
doing this. Most notably, the change above were not designed for the
performance improvements to arrow contracts, but to make it possible
to implement class/c contracts with a (hopefully) negligible space
overhead. That work is not yet finished, but this commit includes some
changes to the class system to prepare the way for those changes.

Unfortuantely, these changes slow down 'send' on microbenchmarks by
about 24%. The change comes from the addition of an extra 'if' (and
predicate test and possibly the extra let expresison) that's inserted
into the expansion. I'm not happy about that (I was shooting for 10%)
but I'm not sure that we can do much about it (except perhaps double
check my measurements, see below).

Other misc changes:

- improve arity mismatch error messages by including the arity of the
  given procedure (closes PR 14220)

- Adjust case-> so it generates less code. This seems to reduce the
  size of the math library .zo files by about 3% (from 10440k to
  10156k for me)

- speeds up the contract tests a bit

- move recontract out into racket/contract (also, document it)

- added define-module-boundary-contract

- streamline TR's any-wrap/c and adjust it to use
  #:val-first-projection instead of #:projection

- adjust a bunch of contracts to print more nicely

- and, of course, Rackety

--------------------------------

The precise programs that I tried and their timings (the raw data
for the performance claims above):

 #lang racket/base
(module m racket/base
  (require racket/contract/base)
  (define (f x) x)
  (provide (contract-out [f (-> any/c any/c)])))

(require 'm)
(time
 (for ([x (in-range 100000)])
   (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8)
   (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8)
   (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8)
   (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8)
   (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8)
   (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8)
   (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8)))

pre-push timings:

cpu time: 3553 real time: 3552 gc time: 52
cpu time: 3548 real time: 3552 gc time: 52
cpu time: 3525 real time: 3525 gc time: 54
cpu time: 3547 real time: 3547 gc time: 47

post-push timings:

cpu time: 515 real time: 515 gc time: 15
cpu time: 522 real time: 522 gc time: 17
cpu time: 560 real time: 560 gc time: 19
cpu time: 514 real time: 515 gc time: 19
cpu time: 507 real time: 507 gc time: 17

A second order example using vectors (note that vector/c isn't yet
updated to the #:val-first-projection, so it will be way slower)

 #lang racket/base
(module m racket/base
  (require racket/contract/base)
  (define (f x) (vector-ref x 0))
  (provide (contract-out [f (-> (vectorof any/c) any/c)])))

(require 'm)
(define v (vector void))
(time
 (for ([x (in-range 10000)])
   (f v) (f v) (f v) (f v) (f v) (f v) (f v) (f v)
   (f v) (f v) (f v) (f v) (f v) (f v) (f v) (f v)
   (f v) (f v) (f v) (f v) (f v) (f v) (f v) (f v)
   (f v) (f v) (f v) (f v) (f v) (f v) (f v) (f v)
   (f v) (f v) (f v) (f v) (f v) (f v) (f v) (f v)
   (f v) (f v) (f v) (f v) (f v) (f v) (f v) (f v)
   (f v) (f v) (f v) (f v) (f v) (f v) (f v) (f v)))

pre-push timings:

cpu time: 744 real time: 745 gc time: 20
cpu time: 679 real time: 679 gc time: 18
cpu time: 695 real time: 695 gc time: 23
cpu time: 743 real time: 742 gc time: 21
cpu time: 780 real time: 786 gc time: 21
cpu time: 723 real time: 726 gc time: 25

post-push timings:

cpu time: 448 real time: 448 gc time: 18
cpu time: 470 real time: 469 gc time: 19
cpu time: 466 real time: 465 gc time: 16
cpu time: 457 real time: 456 gc time: 15
cpu time: 465 real time: 466 gc time: 24

Using contracts in TR

 #lang racket/base
(module m typed/racket/base
  (: f (Any -> Any))
  (define (f x) x)
  (provide f))

(require 'm)
(time
 (for ([x (in-range 10000)])
   (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8)
   (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8)
   (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8)
   (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8)
   (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8)
   (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8)
   (f 1) (f 2) (f 3) (f 4) (f 5) (f 6) (f 7) (f 8)))

pre-push timings:

cpu time: 357 real time: 357 gc time: 6
cpu time: 446 real time: 447 gc time: 4
cpu time: 361 real time: 359 gc time: 4
cpu time: 366 real time: 366 gc time: 5
cpu time: 368 real time: 367 gc time: 6

post-push timings

cpu time: 63 real time: 63 gc time: 7
cpu time: 64 real time: 63 gc time: 8
cpu time: 63 real time: 64 gc time: 8
cpu time: 58 real time: 58 gc time: 8
cpu time: 59 real time: 59 gc time: 7

Slowdown for 'send':

 #lang racket/base
(require racket/class)
(define c% (class object% (define/public (m x) x) (super-new)))
(define o (new c%))
(time
 (for ([x (in-range 100000)])
   (send o m 1) (send o m 2) (send o m 3) (send o m 4)
   (send o m 5) (send o m 6) (send o m 7) (send o m 8)
   (send o m 1) (send o m 2) (send o m 3) (send o m 4)
   (send o m 5) (send o m 6) (send o m 7) (send o m 8)
   (send o m 1) (send o m 2) (send o m 3) (send o m 4)
   (send o m 5) (send o m 6) (send o m 7) (send o m 8)
   (send o m 1) (send o m 2) (send o m 3) (send o m 4)
   (send o m 5) (send o m 6) (send o m 7) (send o m 8)
   (send o m 1) (send o m 2) (send o m 3) (send o m 4)
   (send o m 5) (send o m 6) (send o m 7) (send o m 8)))

timings pre-push:

cpu time: 251 real time: 251 gc time: 0
cpu time: 275 real time: 275 gc time: 0
cpu time: 250 real time: 250 gc time: 0
cpu time: 246 real time: 246 gc time: 0
cpu time: 247 real time: 246 gc time: 0

timings post-push:

cpu time: 303 real time: 302 gc time: 0
cpu time: 333 real time: 333 gc time: 0
cpu time: 315 real time: 315 gc time: 0
cpu time: 317 real time: 317 gc time: 0
cpu time: 311 real time: 310 gc time: 0

original commit: c321f6dd0c4e2444d44b6c79a3ac49acfb9041bf
2013-12-11 12:05:30 -06:00
Matthew Flatt
22e605d6b2 fix "base" and "compatibility" test drivers
original commit: 3cc9446b656bb3acce5215ff11feb81645e542e2
2013-11-11 05:51:32 -07:00
Matthew Flatt
1eda1e65e9 "racket-test" clean-up
Move a few tests, and clear out a lot of junk.

original commit: 29a0c44c98d5c8d3660e4bd10eb566c7ec6e46e2
2013-11-09 08:30:37 -07:00
Matthew Flatt
0bb7f6eeaa serializable-struct, etc.: export deserialization info in submodule
This change is slightly incompatible, because `serializable-struct`,
`define-serializable-struct`, and `define-serializable-class` no
longer `provide` and identifier that they used to. Instead, the identifier
is provided by a `deserialize-info` submodule.

The deserializer looks for a `deserialize-info` submodule, and then
falls back to using a module if the submodule is not available.

original commit: 90142edc5b4649e058ccf66970c119076ac5e864
2013-11-08 18:13:43 -07:00
Matthew Flatt
fa2a6cb629 move some test & doc collections out of "racket-" pkgs to new pkgs
original commit: 1920ac59ab0607502641298fc575b66e6acd8c73
2013-10-15 17:50:32 -06:00
Matthew Flatt
f1a56929b5 include license with each package
original commit: ff9da94cfb852d25cd54bc0d9a904c8ae46fe64c
2013-08-31 06:25:31 -06:00
Matthew Flatt
5c88d18eaa auto-fix dependencies for "scheme-lib" and "srfi-lite-lib"
original commit: c709af5bf4d3af8f8c7a5918cf0b521ac1846f78
2013-08-27 15:20:58 -06:00
Asumu Takikawa
e37b068e40 Fix contract hyperlinks in pconvert docs
original commit: 8a685777ff8625bfadd15b6c8463b890f76b0150
2013-08-21 13:45:44 -04:00
Matthew Flatt
22e3d9e6d4 add pkg-desc' and pkg-authors' to each package
This information will be used to construct a catalog from the
package directories.

original commit: 057bfc2ea1a24e85ece2d5f85da30076643ea598
2013-07-31 07:06:24 -06:00
Matthew Flatt
39b1e8408f remove core dependency on `mzlib/restart'
original commit: 2a4f32d853c90737ae546127629974716a68214b
2013-07-10 12:57:02 -06:00
Matthew Flatt
c20cc9d276 move compile-file' to compiler/compile-file'
The `mzlib/compile' module re-exports the moved function.

Also, fix `make-directory*' so that it never fails on an existing
directory. Remove `unstable/file', since it was just the same
clean-up of `make-directory*'.

original commit: 8d3c09b38b853dabffb5a58ba6a34876ca4f62fb
2013-07-10 12:57:02 -06:00
Matthew Flatt
a10568fa5e move mzscheme' and mzlib/unit200' from core to "compatibility-lib"
Also, move `mzlib/sandbox' to "compatibility-lib".

original commit: 72c91629893290cce4ea4082b08449b1a6914738
2013-07-10 12:57:02 -06:00
Sam Tobin-Hochstadt
a67635efb7 Use #lang info instead of #lang setup/infotab.
original commit: 5a7ca7ebb56b2215f2d395ed052c03ea740817ea
2013-07-04 16:46:32 -04:00
Sam Tobin-Hochstadt
87c14eaa6c Move most of the compiler collection to compiler-lib.
original commit: 3ad009070e063614f22a32fbbffa950a8d84e599
2013-07-01 12:08:42 -04:00
Sam Tobin-Hochstadt
b0043b013b Remove most uses of mzscheme in the core.
Remaining are:
 - parts of unit200 that Matthew plans to remove.
 - the `mzscheme` implementation itself.

The implementation of `mzscheme` has been moved
to the `mzscheme` collection (from the `racket` and
`scheme` collections). The `scheme/mzscheme`
language, which was undocumented, has been removed.

This is slightly backwards-incompatible, because
the `xform` handling of precompiled headers now
evaluates code in a `racket/base`-like namespace,
instead of in a `mzscheme`-like namespace.

original commit: d54c1e4e4942c26dcbaaebcc43d5c92d507a8112
2013-07-01 12:08:42 -04:00
Sam Tobin-Hochstadt
35c1d068c5 Move most of the net collection out of the core.
- Most units and signatures from the `net` collection
  are now in `compatibility-lib`.
- Most of the actual libraries are in the `net-lib`
  package.

original commit: 2b1fb036c63639bc5dbb65348c4f4e5802c95b53
2013-07-01 11:27:14 -04:00
Robby Findler
07ae599578 add compatibility package
original commit: 70dcd2ecf61da462d5b6fa3807ddd26c7fbb5f62
2013-06-29 20:25:32 -05:00