Documented the optimizer.
original commit: 8d6230956dc8c207c097a389fa1f0c7273bb55b7
This commit is contained in:
parent
1657089284
commit
eb5e5f55d6
21
collects/typed-scheme/scribblings/optimization.scrbl
Normal file
21
collects/typed-scheme/scribblings/optimization.scrbl
Normal file
|
@ -0,0 +1,21 @@
|
|||
#lang scribble/manual
|
||||
|
||||
@begin[(require (for-label (only-meta-in 0 typed/racket)) scribble/eval
|
||||
"utils.rkt" (only-in "quick.scrbl" typed-mod))]
|
||||
|
||||
@(define the-eval (make-base-eval))
|
||||
@(the-eval '(require typed/racket))
|
||||
|
||||
@title[#:tag "optimization"]{Optimization in Typed Racket}
|
||||
|
||||
Typed Racket provides a type-driven optimizer that rewrites well-typed
|
||||
programs to potentially make them faster. It should in no way make
|
||||
your programs slower or unsafe.
|
||||
|
||||
@section{Using the optimizer}
|
||||
|
||||
Typed Racket's optimizer is not currently turned on by default. If you
|
||||
want to activate it, you must add the @racket[#:optimize] keyword when
|
||||
specifying the language of your program:
|
||||
|
||||
@racketmod[typed/racket #:optimize]
|
|
@ -19,6 +19,7 @@ with Racket. For an introduction to Racket, see the @(other-manual '(lib "scrib
|
|||
@include-section["begin.scrbl"]
|
||||
@include-section["more.scrbl"]
|
||||
@include-section["types.scrbl"]
|
||||
@include-section["optimization.scrbl"]
|
||||
|
||||
@;@section{How the Type System Works}
|
||||
|
||||
|
|
|
@ -603,4 +603,17 @@ have the types ascribed to them; these types are converted to contracts and chec
|
|||
(define val 17))
|
||||
|
||||
(fun val)]
|
||||
|
||||
@section{Optimization in Typed Racket}
|
||||
|
||||
Typed Racket provides a type-driven optimizer that rewrites well-typed
|
||||
programs to potentially make them faster. It should in no way make
|
||||
your programs slower or unsafe.
|
||||
|
||||
Typed Racket's optimizer is not currently turned on by default. If you
|
||||
want to activate it, you must add the @racket[#:optimize] keyword when
|
||||
specifying the language of your program:
|
||||
|
||||
@racketmod[typed/racket #:optimize]
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user