Commit Graph

3306 Commits

Author SHA1 Message Date
Matthew Flatt
b5755371fd copy drdr:random command props to test configs
original commit: 48a85125dae2db557443daaa7893f84abbd15f93
2014-01-01 08:21:31 -07:00
Matthew Flatt
d4c1468be4 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
Matthew Flatt
3261fd7a59 sync test configuration for non-".rkt" files
original commit: 43d3479786c37152172b2a62432f37f8a20f664e
2013-12-30 12:15:18 -07:00
Matthew Flatt
40b69a9a80 move "props" test configs to test submodules or "info.rkt" files
The "props" file still has

 * ".rkt" `drdr:timeout` entries, needed until DrDr uses submodules and
   "info.rkt" files; although timeout information has been put in
   submodules for `raco test`, DrDr uses `raco test` in a way that does not
   enable timeouts, so that DrDr can implement timeouts itself (and record
   when a test times out)

 * ".rkt" `drdr:random #t` entries; not sure what to do with these, yet

 * ".rkt" `responsible` entries; not sure what to do with these, yet

 * ".rktl" `drdr:command-line #f` entries, needed until all ".rktl" files
   are disabled in DrDr

The following files were previously disabled for DrDr testing, but were
intentionally left as enabled with these changes:

pkgs/racket-pkgs/racket-test/tests/pkg/shelly.rkt
pkgs/racket-pkgs/racket-test/tests/pkg/util.rkt
pkgs/racket-pkgs/racket-test/tests/pkg/info.rkt
pkgs/racket-pkgs/racket-test/tests/pkg/basic-index.rkt
pkgs/racket-pkgs/racket-test/tests/racket/link.rkt
pkgs/racket-pkgs/racket-test/tests/racket/embed-in-c.rkt
pkgs/racket-pkgs/racket-doc/ffi/examples/use-c-printf.rkt
pkgs/racket-pkgs/racket-doc/ffi/examples/c-printf.rkt
pkgs/parser-tools-pkgs/parser-tools-lib/parser-tools/private-lex/error-tests.rkt
pkgs/mysterx/mysterx.rkt
pkgs/mysterx/main.rkt
pkgs/games/gobblet/test-model.rkt
pkgs/games/gobblet/test-explore.rkt
pkgs/games/gobblet/robot.rkt
pkgs/games/gobblet/check.rkt
pkgs/db-pkgs/db-lib/db/private/odbc/main.rkt
pkgs/db-pkgs/db-lib/db/private/odbc/ffi.rkt
pkgs/db-pkgs/db-lib/db/private/odbc/dbsystem.rkt
pkgs/db-pkgs/db-lib/db/private/odbc/connection.rkt
pkgs/distributed-places-pkgs/distributed-places-lib/racket/place/distributed/examples/hello-world.rkt
pkgs/redex-pkgs/redex-lib/redex/private/compiler/match.rkt
pkgs/redex-pkgs/redex-lib/redex/private/compiler/match.rkt
pkgs/htdp-pkgs/htdp-test/2htdp/utest/balls.rkt
pkgs/gui-pkgs/gui-test/framework/tests/test-suite-utils.rkt
pkgs/games/paint-by-numbers/raw-problems/size-calculation.rkt
pkgs/db-pkgs/db-lib/db/odbc.rkt
pkgs/compatibility-pkgs/compatibility-lib/mzlib/traceld.rkt
pkgs/cext-lib/dynext/private/stdio.rkt
pkgs/db-pkgs/db-lib/db/odbc.rkt
racket/collects/ffi/unsafe/objc.rkt
racket/collects/ffi/objc.rkt
pkgs/racket-pkgs/racket-test/tests/pkg/tests-db.rkt
pkgs/racket-pkgs/racket-test/tests/pkg/test-docs.rkt
pkgs/racket-pkgs/racket-test/tests/pkg/test-catalogs-api.rkt
pkgs/gui-pkg-manager-pkgs/gui-pkg-manager-lib/pkg/gui/main.rkt
pkgs/redex-pkgs/redex-lib/redex/private/compiler/redextomatrix.rkt
pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-special-env.rkt
pkgs/planet-pkgs/planet-test/tests/planet/version.rkt
pkgs/planet-pkgs/planet-test/tests/planet/test-docs-complete.rkt
pkgs/planet-pkgs/planet-test/tests/planet/lang.rkt
pkgs/planet-pkgs/planet-test/tests/planet/docs-build.rkt
pkgs/drracket-pkgs/drracket-test/tests/drracket/follow-log.rkt
pkgs/drracket-pkgs/drracket/drracket/private/dock-icon.rkt
pkgs/drracket-pkgs/drracket-test/tests/drracket/tool-lib-and-sig.rkt

