1 ! Copyright (C) 2004, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: arrays assocs continuations debugger destructors generic
4 hash-sets hashtables init io io.files kernel kernel.private
5 make math memory namespaces parser parser.notes prettyprint
6 sequences splitting system vectors vocabs vocabs.loader words ;
7 QUALIFIED: bootstrap.image.private
10 "Bootstrap stage 1..." print flush
12 "vocab:bootstrap/primitives.factor" run-file
15 { "resource:core" } vocab-roots set
17 ! Create a boot quotation for the target by collecting all top-level
18 ! forms into a quotation, surrounded by some boilerplate.
21 ! Rehash hashtables first, since bootstrap.image creates
22 ! them using the host image's hashing algorithms.
23 [ hashtable? ] instances [ hashtables:rehash ] each
24 [ hash-set? ] instances [ hash-sets:rehash ] each
28 "math.integers" require
33 "io.streams.c" require
34 "io.streams.byte-array" require ! for utf16 on Windows
35 "vocabs.loader" require
39 "vocab:bootstrap/layouts.factor" parse-file %
42 f parser-quiet? set-global
46 "resource:basis/bootstrap/stage2.factor"
50 "Cannot find " write write "." print
51 "Please move " write image-path write " into the same directory as the Factor sources," print
52 "and try again." print
58 bootstrap.image.private:special-objects get set-at