From eb5e5f55d6d91e5e7f4f4eef4ad29829d1992eee Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Fri, 16 Jul 2010 15:24:23 -0400 Subject: [PATCH] Documented the optimizer. original commit: 8d6230956dc8c207c097a389fa1f0c7273bb55b7 --- .../scribblings/optimization.scrbl | 21 +++++++++++++++++++ .../typed-scheme/scribblings/ts-guide.scrbl | 1 + .../scribblings/ts-reference.scrbl | 13 ++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 collects/typed-scheme/scribblings/optimization.scrbl diff --git a/collects/typed-scheme/scribblings/optimization.scrbl b/collects/typed-scheme/scribblings/optimization.scrbl new file mode 100644 index 00000000..e7d70054 --- /dev/null +++ b/collects/typed-scheme/scribblings/optimization.scrbl @@ -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] diff --git a/collects/typed-scheme/scribblings/ts-guide.scrbl b/collects/typed-scheme/scribblings/ts-guide.scrbl index 1c58c25c..948f7dbe 100644 --- a/collects/typed-scheme/scribblings/ts-guide.scrbl +++ b/collects/typed-scheme/scribblings/ts-guide.scrbl @@ -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} diff --git a/collects/typed-scheme/scribblings/ts-reference.scrbl b/collects/typed-scheme/scribblings/ts-reference.scrbl index 4e063ef2..4b546d66 100644 --- a/collects/typed-scheme/scribblings/ts-reference.scrbl +++ b/collects/typed-scheme/scribblings/ts-reference.scrbl @@ -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] + }