The reader language for #lang is similar to s-exp, in that it acts as a kind of meta-language. Whereas s-exp lets a programmer specify a module language at the expander layer of parsing, reader lets a programmer specify a language at the reader level.
A #lang reader must be followed by a module path, and the specified module must provide two functions: read and read-syntax. The protocol is the same as for a #reader implementation, but for #lang, the read and read-syntax functions must produce a module form that is based on the rest of the input file for the module.
The following "literal.rkt" module implements a language that treats its entire body as literal text and exports the text as a data string:
"literal.rkt"
(literal-read-syntax#fin)))
The "literal.rkt" language uses strip-context on the generated module expression, because a read-syntax function should return a syntax object with no lexical context. Also, the "literal.rkt" language creates a module named anything, which is an arbitrary choice; the language is intended to be used in a file, and the longhand module name is ignored when it appears in a require d file.
The "literal.rkt" language can be used in a module "tuvalu.rkt":
"tuvalu.rkt"
Technology!System!Perfect!
Importing "tuvalu.rkt" binds data to a string version of the module content:
> data"\nTechnology!\nSystem!\nPerfect!\n"