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