original commit: e226ad66c5fb6095d5702e5c47f5c7cf73e914f5
2013-12-30 12:15:18 -07:00
Asumu Takikawa
80d4bc4833 Test the error message instead of a predicate
This test was broken prior to commit 370c4bd but
didn't fail because the test harness didn't test for
the right error.

original commit: 401c4dd0a662da7bf3dfe211946f9ab12f8a8346
2013-12-18 19:25:17 -05:00
Robby Findler
20cd880755 fix any-wrap/c for promises
original commit: 370c4bdce240da5fa5513ae575335d5c548f58cc
2013-12-18 12:58:56 -06:00
Asumu Takikawa
b8f328cdbf Refactor tc-utils
Use an explicit `provide` list and delete unused functions.

original commit: f4d5b00ea582462a5f545b52056ef8227feca679
2013-12-17 14:40:24 -05:00
Asumu Takikawa
a0009b5e5d Fix base env types that are too conservative
These accessors and removers required the target value
to have the same type variable as the collection, but
that's more conservative and less useful than Any.

original commit: 098f398a14b816fda66477ed516464c9c15961bb
2013-12-17 01:33:47 -05:00
Eric Dobson
4ebfe5617f Add a bunch of tests for contract creation error messages.
Also minor fixes to said error messages.

original commit: 7060bdd0f858ccd7b85e7b9899ff6b55c5a29b29
2013-12-16 21:04:36 -08:00
Vincent St-Amour
d265a21b16 Update Typed Racket history.
Please merge to 6.0.

original commit: ac480e7535570cc42f7f7f94818f5a05cda11056
2013-12-16 17:05:39 -05:00
Vincent St-Amour
b3988ebab9 Remove dependencies of typed-racket-more.
original commit: 46260a6e8527bc7a18e9d4d72ab2140f89e9ed00
2013-12-16 17:04:16 -05:00
Vincent St-Amour
a0274e90cc Remove dependency on scheme-lib.
original commit: e0caf456dd3bdeb983482ddcfd8418bbc7bb0d90
2013-12-16 17:04:16 -05:00
Vincent St-Amour
2b87778cc9 Remove some SRFI dependencies.
original commit: 2195bdd15aa771c5bc2388ac3eca99256619993d
2013-12-16 17:04:16 -05:00
Vincent St-Amour
670bde6aad Split legacy Typed Racket languages into their own module.
original commit: 9a67230ae0eb04f5e6667dd5e05a64e9e5789edd
2013-12-16 17:04:15 -05:00
Eric Dobson
b24a9cac44 Add test to track tr memory usage.
original commit: edb04b8bfeefcdcfe57fe24ed2cc03799e8eb77d
2013-12-16 09:42:27 -08:00
Eric Dobson
ef52853ea7 Fix broken TR code.
original commit: ef6af9c47cbe8515bc6a0d2b19133b7936096e29
2013-12-15 17:00:53 -08:00
Eric Dobson
64dae22ed8 Make top interaction commands lazily loaded.
original commit: 5d4cb8c08bca391aa16ffd0298fe40240b6f7e52
2013-12-15 14:13:07 -08:00
Eric Dobson
729d2e9d4a Remove unused export.
original commit: 8e51f2b5acd9dfba558b7ef9f82684b95d8ef972
2013-12-15 14:01:03 -08:00
Eric Dobson
482a9111d7 Cleanup duplication in check-subforms-unit.
original commit: 1d0164f51b9730aa35324bda6222a5b3d718f924
2013-12-14 09:42:50 -08:00
Eric Dobson
3def8438c1 Minor cleanup in prims.
original commit: ee47fe5f259d254fbd47d2a11f6a972342de3f5b
2013-12-14 09:42:50 -08:00
Eric Dobson
593fc00875 Make better interface for properties with only booleans.
original commit: fced81a541dd620386029a52dd940d43759e51ba
2013-12-14 09:42:50 -08:00
Eric Dobson
ae129f9c90 Make syntax class for syntax properties.
original commit: 15fddbafe052a4bafd94e446a8609134a9adbe1e
2013-12-14 09:40:16 -08:00
Robby Findler
d12722eeff fix some bugs in the traversal function in any-wrap that I introduced
Also, rename the function so that errors like this don't take me as long to find

