► |  | Guide: PLT Scheme

1 | Welcome to PLT Scheme
2 | Scheme Essentials
3 | Built-In Datatypes
4 | Expressions and Definitions
5 | Programmer-Defined Datatypes
6 | Modules
7 | Contracts
8 | Input and Output
9 | Regular Expressions
10 | Exceptions and Control
11 | Iterations and Comprehensions
12 | Pattern Matching
13 | Classes and Objects
14 | Units (Components)
15 | Reflection and Dynamic Evaluation
16 | Macros
17 | Performance
18 | Running and Creating Executables
19 | Compilation and Configuration
20 | More Libraries
21 | Dialects of Scheme
| Bibliography
| Index

▼ | 21 | Dialects of Scheme

21.1 | Standards
21.2 | More PLT Schemes
21.3 | Teaching

top ← prev up next →

#### 21.2`` More PLT Schemes

Like “Scheme” itself, even “PLT Scheme” is more of an idea about programming languages than a language in the usual sense. Macros can extend a base language (as described in Macros), but macros and alternate parsers can construct an entirely new language from the ground up.

The #lang line that starts a PLT Scheme module declares the base language of the module. By “PLT Scheme,” we usually mean #lang followed by the base language scheme or scheme/base (of which scheme is an extension). The PLT Scheme distribution provides additional languages, including the following:

- typed-scheme – like scheme/base, but statically typed; see Typed Scheme: Scheme with Static Types

- lazy – like scheme/base, but avoids evaluating an expression until its value is needed; see Lazy Scheme

- frtime – changes evaluation in an even more radical way to support reactive programming; see FrTime: A Language for Reactive Programs

- scribble/doc – a language, which looks more like Latex than Scheme, for writing documentation; see Scribble: PLT Documentation Tool

Each of these languages is used by starting module with the language name after #lang. For example, this source of this document starts with #lang scribble/doc.

PLT Scheme users can define their own languages. A language name maps to its implementation through a module path by adding /lang/reader. For example, the language name scribble/doc is expanded to scribble/doc/lang/reader, which is the module that implements the surface-syntax parser. The parser, in turn, generates a module form, which determines the base language at the level of syntactic forms an functions.

Some language names act as language loaders. For example, s-exp as a language uses the usual PLT Scheme parser for surface-syntax reading, and then it uses the module path after s-exp for the language’s syntactic forms. Thus, #lang s-exp "mylang.ss" parses the module body using the normal PLT Scheme reader, by then imports the initial syntax and functions for the module body from "mylang.ss". Similarly, #lang planet planet-path loads a language via PLaneT.

top ← prev up next →