
In conjunction with a small change to syntax/parse, this means that `typed/racket/base` no longer depends on `racket/set`, `racket/contract/base`, or `racket/generic`. Timings on my machine go from ~200ms for `#lang typed/racket/base` as the whole file, to ~100ms. For comparison, `racket/base` is 30ms and `#lang racket` is 150ms. `#lang typed/racket` is ~200ms with this change. Changes include: - not using `in-syntax` - switching to `syntax/parse/pre` - avoiding `template` from `syntax/parse`
32 lines
1017 B
Racket
32 lines
1017 B
Racket
#lang racket/base
|
|
|
|
(require
|
|
(for-syntax racket/base racket/lazy-require
|
|
"standard-inits.rkt")
|
|
;; these need to be available to the generated code
|
|
"typecheck/renamer.rkt" syntax/location
|
|
(for-syntax (submod "base-env/prims-contract.rkt" self-ctor))
|
|
(for-syntax "utils/struct-extraction.rkt")
|
|
(for-syntax "typecheck/renamer.rkt")
|
|
;; only for timing/debugging
|
|
(for-syntax "utils/timing.rkt"))
|
|
|
|
(provide (rename-out [module-begin #%module-begin]
|
|
[top-interaction #%top-interaction])
|
|
with-type
|
|
(for-syntax do-standard-inits))
|
|
|
|
|
|
(define-syntax-rule (drivers [name sym] ...)
|
|
(begin
|
|
(begin-for-syntax
|
|
(lazy-require (typed-racket/core (sym ...))))
|
|
(define-syntax (name stx)
|
|
(do-time (format "Calling ~a driver" 'name))
|
|
(do-time (format "Loaded core ~a" 'sym))
|
|
(begin0 (sym stx)
|
|
(do-time "Finished, returning to Racket")))
|
|
...))
|
|
|
|
(drivers [module-begin mb-core] [top-interaction ti-core] [with-type wt-core])
|