original commit: 1f1550ae5535a476ad9c2c50cdebeb41ae30c80d
2013-12-12 22:48:57 -06:00
Asumu Takikawa
14547ed763 Quote the identifier in the declaration error msg
Please merge to v6.0

original commit: 34c5b327463db014fb0d3c42922d60e75e4ada63
2013-12-12 16:25:21 -05:00
Asumu Takikawa
c95008e2c3 Better error msg for annotations on unbound ids
Closes PR 14246

Please merge to v6.0

original commit: f1d35f6ec94e1c9dff2d149c5f7f7a777a78f547
2013-12-12 16:25:21 -05:00
Robby Findler
371472e5ed fix spelling error
original commit: af8f13b16ac93c7acd50de295379dd589bb9d769
2013-12-12 15:24:02 -06:00
Eric Dobson
48dcf14b58 Add types to hasheq and hasheqv.
Merge to 6.0.

original commit: 48a16b2b8a6cb0af6607a3056f6723f34da855f3
2013-12-12 08:32:06 -08:00
Robby Findler
1fd8631786 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
Vincent St-Amour
272a17c107 Remove unused type variable.
original commit: 64464faf51c07a98049509d79410060edad1d9c3
2013-12-10 11:52:37 -05:00
Asumu Takikawa
01a7caded8 Fix types for remove and friends.
A few of these had unnecessary uses of type variables.
The type for `remove*` was unsound.

Please merge to v6.0

original commit: a98e4c5474f83cc146b62baf64c3fa2ee8132fef
2013-12-09 23:59:01 -05:00
Vincent St-Amour
a8368048e2 Make type of expt more precise on floats.
Closes PR14228.

original commit: e28a860cc075445996dd6633444a1604e97565c5
2013-12-09 14:08:02 -05:00
Asumu Takikawa
11aeb527f3 Add more documentation for Procedure type
Please merge to v6.0

original commit: 1243d12248214d8e261a0496f273fe1ea7127e28
2013-12-07 22:57:53 -05:00
Asumu Takikawa
287bb05db9 Add tests for some recent base type additions
original commit: 78820bda4528ca100524d5007cf46905d039803d
2013-12-05 23:41:56 -05:00
Vincent St-Amour
5599f3b8ff Fix type expansion suggestion.
Closes PR14212.

original commit: f2de6dfee9934649d361f33b524ef0a77c38ae18
2013-12-05 11:57:36 -05:00
Asumu Takikawa
9ff3fa9ff0 Add type for regexp-replaces
Please merge to v6.0

original commit: 1f74a6713907d7e1770dc8422164ef1bb01b904f
2013-12-05 01:47:41 -05:00
Asumu Takikawa
d138d2df0c Add remaining racket/string types
Please merge to v6.0

