More module system work
parent
b4291dd6c6
commit
b47d1d79fb
|
@ -1,5 +1,6 @@
|
||||||
+ 0.85:
|
+ 0.85:
|
||||||
|
|
||||||
|
- C+S+END doesn't work
|
||||||
- \ <buffer> help --> shows infer-effect
|
- \ <buffer> help --> shows infer-effect
|
||||||
- pane output in UI should use less memory
|
- pane output in UI should use less memory
|
||||||
- signal 4 on datastack underflow on mac intel??
|
- signal 4 on datastack underflow on mac intel??
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
! Simple IRC bot written in Factor.
|
! Simple IRC bot written in Factor.
|
||||||
|
|
||||||
REQUIRES: httpd ;
|
REQUIRES: contrib/httpd ;
|
||||||
|
|
||||||
USING: errors generic hashtables help html http io kernel math
|
USING: errors generic hashtables help html http io kernel math
|
||||||
memory namespaces parser prettyprint sequences strings threads
|
memory namespaces parser prettyprint sequences strings threads
|
||||||
|
@ -110,3 +110,5 @@ IN: factorbot-commands
|
||||||
|
|
||||||
: quit ( text -- )
|
: quit ( text -- )
|
||||||
drop speaker get "slava" = [ disconnect ] when ;
|
drop speaker get "slava" = [ disconnect ] when ;
|
||||||
|
|
||||||
|
PROVIDE: examples/factorbot ;
|
||||||
|
|
|
@ -14,3 +14,5 @@ USING: sequences kernel math io ;
|
||||||
3 [ 2dup lcd-row terpri ] repeat drop ;
|
3 [ 2dup lcd-row terpri ] repeat drop ;
|
||||||
|
|
||||||
"31337" lcd
|
"31337" lcd
|
||||||
|
|
||||||
|
PROVIDE: examples/lcd ;
|
||||||
|
|
|
@ -59,3 +59,5 @@ SYMBOL: costs
|
||||||
second [ word-name ] keep [ help ] write-outliner
|
second [ word-name ] keep [ help ] write-outliner
|
||||||
terpri
|
terpri
|
||||||
] each ;
|
] each ;
|
||||||
|
|
||||||
|
PROVIDE: examples/levenshtein ;
|
||||||
|
|
|
@ -114,6 +114,6 @@ SYMBOL: cols
|
||||||
"Generating " write dup write "..." print
|
"Generating " write dup write "..." print
|
||||||
<file-writer> [ run write ] with-stream ;
|
<file-writer> [ run write ] with-stream ;
|
||||||
|
|
||||||
\ render compile
|
|
||||||
|
|
||||||
[ "mandel.pnm" run>file ] time
|
[ "mandel.pnm" run>file ] time
|
||||||
|
|
||||||
|
PROVIDE: examples/mandel ;
|
||||||
|
|
|
@ -23,3 +23,5 @@ USING: kernel math parser io ;
|
||||||
[ numbers-game-loop ] [ drop ] if ;
|
[ numbers-game-loop ] [ drop ] if ;
|
||||||
|
|
||||||
: numbers-game number-to-guess numbers-game-loop ;
|
: numbers-game number-to-guess numbers-game-loop ;
|
||||||
|
|
||||||
|
PROVIDE: examples/numbers-game ;
|
||||||
|
|
|
@ -161,6 +161,6 @@ DEFER: create ( level c r -- scene )
|
||||||
"Generating " write dup write "..." print
|
"Generating " write dup write "..." print
|
||||||
<file-writer> [ run write ] with-stream ;
|
<file-writer> [ run write ] with-stream ;
|
||||||
|
|
||||||
\ run compile
|
|
||||||
|
|
||||||
[ "raytracer.pnm" run>file ] time
|
[ "raytracer.pnm" run>file ] time
|
||||||
|
|
||||||
|
PROVIDE: examples/raytracer ;
|
||||||
|
|
|
@ -68,3 +68,5 @@ SYMBOL: tape
|
||||||
: n
|
: n
|
||||||
#! Do one step and print new state.
|
#! Do one step and print new state.
|
||||||
turing-step c ;
|
turing-step c ;
|
||||||
|
|
||||||
|
PROVIDE: examples/turing ;
|
||||||
|
|
|
@ -292,7 +292,7 @@ M: hashtable '
|
||||||
{
|
{
|
||||||
vocabularies typemap builtins c-types crossref
|
vocabularies typemap builtins c-types crossref
|
||||||
articles parent-graph term-index changed-words
|
articles parent-graph term-index changed-words
|
||||||
class<map
|
modules class<map
|
||||||
} [ dup get swap bootstrap-word set ] each
|
} [ dup get swap bootstrap-word set ] each
|
||||||
] make-hash '
|
] make-hash '
|
||||||
global-offset fixup ;
|
global-offset fixup ;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
IN: image
|
IN: image
|
||||||
USING: alien arrays generic hashtables help io kernel
|
USING: alien arrays generic hashtables help io kernel
|
||||||
kernel-internals math namespaces parser sequences strings
|
kernel-internals math modules namespaces parser sequences
|
||||||
vectors words ;
|
strings vectors words ;
|
||||||
|
|
||||||
! Some very tricky code creating a bootstrap embryo in the
|
! Some very tricky code creating a bootstrap embryo in the
|
||||||
! host image.
|
! host image.
|
||||||
|
@ -18,6 +18,7 @@ H{ } clone c-types set
|
||||||
|
|
||||||
H{ } clone vocabularies set
|
H{ } clone vocabularies set
|
||||||
H{ } clone class<map set
|
H{ } clone class<map set
|
||||||
|
H{ } clone modules set
|
||||||
|
|
||||||
vocabularies get [ "syntax" set ] bind
|
vocabularies get [ "syntax" set ] bind
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
REQUIRES: library/compiler/x86 library/compiler/pentium4 ;
|
||||||
|
|
||||||
|
PROVIDE: library/compiler/amd64 {
|
||||||
|
"architecture.factor"
|
||||||
|
"alien.factor"
|
||||||
|
"intrinsics.factor"
|
||||||
|
} ;
|
|
@ -0,0 +1,3 @@
|
||||||
|
REQUIRES: library/compiler/x86 ;
|
||||||
|
|
||||||
|
PROVIDE: library/compiler/pentium4 { "intrinsics.factor" } ;
|
|
@ -0,0 +1,5 @@
|
||||||
|
PROVIDE: library/compiler/ppc {
|
||||||
|
"assembler.factor"
|
||||||
|
"architecture.factor"
|
||||||
|
"intrinsics.factor"
|
||||||
|
} ;
|
|
@ -0,0 +1,5 @@
|
||||||
|
PROVIDE: library/compiler/x86 {
|
||||||
|
"assembler.factor"
|
||||||
|
"architecture.factor"
|
||||||
|
"intrinsics.factor"
|
||||||
|
} ;
|
|
@ -20,8 +20,6 @@ C: module ( name files tests -- module )
|
||||||
|
|
||||||
SYMBOL: modules
|
SYMBOL: modules
|
||||||
|
|
||||||
H{ } clone modules set-global
|
|
||||||
|
|
||||||
: module modules get hash ;
|
: module modules get hash ;
|
||||||
|
|
||||||
: load-module ( name -- )
|
: load-module ( name -- )
|
||||||
|
@ -35,10 +33,6 @@ H{ } clone modules set-global
|
||||||
|
|
||||||
: require ( name -- ) (require) recompile ;
|
: require ( name -- ) (require) recompile ;
|
||||||
|
|
||||||
: contrib ( name -- ) "contrib/" swap append require ;
|
|
||||||
|
|
||||||
: example ( name -- ) "examples/" swap append require ;
|
|
||||||
|
|
||||||
: run-resources ( seq -- )
|
: run-resources ( seq -- )
|
||||||
[
|
[
|
||||||
bootstrapping? get
|
bootstrapping? get
|
||||||
|
@ -58,3 +52,6 @@ H{ } clone modules set-global
|
||||||
: test-module ( name -- ) module module-tests run-resources ;
|
: test-module ( name -- ) module module-tests run-resources ;
|
||||||
|
|
||||||
: test-modules ( -- ) modules hash-keys [ test-module ] each ;
|
: test-modules ( -- ) modules hash-keys [ test-module ] each ;
|
||||||
|
|
||||||
|
: modules. ( -- )
|
||||||
|
modules get hash-keys natural-sort [ print ] each ;
|
||||||
|
|
Loading…
Reference in New Issue