This document is about the design and architecture of the Parenscript compiler. Compilation Pipeline: user --> [parenscript text] -- reader --> [parenscript sexp forms] -- parser --> [special forms] -- optimizer --> [(javascript) special forms] -- translater --> [javascript text] -> user ==reader== Parenscript can use either the Lisp reader or the Parenscript reader to read objects from source text. Generally, Parenscript embedded in Lisp will use the Lisp reader, and Parenscript in Parenscript files will use the Parenscript reader. There are only a few differences between the readers: # The Parenscript reader will not obey defined read macros in the Lisp reader # The Parenscript reader understands Parenscript package names as package prefixes and does NOT understand Lisp package names as package prefixes. # The Lisp reader does not understand Parenscript package names but does understand Lisp package names as symbol prefixes. ==parser== Once the source text has been transformed into SEXPs, the parser transforms the SEXPs into primitive special-form objects. This is the stage during which macroexpansion takes place and an AST is generated for the program. ==optimizer== The compiler then performs optional optimizations on the AST produced by the parser. The result is an AST that produces faster/better code. ==transformer== Given an AST, the transformer produces Javascript source text. *************************************************************************************