Commit Graph

38543 Commits

Author SHA1 Message Date
Ryan Culpepper
2e96b60120 syntax/parse: fix internal debugging code (delete iattrs field) 2016-08-01 10:47:39 -04:00
Ryan Culpepper
f968b87385 syntax/parse: remove unused field from pat:pair, pk/pair 2016-08-01 10:47:38 -04:00
Ryan Culpepper
d6a3a22989 syntax/parse: propagate description-if-constant to annotated pvars
fixes #1392
2016-08-01 10:47:38 -04:00
Ryan Culpepper
71fbe4ad7d syntax/parse: remove unused field from rhs struct 2016-08-01 10:47:38 -04:00
Ryan Culpepper
22b5d6b2da syntax/parse: add description-if-constant field to stxclass
Also remove (inline) options, integrate structs and improve comments.
2016-08-01 10:47:38 -04:00
Ryan Culpepper
1f94c4ed3a syntax/parse: fix test for drdr; suppress logging output 2016-08-01 10:47:38 -04:00
Ryan Culpepper
3a7bf955c0 remove useless requires 2016-08-01 10:47:38 -04:00
Ryan Culpepper
ce1bf2503d syntax/parse: combine away pattern-expander*.rkt modules 2016-08-01 10:47:38 -04:00
Ryan Culpepper
6fe55ec307 syntax/parse: trim txlifts helper module 2016-08-01 10:47:38 -04:00
Ryan Culpepper
0a7d97df86 syntax/parse: fix dependencies, add deps test
Removes residual dep on racket/contract (again!)
Removes use of racket/struct (which depends on contract)
List other residual dependencies in sc.rkt
2016-08-01 10:47:38 -04:00
Leif Andersen
cb1a1e233e Cannot show system build paths in docs 2016-08-01 09:34:12 -04:00
Leif Andersen
1b050905e9 Add example for collection-file-path 2016-07-31 23:19:49 -04:00
Gustavo Massaccesi
bfa269982f optimizer: don't move APPN_FLAG_OMITTABLE inside lambdas
Some expressions are omittable only when the arguments have certain types.
In this case the application is marked with APPN_FLAG_OMITTABLE instead of relaying on the flags of the primitive.

The optimizer can't use this flag to move the expression inside a lamba or across a potential continuation capture, unlike other omittable expressions. They can be moved
only in more restricted conditions.

For example, in this program

  #lang racket/base

  (define n 10000)
  (define m 10000)
  (time
   (define xs (build-list n (lambda (x) 0)))
   (length xs)
   (define ws (list->vector xs)) ; <-- omittable
   (for ([i (in-range m)])
     (vector-ref ws 0)))     ; <-- ws is used once

If the optimizer moves the expression in the definition of ws inside the recursive
lambda that is created by the for, then the code is equivalent to:

  #lang racket/base

  (define n 10000)
  (define m 10000)
  (time
   (define xs (build-list n (lambda (x) 0)))
   (length xs)
   (for ([i (in-range m)])
     (vector-ref (list->vector xs) 0)))     ; <-- moved here

And the new code is O(n*m) instead of O(n+m). This example is a minimized version
of the function kde from the plot package, where n=m and the bug changed the run
time from linear to quadratic.
2016-07-31 08:58:54 -03:00
Gustavo Massaccesi
004fd02501 optimizer: don't mark (-) as omittable
The application of some procedures are omittables when the arguments have
certain properties. Check the arity of the procedure before marking the application as omittable.
The only case that appears to be relevant is the expression (-).
2016-07-31 08:54:54 -03:00
Gustavo Massaccesi
8bb79deaa2 extend reductions for eq? to expressions with eqv? and equal?
The relevant predicates are almost disjoint. The superposition
is solved with predicate_implies and predicate_implies_not.

