Commit Graph

38553 Commits

Author SHA1 Message Date
Matthew Flatt
5f9576cb22 fix space-safety in compiler
The `if` case of the compiler's space-safety pass abused its "last
non-tail call relative to the closest enclosing binding" state as
"last non-tail call relative to the enclosing run time", which could
cause it to not clear a stack position as needed to maintain space
safety.
2016-08-22 06:50:15 -06:00
Gustavo Massaccesi
d4158c2b04 JIT: Allow the jitter to reverse the arguments of string=? 2016-08-19 20:05:37 -03:00
Sam Tobin-Hochstadt
6cad51189d Increase timeout for url-port test. 2016-08-19 10:30:39 -04:00
Robby Findler
0c03952ca7 fix test cases 2016-08-19 09:17:47 -05:00
Alex Knauth
42dcc525b1 add lang-reader-module-paths to factor out copy-pasted code (#1347)
* add lang-reader-module-paths to syntax/module-reader

to be used as the third argument to make-meta-reader in lang-extensions
like at-exp

* document lang-reader-module-paths

* use lang-reader-module-paths in at-exp
2016-08-19 07:42:59 -06:00
Leif Andersen
9df2c3292e Make relative directory argument for resolve-module-path-* have a def… (#1326)
* Make relative directory argument for resolve-module-path-* have a default to #f

The resolve-module-path-* functions effectively already had a default argument,
which is #f, this allows you to just directly call it with one argument.

* Add tests for resolve-module-path-* with optional argument
2016-08-19 07:15:11 -06:00
Sam Tobin-Hochstadt
eec3684dbd Add recompile option to raco demod. (#1373)
Originally by @bdj in racket/compiler#7.
2016-08-19 07:09:49 -06:00
Matthew Flatt
c3355f6df2 remove spaces around em dashes 2016-08-19 07:05:47 -06:00
Matthew Butterick
aef8f3e7bd clarify role of empty stop-ids list in local-expand (#1335) 2016-08-19 07:03:54 -06:00
Matthew Butterick
88292a6e13 add a more concise example of patching a phase mismatch (#1331)
* add a more concise example of patching a phase mismatch

* Update phases.scrbl

Clarifications
2016-08-19 07:03:43 -06:00
Matthew Butterick
787915155f add example of negative phase level (#1330)
* add example of negative phase level

* Update proc-macros.scrbl

Remove `eval:error`

* correct dashes
2016-08-19 07:03:19 -06:00
William J. Bowman
998bfba4c4 skip-installed from all scopes, not current (#1361)
closes issue #1115
2016-08-19 06:56:12 -06:00
gus-massa
70adb6a502 Fix typo in string-ci=? docs (#1424)
After case-folding the strings, they are compared with equal? instead of eqv?
2016-08-19 06:33:45 -06:00
Matthew Butterick
9f7a0af3e5 update #lang tutorial to use reader submodule (#1409) 2016-08-19 06:33:36 -06:00
Alexis King
0b21818100 Preserve syntax-original?-ness and syntax properties from splicing forms (#1413)
This makes two changes to the forms in racket/splicing to adjust how
syntax properties are propagated through expansion:

  1. Uses of make-syntax-introducer are passed #t as the first argument,
     which causes the introduced scope to be consider a use-site rather
     than macro-introduction scope. This prevents syntax objects from
     being unnecessarily marked as unoriginal, in the syntax-original?
     sense.

  2. Uses of syntax/loc have been adjusted to copy syntax properties
     from original syntax objects, which were previously discared. Forms
     that were spliced into the surrounding context, such as begin,
     define-values, and define-syntaxes, recreated the top-level syntax
     objects, which did not preserve syntax properties from the
     originals.

This is not a perfect solution, mostly because it potentially elides
properties that may be associated with captured literals (that is,
properties attached directly to begin, define-values, or define-syntaxes
identifiers themselves). However, it seems to accommodate most of the
common use-cases: propagation of syntax-original?-ness and forms like
`struct`, which attach properties like 'sub-range-binders.

fixes #1410
2016-08-19 06:33:20 -06:00
Robby Findler
8df0d6bba3 finish (-> void?) optimization 2016-08-18 13:16:15 -05:00
Robby Findler
bd2f889251 minor cleanups 2016-08-18 13:16:14 -05:00
Robby Findler
2c7db537cc add indexing for contract syntax properties 2016-08-18 13:16:14 -05:00
Jay McCarthy
de3faeeda4 Merge pull request #1411 from tim-brown/http-connect-proxy
https and git proxying via HTTP CONNECT
2016-08-18 11:16:48 -04:00
Tim Brown
c9f6f6aa31 Merge branch 'master' into tmp-http-connect-proxy-merge
Fixed conflict with Tony’s head? definition
2016-08-18 14:40:08 +01:00
Matthew Flatt
83196703ee compiler/zo-marshal: fix encoding mistakes
Changes to the optimizer and validator exposed old problems.
2016-08-17 18:05:17 -06:00
Matthew Flatt
36548ea289 JIT: recognize unsafe-struct-ref argument sequences
A `struct-copy` form can generates a call for a constructor that
includes a sequence of `unsafe-struct-ref` arguments. Each
`unsafe-struct-ref` must still check for a chaperone. Make the JIT
recognize that pattern an turn it into a single test instead of
one test per `unsafe-struct-ref`.
2016-08-17 18:05:17 -06:00
Alexis King
232c80e340 Record disappeared uses from syntax/parse/experimental/template (#1423) 2016-08-17 17:50:56 -04:00
Robby Findler
30f946fc4b add history, typos 2016-08-17 15:48:22 -05:00
AlexKnauth
1b1b400f91 add #:newline? argument to pretty-printing functions 2016-08-17 15:44:39 -05:00
AlexKnauth
1af7ec7088 reformat pretty.rkt a bit
#lang instead of module, spaces instead of tabs, other whitespace and
indentation
2016-08-17 15:44:38 -05:00
Benjamin Greenman
1478f64c14 doc: fix broken link to contract-generate
Replaced with `contract-random-generate`
2016-08-15 20:43:47 -04:00
Jay McCarthy
986ea517d1 Merge pull request #1415 from tonyg/fix_1414_fd_leak_HEAD
Explicitly close the http-conn on http-sendrecv with method HEAD.
2016-08-15 09:18:18 -04:00
Matthew Flatt
ab6f578eca another repair for older MSVC 2016-08-15 06:24:55 -06:00
Tim Brown
9da549ea87 PR1411 Jays observations re thread-server 2016-08-15 10:27:07 +01:00
Tony Garnock-Jones
72db2b7147 Explicitly close the http-conn on http-sendrecv with method HEAD. Fixes #1414. 2016-08-14 18:32:38 -04:00
Matthew Flatt
2c65aa8512 unbreak compile with MSVC 2016-08-14 07:33:27 -06:00
Matthew Flatt
84793e80ff doc corrections
Fix inacurracies noticed while reimplementing the module and macro system.
2016-08-13 14:15:54 -06:00
Matthew Flatt
71b4f5f6c0 doc corrections for syntax-make-delta-introducer 2016-08-13 14:15:54 -06:00
Matthew Flatt
c9da43378f restore SCHEME_INPORT_VAL and SCHEME_OUTPORT_VAL 2016-08-13 14:15:54 -06:00
Matthew Flatt
21d5d909a6 doc correction for ffi/unsafe/alloc 2016-08-13 14:15:54 -06:00
Matthew Flatt
db95651454 internal support for measuring allocation counts 2016-08-13 14:15:54 -06:00
Matthew Flatt
b0ecafb731 more GC stats on exit 2016-08-13 14:15:54 -06:00
Matthew Flatt
0034c31820 track cumulative allocation
Extend `current-memory-use` to accept a 'cumulative flag.
2016-08-13 14:15:54 -06:00
Jay McCarthy
a0a0e41908 Allow NULL ptr return so we can see error message 2016-08-11 19:31:15 -04:00
Tim Brown
29997da340 Merge branch 'master' into http-connect-proxy 2016-08-10 17:00:11 +01:00
Tim Brown
7fb52529f8 PR#1411 Tests
http-proxy/ contains a suite of almost useful (but mostly useless) servers.

These can be used to test http-client, and url.rkt

git proxy is not tested yet --  I really wouldn’t know how
2016-08-10 16:08:16 +01:00
Robby Findler
d22a771c98 avoid dropping provide/contract-original-contract property 2016-08-09 16:25:54 -05:00
Tim Brown
08c1865461 PR#1411 Implementation for jeapsotrophe's comments
See github commentary for rationale behind changes

Also documentation for `tcp-or-tunnel-connect`
2016-08-09 15:37:29 +01:00
Tim Brown
14e1d13fe6 PR#1411 documentation tippex 2016-08-09 14:30:50 +01:00
Tim Brown
a5583485b6 PR#1411 Documentation 2016-08-09 14:12:04 +01:00
Tim Brown
321000b831 https and git proxying via HTTP CONNECT
This patch adds https and git proxying through HTTP’s `CONNECT` method.

**Sanity Checks Needed:**
1. Is the git protocol proxying necessary?
   It might be overkill, and I haven’t overly tested it since `raco pkg
   install` uses https as its transport anyway
2. If anyone is better clued up on HTTP `CONNECT` best practice, then
   please check the headers that I pass (in `http-client.rkt`)
3. Is HTTP `CONNECT` the only/best way to proxy HTTPS? It is what *curl*
   uses (which might be a good indicator)
4. Will the ports be closed properly? (does anyone see a fid leak?)
  - how do I test for that? Open (and allegedly close) 1024 tunnels?
5. The `abandon-p` definitions in `http-conn-CONNECT-tunnel` could
   probably be reduced, but they’re defined as they are to allow me to
   put debugging hooks in
6. No tests or documentation yet
7. I edited this with *vim*, and therefore the indentation is a la vim.
   I looked at doing a global reindent (of git-checkout) and so much
   changed that I abandoned that as an idea. It indentation is too
   “off-style” then feel free to change it :-)

**git-checkout.rkt:**
- `initial-connect` now tries to use a git proxy (see `url.rkt`, below)
  when *transport*=`git`
- (if *transport*=`https`, then `url.rkt`’s standard proxying will be
  used)

**http-client.rkt:**
- `http-conn-open!` can now be passed a
  `(list/c base-ssl?/c input-port? output-port? (-> port? void?))` to
  describe:
  - maybe a negotiated ssl context
  - two tunnel (or other arbitrary) ports to use instead of newly
    `...-connect`ed ports
  - an abandon function for those ports
- `http-conn-send!` has a function `print-to` which curries
  `(fprintf to)`, but allows a hook for an `eprintf` for debugging
- **added `http-conn-CONNECT-tunnel`:** this opens an new `http-conn`
  and arranges for CONNECT tunneling to `target-host` and `target-port`
- factored contracts into `base-ssl?/c` and `base-ssl?-tnl/c`
- added contract for `http-conn-CONNECT-tunnel`

**url.rkt:**
- `proxiable-url-schemes`: now includes `https` and `git`
- `env->c-p-s-entries`: the environment variable “parser” now takes a
  rest-list of lists of environment variables, and the scheme that these
  variables proxy is garnered from the variables’ names. As before
  there are:
  - `plt_http_proxy` and `http_proxy`
  - `plt_https_proxy` and `https_proxy`
  - `plt_git_proxy` and `git_proxy`
  during the previous iteration of obtaining the proxy variables at
  startup, we discussed the appropriate naming conventions for these
  variables. This doesn’t seem to deviate from that
- `env->c-p-s-entries`: having a proxy url that isn’t strictly:
  `http://hostname:portno` (e.g.  having a training slash) generates a
  log warning, not an error. It was beginning to bug me
- `proxy-servers-guard`: accepts any one of the `proxiable-url-schemes`
  (not just `http`)
- no proxy is agnostic to the URL scheme
- `proxy-tunneled?`: returns false for `http`, which is proxied using an
  HTTP proxy. Returns true for other URL schemes -- which go through a
  tunnel
- **`make-ports`:** tests whether a tunnel proxy is necessary. If so, it
  creates a tunnel and plumbs the connections
- elsewhere, anywhere that tests for proxy, now tests for
  `(and proxy (not proxy-tunneled? url))`, because tunneled HTTPS
  connections are direct (once they’re through the tunnel, IYSWIM)
2016-08-09 12:50:17 +01:00
Matthew Flatt
bf53f02bb1 fix problem with the mandatory-keywords change
Repairs a problem with 7bcc9afd4c as exposed by the contract test
suite.
2016-08-08 07:45:35 -06:00
Matthew Flatt
ad230d2ca0 improve structure-type property handling
Make the optimizer recognize and track `make-struct-property-type`
values, and use that information to recognize `make-struct-type`
calls that will defnitely succeed because a property that hs no
guard is given a value in the list of properties.

Combined with the change to require-keyword expansion, this
change allows the optimizer to inline `f` in

 (define (g y)
   (f #:x y))

 (define (f #:x x)
   (list x))

because the `make-struct-type` that appears between `g` and `f`
is determined to have no side-effect that would prevent `f` from
having its expected value.
2016-08-07 15:59:02 -06:00
Matthew Flatt
7bcc9afd4c adjust required-keyword expansion to improve optimization
Make the definition of a function with a required keyword expand in a
way that allows the optimizer to recognize it as a form that has no
errors or externally visible side effects.

The old expansion of

 (define (f #:x x) ...)

included

 (define lifted-constructor (make-required ....))
 (define f (lifted-constructor (lambda ....) ....))

where `make-required` calls `make-struct-type` and returns just the
constructor.

The new expansion instead has

 (define-values (_ lifted-constructor _ _ _)
   (make-struct-type ....))
 (define f (lifted-constructor (lambda ....) ....))

In other words, `make-required` is inlined by macro expansion,
so that the optimizer will be able to see it and eventually
conclude that no side effects have taken place.
2016-08-07 14:25:27 -06:00