]> gitweb.factorcode.org Git - factor.git/blob - core/bootstrap/stage1.factor
Create basis vocab root
[factor.git] / core / bootstrap / stage1.factor
1 ! Copyright (C) 2004, 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 IN: bootstrap.stage1
4 USING: arrays debugger generic hashtables io assocs
5 kernel.private kernel math memory namespaces parser
6 prettyprint sequences vectors words system splitting
7 init io.files bootstrap.image bootstrap.image.private vocabs
8 vocabs.loader system debugger continuations ;
9
10 { "resource:core" } vocab-roots set
11
12 "Bootstrap stage 1..." print flush
13
14 "resource:core/bootstrap/primitives.factor" run-file
15
16 load-help? off
17
18 ! Create a boot quotation for the target
19 [
20     [
21         ! Rehash hashtables, since bootstrap.image creates them
22         ! using the host image's hashing algorithms. We don't
23         ! use each-object here since the catch stack isn't yet
24         ! set up.
25         begin-scan
26         [ hashtable? ] pusher [ (each-object) ] dip
27         end-scan
28         [ rehash ] each
29         boot
30     ] %
31
32     "math.integers" require
33     "math.floats" require
34     "memory" require
35
36     ! this must add its init hook before io.backend does
37     "libc" require
38
39     ! "io.thread" require
40     "io.streams.c" require
41     "vocabs.loader" require
42     
43     "syntax" require
44     "bootstrap.layouts" require
45
46     [
47         "resource:basis/bootstrap/stage2.factor"
48         dup exists? [
49             run-file
50         ] [
51             "Cannot find " write write "." print
52             "Please move " write image write " to the same directory as the Factor sources," print
53             "and try again." print
54             1 exit
55         ] if
56     ] %
57 ] [ ] make bootstrap-boot-quot set