This is also valid considering the equivalence classes modulo
eqv? and equal?. So if the optimizer knows that two expressions
X and Y have different relevant types, then it can reduce
(equal? X Y) ==> (begin X Y #f).
2016-07-31 08:50:43 -03:00
Leif Andersen
99b35a5d08 gracket should use gui-interactive.rkt
Previously it used interactive.rkt, which is problematic when the user
wants to have a different file for interactive.rkt and gui-interactive.rkt
2016-07-30 13:45:11 -04:00
Ben Greenman
22546a3f22 typo: description of module-compiled-name argument 2016-07-30 02:14:01 -04:00
Leif Andersen
4c61013ef2 Default repl should remain using ">" for prompt
Although xrepl uses ->, the default prompt should be `>`, to
maintain compatability with old shell scripts.
2016-07-29 23:17:26 -04:00
Ryan Culpepper
b7bd836f0f document this-syntax and #:auto-nested-attributes
fixes #1185, #1350
2016-07-29 17:39:33 -04:00
Stephen Chang
c56efb22a6 remove mention of syntax-id-rules in Macros section of Guide 2016-07-29 16:19:43 -04:00
Alexis King
169472487e Wrap various syntax/parse forms in with-disappeared-uses (#1397)
fixes #1396
2016-07-29 13:11:49 -04:00
Ben Greenman
ba8b848f94 Accept path-string in syntax/modcode
Changes signatures in `syntax/modcode` to accept `path-string?` arguments
 instead of `path?`.
Before, the docs listed `path-string?` but the contracts used `path?`.
Now they agree.
2016-07-29 12:26:10 -04:00
Matthew Flatt
6e4a4f4949 validator: thread structure-type info all the way through
The optimizer now makes more choices based on imported structure-type
info that thet validator needs to reconstruct, so pass that
information all the way through.
2016-07-29 09:45:11 -06:00
Marc Burns
ef41bf21cb fix wrong pluralization 2016-07-28 15:33:13 -05:00
Marc Burns
cdf9da7da4 an string -> an immutable string 2016-07-28 15:33:13 -05:00
Alexis King
1b63703ac0 Fix for-label requires for some struct documentation 2016-07-28 15:33:13 -05:00
Matthew Flatt
e3ae0103af fix a backward test on use-compiled-file-check
The backward test causes docs to be rebuilt too much.
2016-07-28 09:19:11 -06:00
Matthew Flatt
3f4e7d90cb improve compiler recognition of stuct constrcutors
Allow a `struct` form to be recognized when it provides
a number as the 8th argument to `make-struct-type`. In
particular, that change allows the construction of
optional-keyword functions to be recognized as a
purely functional operation.

Also, allow the optimizer to use information about imports
when deciding whether a module-level form is functional.
It's ok to use that information, because the validator has
it, too.

This combination of changes allows something like

 (define (f #:optional [x #f])
   (later))

 (define (later) ....)

to compile to a reference to `later` wihout a check.
2016-07-28 08:23:51 -06:00
Matthew Flatt
0d0cf535de compiler: fix copy propagation in letrec-check pass
Fixing dead-code cleanup in the letrec-check pass exposed
a bug in a part of the letrec check interpretation that is
analogous to copy propagation. The copy's representation
now refers to the original variable, instead of copying
the current set of deferrals (which is wrong if the original
is a `letrec`-bound variable that hasn't yet accumulated
its closures).
2016-07-28 08:23:50 -06:00
Matthew Flatt
cc9889d7ab fix setup for the letrec-check pass
Due to an obvious problem in the setup, the letrec-check pass wasn't
running an intended dead-code pruning pass. Correcting the problem
cuases one test in "optimize.rktl" to change, because the letrec-check
pass can see more in one case than thanother.

(Problem discovered by accidentally fixing the setup in a Racket
branch based on "linklets".)
2016-07-28 08:22:10 -06:00
Matthew Flatt
0198847980 wrap scheme/interactive load with error boilerplate 2016-07-26 10:55:43 -06:00
Matthew Flatt
453684b694 don't use isspace() on a signed character 2016-07-26 10:53:05 -06:00
Matthew Flatt
b9a9fdaa3f check for "config.rktd" before trying to read it for interactive 2016-07-26 10:47:19 -06:00
Matthew Flatt
fc345ed249 add use-compiled-file-check
Along with the `PLT_COMPILED_FILE_CHECK` environment variable, allows
the timestamp check to be disabled when deciding whether to use a
compiled bytecode file.

In accomodating this change, `raco make` and `raco setup` in all modes
check whether the SHA1 hash of a module source matches the one
recorded in its ".dep" file, even if the timestamp on the bytecode
file is newer. (If the compile-file check mode is 'exists, the
timestamp is completely ignored.)
2016-07-26 10:27:08 -06:00
Leif Andersen
c65ad1efad Moved racket/gui/init and racket/gui/interactive to the gui-lib 2016-07-26 10:14:38 -04:00
Leif Andersen
28f693a976 A few more changes based on Matthew's feedback.
Updated docs
2016-07-26 10:14:38 -04:00
Leif Andersen
e0e2708f4e Attempt to youse scheme_make_integer in dynamic_require 2016-07-26 10:14:38 -04:00
Leif Andersen
a6b7af9733 Made changes based on Matthew's comments.
1. Changed the API documentation for scheme_make_hash_tree, adding primitives for:

* SCHEME_hashtr_eq
* SCHEME_hashtr_equal
* SCHEME_hashtr_eqv

2. Changed direct uses of scheme_make_hash_tree to use these enumed values.

3. Fixed bugs in documentation

4. Defaults to racket/interactive (and racket/gui/interactive) if there is nothing in the config file
2016-07-26 10:14:38 -04:00
Leif Andersen
d0f9e4ba81 gr_config_init macro should not exist any more 2016-07-26 10:14:38 -04:00
Leif Andersen
237418ba0c Added documentation for the racket/interactive module 2016-07-26 10:14:38 -04:00
Leif Andersen
933a494fe0 Fix a few typos in the existing docs. 2016-07-26 10:14:38 -04:00
Leif Andersen
e5ff658875 Add docs for hash trees. 2016-07-26 10:14:38 -04:00
Leif Andersen
8588c43709 Oops, file checking should be on filename. 2016-07-26 10:14:38 -04:00
Leif Andersen
b0f266fad1 Moved xrepl to be part of bootloader directly. 2016-07-26 10:14:38 -04:00
Leif Andersen
314485edfb Start up xrepl when repl is loaded. 2016-07-26 10:14:38 -04:00
Leif Andersen
bd1ceb21d6 Add racketrc file to the etc/ folder. 2016-07-26 10:14:38 -04:00
Matthew Butterick
b62d0c80e4 Update examples for equal? eqv? eq? (#1391)
Use the same examples for each so it's easier to compare how the behavior differs.
2016-07-26 01:21:45 -05:00
Tony Garnock-Jones
1ba42bb70d Skip whitespace more liberally when parsing PLTSTDERR and friends.
Now accepts any whitespace, not just spaces, ignores both leading and
trailing whitespace, and accepts multiple whitespace characters
separating subterms.
2016-07-25 19:17:35 -04:00
Stephen Chang
99dd403ef6 fix another renaming provide src loc 2016-07-21 16:53:00 -04:00
Matthew Flatt
64a1209bb5 remove the other(!) debugging printf 2016-07-20 22:41:00 +02:00