]> gitweb.factorcode.org Git - factor.git/blob - core/bootstrap/stage1.factor
Merge branch 'master' into startup
[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 generic hashtables
4 init io io.files kernel kernel.private make math memory
5 namespaces parser prettyprint sequences splitting system
6 vectors vocabs vocabs.loader words destructors ;
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 [ rehash ] each
24         boot
25     ] %
26
27     "math.integers" require
28     "math.floats" require
29     "memory" require
30
31     "io.streams.c" require
32     "vocabs.loader" require
33
34     "syntax" require
35     "bootstrap.layouts" require
36
37     [
38         "resource:basis/bootstrap/stage2.factor"
39         dup exists? [
40             [ run-file ] with-destructors
41         ] [
42             "Cannot find " write write "." print
43             "Please move " write image write " to the same directory as the Factor sources," print
44             "and try again." print
45             1 (exit)
46         ] if
47     ] %
48 ] [ ] make
49 bootstrap.image.private:bootstrap-boot-quot set