factor/basis/compiler/compiler-docs.factor

47 lines
2.4 KiB
Factor
Raw Normal View History

2008-10-07 21:00:38 -04:00
USING: help.markup help.syntax words io parser
assocs words.private sequences compiler.units ;
2007-09-20 18:09:08 -04:00
IN: compiler
HELP: enable-compiler
{ $description "Enables the optimizing compiler." } ;
HELP: disable-compiler
2008-11-17 18:48:06 -05:00
{ $description "Disable the optimizing compiler." } ;
2007-09-20 18:09:08 -04:00
ARTICLE: "compiler-usage" "Calling the optimizing compiler"
"Normally, new word definitions are recompiled automatically. This can be changed:"
{ $subsection disable-compiler }
{ $subsection enable-compiler }
"The optimizing compiler can be called directly, although this should not be necessary under normal circumstances:"
{ $subsection optimized-recompile-hook }
"Removing a word's optimized definition:"
2008-03-20 22:55:40 -04:00
{ $subsection decompile }
"Higher-level words can be found in " { $link "compilation-units" } "." ;
2007-09-20 18:09:08 -04:00
ARTICLE: "compiler" "Optimizing compiler"
"Factor is a fully compiled language implementation with two distinct compilers:"
{ $list
{ "The " { $emphasis "non-optimizing quotation compiler" } " compiles quotations to naive machine code very quickly. The non-optimizing quotation compiler is part of the VM." }
{ "The " { $emphasis "optimizing word compiler" } " compiles whole words at a time while performing extensive data and control flow analysis. This provides greater performance for generated code, but incurs a much longer compile time. The optimizing compiler is written in Factor." }
}
"The optimizing compiler only compiles words which have a static stack effect. This means that methods defined on fundamental generic words such as " { $link nth } " should have a static stack effect; for otherwise, most of the system would be compiled with the non-optimizing compiler. See " { $link "inference" } " and " { $link "cookbook-pitfalls" } "."
2007-09-20 18:09:08 -04:00
{ $subsection "compiler-usage" }
{ $subsection "compiler-errors" }
{ $subsection "hints" } ;
2007-09-20 18:09:08 -04:00
ABOUT: "compiler"
HELP: decompile
2007-09-20 18:09:08 -04:00
{ $values { "word" word } }
{ $description "Removes a word's optimized definition. The word will be compiled with the non-optimizing compiler until recompiled with the optimizing compiler again." } ;
2007-09-20 18:09:08 -04:00
HELP: (compile)
{ $values { "word" word } }
2007-12-24 20:56:23 -05:00
{ $description "Compile a single word." }
2007-09-20 18:09:08 -04:00
{ $notes "This is an internal word, and user code should call " { $link compile } " instead." } ;
HELP: optimized-recompile-hook
{ $values { "words" "a sequence of words" } { "alist" "an association list" } }
{ $description "Compile a set of words." }
{ $notes "This is an internal word, and user code should call " { $link compile } " instead." } ;