! Copyright (C) 2004, 2005 Slava Pestov.\r
! See http://factor.sf.net/license.txt for BSD license.\r
-USING: alien assembler command-line compiler errors generic\r
-hashtables io kernel lists memory namespaces parser sequences words ;\r
+USING: alien assembler command-line compiler compiler-backend\r
+errors generic hashtables io io-internals kernel lists math\r
+memory namespaces parser sequences words ;\r
\r
: pull-in ( ? list -- )\r
swap [\r
"/library/compiler/ppc/alien.factor"\r
] pull-in\r
\r
-"/library/bootstrap/boot-stage3.factor" run-resource\r
+"Compiling base..." print\r
+\r
+"statically-linked" get [\r
+ unix? [\r
+ "sdl" "libSDL.so" "cdecl" add-library\r
+ "sdl-gfx" "libSDL_gfx.so" "cdecl" add-library\r
+ "sdl-ttf" "libSDL_ttf.so" "cdecl" add-library\r
+ ] when\r
+ \r
+ win32? [\r
+ "kernel32" "kernel32.dll" "stdcall" add-library\r
+ "user32" "user32.dll" "stdcall" add-library\r
+ "gdi32" "gdi32.dll" "stdcall" add-library\r
+ "winsock" "ws2_32.dll" "stdcall" add-library\r
+ "mswsock" "mswsock.dll" "stdcall" add-library\r
+ "libc" "msvcrt.dll" "cdecl" add-library\r
+ "sdl" "SDL.dll" "cdecl" add-library\r
+ "sdl-gfx" "SDL_gfx.dll" "cdecl" add-library\r
+ "sdl-ttf" "SDL_ttf.dll" "cdecl" add-library\r
+ ] when\r
+] unless\r
+\r
+: compile? "compile" get supported-cpu? and ;\r
+\r
+compile? [\r
+ \ car compile\r
+ \ * compile\r
+ \ = compile\r
+ \ string>number compile\r
+ \ number>string compile\r
+ \ scan compile\r
+ \ (generate) compile\r
+] when\r
+\r
+"Loading more library code..." print\r
+\r
+t [\r
+ "/library/alien/malloc.factor"\r
+ "/library/io/buffer.factor"\r
+\r
+ "/library/math/constants.factor"\r
+ "/library/math/pow.factor"\r
+ "/library/math/trig-hyp.factor"\r
+ "/library/math/arc-trig-hyp.factor"\r
+ "/library/math/random.factor"\r
+\r
+ "/library/in-thread.factor"\r
+\r
+ "/library/io/directories.factor"\r
+ "/library/io/binary.factor"\r
+ \r
+ "/library/eval-catch.factor"\r
+ "/library/tools/listener.factor"\r
+ "/library/tools/word-tools.factor"\r
+ "/library/syntax/see.factor"\r
+ "/library/test/test.factor"\r
+ "/library/tools/walker.factor"\r
+ "/library/tools/annotations.factor"\r
+ "/library/tools/inspector.factor"\r
+ "/library/bootstrap/image.factor"\r
+ \r
+ "/library/io/logging.factor"\r
+\r
+ "/library/tools/telnetd.factor"\r
+ "/library/tools/jedit.factor"\r
+\r
+ "/library/httpd/load.factor"\r
+ "/library/sdl/load.factor"\r
+ "/library/ui/load.factor"\r
+ "/library/help/tutorial.factor"\r
+] pull-in\r
+\r
+compile? [\r
+ unix? [\r
+ "/library/unix/types.factor"\r
+ ] pull-in\r
+\r
+ os "freebsd" = [\r
+ "/library/unix/syscalls-freebsd.factor"\r
+ ] pull-in\r
+\r
+ os "linux" = [\r
+ "/library/unix/syscalls-linux.factor"\r
+ ] pull-in\r
+\r
+ os "macosx" = [\r
+ "/library/unix/syscalls-macosx.factor"\r
+ ] pull-in\r
+ \r
+ unix? [\r
+ "/library/unix/syscalls.factor"\r
+ "/library/unix/io.factor"\r
+ "/library/unix/sockets.factor"\r
+ "/library/unix/files.factor"\r
+ ] pull-in\r
+ \r
+ os "win32" = [\r
+ "/library/win32/win32-io.factor"\r
+ "/library/win32/win32-errors.factor"\r
+ "/library/win32/winsock.factor"\r
+ "/library/win32/win32-io-internals.factor"\r
+ "/library/win32/win32-stream.factor"\r
+ "/library/win32/win32-server.factor"\r
+ "/library/bootstrap/win32-io.factor"\r
+ ] pull-in\r
+] when\r
+\r
+"Building cross-reference database..." print\r
+recrossref\r
+\r
+compile? [\r
+ "Compiling system..." print\r
+ compile-all\r
+ terpri\r
+ "Unless you're working on the compiler, ignore the errors above." print\r
+ "Not every word compiles, by design." print\r
+ terpri\r
+ "Initializing native I/O..." print\r
+ init-io\r
+] when\r
+\r
+[\r
+ boot\r
+ run-user-init\r
+ "shell" get [ "shells" ] search execute\r
+ 0 exit\r
+] set-boot\r
+\r
+0 [ compiled? [ 1 + ] when ] each-word\r
+number>string write " words compiled" print\r
+\r
+0 [ drop 1 + ] each-word\r
+number>string write " words total" print \r
+\r
+"Total bootstrap GC time: " write gc-time\r
+number>string write " ms" print\r
+\r
+"Bootstrapping is complete." print\r
+"Now, you can run ./f factor.image" print\r
+\r
+"factor.image" save-image\r
+0 exit\r
+\r
+FORGET: pull-in\r
+FORGET: compile?\r
+++ /dev/null
-! Copyright (C) 2004, 2005 Slava Pestov.
-! See http://factor.sf.net/license.txt for BSD license.
-USING: alien assembler command-line compiler compiler-backend
-compiler-frontend inference io-internals kernel lists math
-namespaces parser sequences io words ;
-
-"Compiling base..." print
-
-"statically-linked" get [
- unix? [
- "sdl" "libSDL.so" "cdecl" add-library
- "sdl-gfx" "libSDL_gfx.so" "cdecl" add-library
- "sdl-ttf" "libSDL_ttf.so" "cdecl" add-library
- ] when
-
- win32? [
- "kernel32" "kernel32.dll" "stdcall" add-library
- "user32" "user32.dll" "stdcall" add-library
- "gdi32" "gdi32.dll" "stdcall" add-library
- "winsock" "ws2_32.dll" "stdcall" add-library
- "mswsock" "mswsock.dll" "stdcall" add-library
- "libc" "msvcrt.dll" "cdecl" add-library
- "sdl" "SDL.dll" "cdecl" add-library
- "sdl-gfx" "SDL_gfx.dll" "cdecl" add-library
- "sdl-ttf" "SDL_ttf.dll" "cdecl" add-library
- ] when
-] unless
-
-default-cli-args
-parse-command-line
-init-assembler
-
-: compile? "compile" get supported-cpu? and ;
-
-compile? [
- \ car compile
- \ * compile
- \ = compile
- \ string>number compile
- \ number>string compile
- \ scan compile
- \ (generate) compile
-] when
-
-"Loading more library code..." print
-
-t [
- "/library/alien/malloc.factor"
- "/library/io/buffer.factor"
-
- "/library/math/constants.factor"
- "/library/math/pow.factor"
- "/library/math/trig-hyp.factor"
- "/library/math/arc-trig-hyp.factor"
- "/library/math/random.factor"
-
- "/library/in-thread.factor"
-
- "/library/io/directories.factor"
- "/library/io/binary.factor"
-
- "/library/eval-catch.factor"
- "/library/tools/listener.factor"
- "/library/tools/word-tools.factor"
- "/library/syntax/see.factor"
- "/library/test/test.factor"
- "/library/tools/walker.factor"
- "/library/tools/annotations.factor"
- "/library/tools/inspector.factor"
- "/library/bootstrap/image.factor"
-
- "/library/io/logging.factor"
-
- "/library/tools/telnetd.factor"
- "/library/tools/jedit.factor"
-
- "/library/httpd/load.factor"
- "/library/sdl/load.factor"
- "/library/ui/load.factor"
- "/library/help/tutorial.factor"
-] pull-in
-
-compile? [
- unix? [
- "/library/unix/types.factor"
- ] pull-in
-
- os "freebsd" = [
- "/library/unix/syscalls-freebsd.factor"
- ] pull-in
-
- os "linux" = [
- "/library/unix/syscalls-linux.factor"
- ] pull-in
-
- os "macosx" = [
- "/library/unix/syscalls-macosx.factor"
- ] pull-in
-
- unix? [
- "/library/unix/syscalls.factor"
- "/library/unix/io.factor"
- "/library/unix/sockets.factor"
- "/library/unix/files.factor"
- ] pull-in
-
- os "win32" = [
- "/library/win32/win32-io.factor"
- "/library/win32/win32-errors.factor"
- "/library/win32/winsock.factor"
- "/library/win32/win32-io-internals.factor"
- "/library/win32/win32-stream.factor"
- "/library/win32/win32-server.factor"
- "/library/bootstrap/win32-io.factor"
- ] pull-in
-] when
-
-"Building cross-reference database..." print
-recrossref
-
-compile? [
- "Compiling system..." print
- compile-all
- "Initializing native I/O..." print
- init-io
-] when
-
-FORGET: pull-in
-FORGET: compile?
-
-"/library/bootstrap/boot-stage4.factor" dup print run-resource
+++ /dev/null
-! Copyright (C) 2005 Slava Pestov.
-! See http://factor.sf.net/license.txt for BSD license.
-IN: kernel
-USING: alien assembler command-line compiler console errors
-generic inference kernel-internals listener lists math memory
-namespaces parser presentation prettyprint random io words ;
-
-"Bootstrap stage 4..." print
-
-: warm-boot ( -- )
- #! A fully bootstrapped image has this as the boot
- #! quotation.
- init-assembler
- init-error-handler
- default-cli-args
- parse-command-line
- "null-stdio" get [ << null-stream f >> stdio set ] when ;
-
-: shell ( str -- )
- #! This handles the -shell:<foo> cli argument.
- [ "shells" ] search execute ;
-
-[
- boot
- warm-boot
- run-user-init
- "shell" get shell
- 0 exit
-] set-boot
-
-warm-boot
-
-terpri
-"Unless you're working on the compiler, ignore the errors above." print
-"Not every word compiles, by design." print
-terpri
-
-0 [ compiled? [ 1 + ] when ] each-word
-number>string write " words compiled" print
-
-0 [ drop 1 + ] each-word
-number>string write " words total" print
-
-"Total bootstrap GC time: " write gc-time
-number>string write " ms" print
-
-"Bootstrapping is complete." print
-"Now, you can run ./f factor.image" print
-
-! Save a bit of space
-global [ stdio off ] bind
-
-"factor.image" save-image
-0 exit
! Copyright (C) 2004, 2005 Slava Pestov.
! See http://factor.sf.net/license.txt for BSD license.
IN: kernel
-USING: io-internals namespaces parser io threads words ;
+USING: assembler command-line errors io io-internals namespaces
+parser threads words ;
: boot ( -- )
#! Initialize an interpreter with the basic services.
init-threads
init-io
"HOME" os-env [ "." ] unless* "~" set
- init-search-path ;
+ init-search-path
+ init-assembler
+ init-error-handler
+ default-cli-args
+ parse-command-line
+ "null-stdio" get [ << null-stream f >> stdio set ] when ;