]> gitweb.factorcode.org Git - factor.git/blob - core/bootstrap/stage1.factor
bootstrap: rename layouts/layouts.factor to layouts.factor.
[factor.git] / core / bootstrap / stage1.factor
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
8 IN: bootstrap.stage1
9
10 "Bootstrap stage 1..." print flush
11
12 "vocab:bootstrap/primitives.factor" run-file
13
14 load-help? off
15 { "resource:core" } vocab-roots set
16
17 ! Create a boot quotation for the target by collecting all top-level
18 ! forms into a quotation, surrounded by some boilerplate.
19 [
20     [
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
25         boot
26     ] %
27
28     "math.integers" require
29     "math.ratios" require
30     "math.floats" require
31     "memory" require
32
33     "io.streams.c" require
34     "io.streams.byte-array" require ! for utf16 on Windows
35     "vocabs.loader" require
36
37     "syntax" require
38
39     "vocab:bootstrap/layouts.factor" parse-file %
40
41     [
42         f parser-quiet? set-global
43
44         init-resource-path
45
46         "resource:basis/bootstrap/stage2.factor"
47         dup exists? [
48             run-file
49         ] [
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
53             1 (exit)
54         ] if
55     ] %
56 ] [ ] make
57 OBJ-STARTUP-QUOT
58 bootstrap.image.private:special-objects get set-at