original commit: 2d8a3cffda3cd71712b763cda1d2439c480d1bc8
2013-12-05 01:33:27 -05:00
Eric Dobson
2791f89cd2 Add #f as a special case for hash-ref, fix hash-ref!.
Closes PR 14158.

Merge to 6.0.

original commit: 258d9b8e2f53936ff166c069ca0ab267ed77f602
2013-12-01 11:25:52 -08:00
Robby Findler
459a59a954 adjust check syntax so it can show info before expansion completes
and sometimes when there are syntax errors raised

In more detail, rearrange online check syntax's internal plumbing
so that syntax objects can be handed to check syntax at any point
(via a special log message, see the changes to the docs)
not just when expansion is finished

Use this in TR to get check syntax information even when there is
a type error (and also get the check syntax information processing
started before type checking starts (altho this isn't running
in a separate place, so there is no new parallelism here))

original commit: 09920bd8ce46f15d9cf4a5066ab2cfb84bbdd417
2013-11-26 22:46:51 -06:00
Asumu Takikawa
f44c9539f0 Improve type of negate
Now for functions with simple filters, it'll negate the
filters so that, e.g., (negate string?) can be used with
occurrence typing.

Please merge to v6.0

original commit: 0f8ee738142c8e253c638c836fc1c5c893751d32
2013-11-21 22:53:04 -05:00
Asumu Takikawa
1baea70249 Caveat section on macros/phase-1+ code in TR
Please merge to v6.0

original commit: d29256eeb22c1d1cfff79d93654ede26023acf33
2013-11-21 22:53:04 -05:00
Asumu Takikawa
3ff3d7eead TR: Prevent internal error on begin-for-syntax
Closes PR 13878

Please merge to v6.0

original commit: 9da8203c9c3a7c101360f57c6721f7f1a071ca91
2013-11-21 22:53:04 -05:00
Eric Dobson
e9c9d6ae30 Improve comments and change name for unboxable-funs.
original commit: 2fd6a05d462ab7c927168693434c9e4580e6ddc8
2013-11-20 23:46:36 -08:00
Eric Dobson
5278b8ea0c Move more call-site optimization structure into the syntax class.
original commit: 69f690f4b981901e060732aaae392189e1490c14
2013-11-20 23:43:59 -08:00
Eric Dobson
26783b6c7c Make unboxed let-bindings only log their clause.
original commit: af6bc6e8e225cd5ce3bb2bdd2b64a6c362fb6d32
2013-11-20 23:43:57 -08:00
Eric Dobson
2e3f6d3ab6 Make new syntax class for all clauses.
original commit: 74ce1ea748e4d911c4edfea0c30b60ae41706d15
2013-11-20 23:39:10 -08:00
Eric Dobson
ac001357e7 Make standard syntax class so that clauses are in order.
original commit: 3681fe8105f04a173558d363ae631eae5a42fcd9
2013-11-20 23:39:10 -08:00
Eric Dobson
ed24ba5c3e Add more syntax classes for let-clauses.
original commit: 6d84fe3cf24d327aa0421724356234774d2cde62
2013-11-20 23:32:23 -08:00
Eric Dobson
a2327c05f3 Add benchmarks to TR test dependencies.
original commit: 3e37e940002a581b6295014ccf5a5c99ad03fc50
2013-11-20 23:13:39 -08:00
Eric Dobson
a9fc827be7 Correctly typecheck all subelements of vector literals.
Closes PR 14184.

original commit: cbe1b532795819d45c9bc8ccbaf1507c21b01649
2013-11-20 21:25:28 -08:00
Asumu Takikawa
70995fa7b0 Fix provide: when it's after the definition
Closes PR 11172

Please merge into 6.0

original commit: 7e1b3c306d57b5f7d56a16c468518a790c7952ac
2013-11-20 18:42:28 -05:00