####### # # E-scripts on "other" Forths. # # Note 1: use the eev command (defined in eev.el) and the # ee alias (in my .zshrc) to execute parts of this file. # Executing this file as a whole makes no sense. # # Note 2: be VERY careful and make sure you understand what # you're doing. # # Note 3: If you use a shell other than zsh things like |& # and the for loops may not work. # # Note 4: I always run as root. # # Note 5: some parts are too old and don't work anymore. Some # never worked. # # Note 6: the definitions for the find-xxxfile commands are on my # .emacs. # # Note 7: if you see a strange command check my .zshrc -- it may # be defined there as a function or an alias. # # Note 8: the sections without dates are always older than the # sections with dates. # # This file is at # or at . # See also , # , # , # , # and . # ####### # «.c4th» (to "c4th") # «.c4th-dosemu» (to "c4th-dosemu") # «.4word» (to "4word") # «.timbre» (to "timbre") # «.ficl» (to "ficl") # «.maslicke-colorforth» (to "maslicke-colorforth") # «.sod32» (to "sod32") # «.amrforth» (to "amrforth") # «.chuck-quote» (to "chuck-quote") # «.tile-forth» (to "tile-forth") # «.forthos» (to "forthos") # «.f83» (to "f83") # «.twee-editors» (to "twee-editors") # «.xcolorforth» (to "xcolorforth") # «.retroforth» (to "retroforth") # «.laforth» (to "laforth") # «.rubyforth» (to "rubyforth") # «.rubyforth-uploading» (to "rubyforth-uploading") # «.rubyforth-angg» (to "rubyforth-angg") # «.rubyforth-demos» (to "rubyforth-demos") # «.modal-logic» (to "modal-logic") # «.inspect» (to "inspect") # «.R_stack_broken» (to "R_stack_broken") # «.R_stack» (to "R_stack") # «.ruby-and-prim-blocks» (to "ruby-and-prim-blocks") # «.miniforth-article-corr» (to "miniforth-article-corr") # «.foerthchen» (to "foerthchen") ###### # # F21 emulator # ###### # (find-es "dos" "dosemu_slink_4dos") cd $S/http/www.ultratechnology.com/ # (find-fline "$S/http/www.ultratechnology.com/") # (find-fline "$S/http/www.ultratechnology.com/f21emu/") # (find-fline "$S/http/www.ultratechnology.com/f21sim/") rm -Rv /tmp/dos/f21emu mkdir /tmp/dos/f21emu cd /tmp/dos/f21emu unzip -L $S/http/www.ultratechnology.com/f21emu/f21emu12.zip dos -c -e 8192 dos -c -x 8192 # http://www.spiritone.com/~fwarren/fpc.html unzip -l /snarf/ftp/ftp.taygeta.com/pub/Forth/Compilers/native/dos/FPC/fpc36.zip ######### # # dynoof 0.1.5 # ######### cd /usr/src/ rm -Rv dynoof-0.1.5/ tar -xvzf /snarf/ftp/ftp.taygeta.com/Taygeta/Forth/Linux/dynoof-0.1.5.tgz cd /usr/src/dynoof-0.1.5/ # (find-fline "/usr/src/dynoof-0.1.5/README.Linux") # (find-fline "/usr/src/dynoof-0.1.5/Makefile" "mkindex >Indexes.ah") # diff -e Makefile~ Makefile ed Makefile <<'---' 76c ./mkindex >Indexes.ah . w --- make config |& tee omc make |& tee om # 99nov10: not working, gcc gives a funny error: # (find-fline "/usr/src/dynoof-0.1.5/om" "fixed or forbidden register 0 (ax)") ####### # # bigforth 23nov97 # ####### cd /snarf/http/www.informatik.tu-muenchen.de/~paysan/ bunzip2 bigforth-bin-23nov97.tar.bz2 bunzip2 bigforth-data-23nov97.tar.bz2 bunzip2 bigforth-src-23nov97.tar.bz2 bunzip2 bigforth-src-29dec97.tar.bz2 cd /usr/src/ rm -Rv bigforth/ tar -xvf /snarf/http/www.jwdt.com/~paysan/bigforth-bin-23nov97.tar tar -xvf /snarf/http/www.jwdt.com/~paysan/bigforth-data-23nov97.tar tar -xvf /snarf/http/www.jwdt.com/~paysan/bigforth-src-23nov97.tar # tar -xvf /snarf/http/www.jwdt.com/~paysan/bigforth-src-29dec97.tar cd /usr/src/bigforth/ make all |& tee oma # for i in (*.scr) # do ~/ICON/scr2str $i | tr ~/ICON/scr2str assem486.scr > assem486.st ~/ICON/scr2str bench.scr > bench.st ~/ICON/scr2str complex.scr > complex.st ~/ICON/scr2str disass.scr > disass.st ~/ICON/scr2str edit.scr > edit.st ~/ICON/scr2str fft.scr > fft.st ~/ICON/scr2str file.scr > file.st ~/ICON/scr2str fileint.scr > fileint.st ~/ICON/scr2str fileop.scr > fileop.st ~/ICON/scr2str float.scr > float.st ~/ICON/scr2str forth.scr > forth.st ~/ICON/scr2str ftast.scr > ftast.st ~/ICON/scr2str infix.scr > infix.st ~/ICON/scr2str oof.scr > oof.st ~/ICON/scr2str oofsampl.scr > oofsampl.st ~/ICON/scr2str output.scr > output.st ~/ICON/scr2str pipes.scr > pipes.st ~/ICON/scr2str savemod.scr > savemod.st ~/ICON/scr2str sedit.scr > sedit.st ~/ICON/scr2str startup.scr > startup.st ~/ICON/scr2str stream.scr > stream.st ~/ICON/scr2str struct.scr > struct.st ~/ICON/scr2str target.scr > target.st ~/ICON/scr2str tasker.scr > tasker.st ~/ICON/scr2str tools.scr > tools.st ~/ICON/scr2str vectors.scr > vectors.st ~/ICON/scr2str xwidgets.scr > xwidgets.st glimpseindex -H . *.st *.str *.m # From a hint Bernd Paysan gave me... # cat > tags.str <<'EOF' : tags context @ LIST> dup 2- w@ (view file? . cell+ .name cr ; cr ." ----" cr tags cr bye EOF bigforth "include forth.scr include tags.str" \ > forthker.tags forthker "include startup.scr include tags.str" \ > bigforth.tags bigforth 'include xwidgets.scr include edit.scr include login.str '\ 'include ptty.str include tags.str' \ > xbigforth.tags ~/ICON/ftags < forthker.tags > TAGS.forthker ~/ICON/ftags < bigforth.tags > TAGS.bigforth ~/ICON/ftags < xbigforth.tags > TAGS.xbigforth # rm TAGS ln -s TAGS.xbigforth TAGS # (find-bftag "create") # (find-bffile "README" 27) export BROWSER=/usr/src/netscape/netscape # Indented lines mean "type yourself". Each line is a different thing/demo. xbigforth ed edit.scr include minos.str designer open include testwidgets.str include gears.m gears open # (find-bffile "Makefile") # (find-bffile "startup.st" 24) # (find-bffile "forth.st" 1311) # (find-bffile "forth.st" 280) # (find-bffile "fileint.st" 654) # (find-bffile "forth.st" 2479) # (find-bffile "forth.st" 1441) # (find-bffile "forth.st" 1496) # *.st *.str *.m # (find-bffile "edit.st" 928) ####### # # Bigforth 11apr1999: preparing it to run # ####### cd $S/http/www.jwdt.com/~paysan/ for i in bin-glibc bin-libc5 data doc src edata-ShinyMetal edata-wood; do bunzip2 -v bigforth-$i-11apr1999.tar.bz2 gzip -v -9 bigforth-$i-11apr1999.tar done # See it PAYSAN=$S/http/www.jwdt.com/~paysan tar -tvzf $PAYSAN/bigforth-bin-glibc-11apr1999.tar.gz tar -tvzf $PAYSAN/bigforth-data-11apr1999.tar.gz tar -tvzf $PAYSAN/bigforth-doc-11apr1999.tar.gz tar -tvzf $PAYSAN/bigforth-src-11apr1999.tar.gz tar -tvzf $PAYSAN/bigforth-edata-ShinyMetal-11apr1999.tar.gz tar -tvzf $PAYSAN/bigforth-edata-wood-11apr1999.tar.gz rm -Rv /usr/src/bigforth/ mkdir /usr/src/bigforth/ cd /usr/src/ PAYSAN=$S/http/www.jwdt.com/~paysan tar -xvzf $PAYSAN/bigforth-bin-glibc-11apr1999.tar.gz tar -xvzf $PAYSAN/bigforth-data-11apr1999.tar.gz #tar -xvzf $PAYSAN/bigforth-doc-11apr1999.tar.gz tar -xvzf $PAYSAN/bigforth-src-11apr1999.tar.gz #tar -xvzf $PAYSAN/bigforth-edata-ShinyMetal-11apr1999.tar.gz #tar -xvzf $PAYSAN/bigforth-edata-wood-11apr1999.tar.gz # cd /usr/src/bigforth/ echo ': rr s" /home/root/FORTH/emacs.rr" included ;' >> bigforth.cnf rm bigforth make bigforth |& tee ombf # rm bigforth forthker.sys # make |& tee om # rm bigforth.sys # make bigforth.sys |& tee om2 # rm xbigforth.sys *.bfm # make xbigforth.sys |& tee om2 for i in *.scr; do echo $i; ~/ICON/deblock < $i > ${i}z; done # My first mail to the bigforth list: # (find-fline "$MAIL" "Hi bpaysan,") ####### # # Bigforth 11apr1999: learning more # ####### # (find-bffile "ediwind.str" "file-menu:") # (find-bffile "tools.scrz" ": see") # (find-bffile "forth.scrz" "\n: cfa@") hex : foo1 ( "w" -- addr ) name find 0= abort" not found" ; : foo2 ( "w" -- addr ) foo1 >name ; : ncount ( addr -- addr+1 count ) dup c@ 1f and swap 1+ swap ; : foo3 ( "w" -- ) foo2 ncount type ; foo2 see 20 - 40 dump foo3 see foo2 see .name : words. ( -- ) context @ list> cr . ; : words.2 ( -- ) context @ list> cr dup . cell+ .name ; words.2 : foo0 ( "w" -- addr ) foo2 4 - ; : ndump ( addr -- addr+ ) 0 do count 2 u.r space loop ; : .word3 ( addr -- ) dup . cell+ ncount 2dup type + 5 ndump ; : words.3 ( -- ) context @ list> cr .word3 drop ; : "addr:" ( x -- x ) dup 8 u.r ." : " ; : "" ( addr -- addr+4 ) dup @ 8 u.r space 4 + ; : "" ( addr -- addr+1 ) dup c@ 2 u.r space 1 + ; : "" ( addr -- addr+ ) ncount 2dup type space + ; : "" ( addr -- addr+ ) "" 1- "" ; : .word4 ( addr -- addr+ ) "addr:" "" "" 5 ndump ; foo0 see cr .word4 . ' foo0 . 3 u.r # (find-bffile "minos-load.str" ": S[") # (find-bffile "forth.scrz") # (find-bffile "bigforth.c") # (find-bffile "Makefile" "forthker.sys:") # (find-bffile "xwidgets.scrz" "script.icn") # (find-bffile "menu.str") # (find-bffile "Makefile") # (find-bffile "README") # (find-paysanfile "bigforth-bin-glibc-11apr1999.tar.gz") # (find-paysanfile "bigforth-src-11apr1999.tar.gz") # (find-bffile "ombf") gcc -Wall -DDATE='"'"$(date '+%d%b%Y' | tr '[A-Z]' '[a-z]')"'"' \ -DINSTDIR='"'"/usr/local/lib/bigforth"'"' -E bigforth.c > bigforth.E # (find-bffile "bigforth.E") ls -i /lib /usr/lib /usr/X11R6/lib | sort # (find-bffile "menu.str") # (find-fline "~/s") # (find-fline "~/s2") # (find-enode "Editing Binary Files") # (find-efile "hexl.el") ##### # # Idéias pro meu Forth # ##### No início não tenho nenhum word de divisão (acho). A coisa mais básica é saber parsear um word e encontrar o correspondente a ele no dicionário. De repente isso pode até ser feito em C, que é fácil de debugar, e que vai me permitir alterar a estrutura do dicionário mais facilmente. # (find-fline "$S/ftp/ftp.taygeta.com/Taygeta/Forth/Linux/") # (find-fline "$S/ftp/ftp.taygeta.com/Taygeta/Forth/Linux/linux-eforth-1.0c.tar.gz") # (find-fline "$S/ftp/ftp.taygeta.com/Taygeta/Forth/Linux/e/eforth.S") # (find-fline "$S/ftp/ftp.taygeta.com/Taygeta/Forth/Linux/e/Makefile") cd /tmp/ cp $S/ftp/ftp.taygeta.com/Taygeta/Forth/Linux/e/eforth.S . cp $S/ftp/ftp.taygeta.com/Taygeta/Forth/Linux/e/Makefile . gcc -o eforth eforth.S cd $S/ftp/ftp.taygeta.com/Taygeta/Forth/Linux/e/ # (find-fline "/snarf/ftp/ftp.IAEhv.nl/pub/users/mhx/") # (find-fline "$S/http/www.ultratechnology.com/") ##### # # yforth # ##### pdsc /big/slinks2/dists/slink/main/source/interpreters/yforth_0.1beta-9.dsc cd /usr/src/yforth-0.1beta/ debian/rules binary |& tee odrb s@1, s@2, s@4, ##### # # perpol # 2000jul06 # ##### # «perpol» # (find-es "anatocc" "easynasm") # (find-fline "/usr/src/easynasm/easynasm" "--leavejunk") # rm -Rv /usr/src/perpol/ cd /usr/src/ tar -xvzf $S/http/www.boswa.com/misc/forth/perpol.tgz cd /usr/src/perpol/ # (find-fline "/usr/src/perpol/") # (find-fline "/usr/src/perpol/notes.txt") # (find-fline "/usr/src/perpol/notes.txt" "Usage:") # (find-fline "/usr/src/perpol/perpol") cd /usr/src/perpol/samples/ /usr/src/perpol/perpol arith.ppl /usr/src/easynasm/easynasm --leavejunk arith.asm ./arith # # (find-fline "/usr/src/perpol/samples/") # (find-fline "/usr/src/perpol/samples/arith.ppl") # (find-fline "/usr/src/perpol/samples/arith.asm") # (find-fline "/usr/src/perpol/samples/easynasm.temp.asm") # (find-fline "/usr/src/perpol/samples/easynasm.temp.c") ##### # # eforth # 2000jun23 # ##### # «eforth» # (code-c-d "eforth" "/usr/src/eforth-1.0e/") # rm -Rv /usr/src/linux-eforth-1.0e/ rm -Rv /usr/src/eforth-1.0e/ cd /usr/src/ tar -xvzf $S/http/fare.tunes.org/files/asm/linux-eforth-1.0e.tar.gz mv linux-eforth-1.0e/ eforth-1.0e/ cd /usr/src/eforth-1.0e/ # NUF? doesn't like buffered terminals and so # WORDS and DUMP and SEE aren't working well. # Fix it with a crude hack. # (find-eforthfile "eforth.4th" "NUF?") # (find-eforthfile "eforth.S" "NUF?") #diff -c eforth.S~ eforth.S |& tee ~/o patch -p0 <<'%%%' *** eforth.S~ Wed Jun 16 12:36:30 1999 --- eforth.S Sat Jun 24 18:47:30 2000 *************** *** 1842,1847 **** --- 1842,1848 ---- /* Return false if no input, else pause and if CR return true. */ __COLON(4,"NUF?",NUFQ) + .long DOLIT,0,EXIT /* Edrx: always return 0 immediately */ .long QKEY,DUPP .long QBRAN,NUFQ1 .long DDROP,KEY %%% cd /usr/src/eforth-1.0e/ make test |& tee omt grep -v '^[ ]*$' eforth.s > eforth.s- echo 'WORDS BYE' | eforth echo ; echo echo 'SEE DUMP' | eforth | dd count=1 2> /dev/null ; echo # (find-node "(zsh)Redirection") # # (find-eforthfile "eforth.S") # (find-eforthfile "eforth.S" "#define __COLON") # (find-eforthfile "eforth.S" "#define __CODE(") # (find-eforthfile "eforth.s-") # (find-eforthfile "eforth.S" "macros to debug eForth") # (find-eforthfile "eforth.S" "debugging functions") # (find-eforthfile "eforth.S" "GDB macros") # (find-node "(gdb)Auto Display" "display/FMT") # (find-node "(gdb)Memory" "x/NFU") # (find-node "(gdb)Auto Display" "enable display") ##### # # eforth: trying to rewrite DUMP and WORDS without NUF?. # 2000jun23 # ##### # # (find-eforthfile "eforth.4th" ": WORDS") # (find-eforthfile "eforth.S" "\"WORDS\"") # (find-eforthfile "eforth.s-" "\"WORDS\"") cd /usr/src/eforth-1.0e/ ./eforth <<'---' CONTEXT @ @ .ID CONTEXT @ @ 1 CELLS - @ .ID CONTEXT @ @ 1 CELLS - @ 1 CELLS - @ .ID BYE --- # # (find-eforthfile "eforth.4th" ": DUMP") # (find-eforthfile "eforth.S" "\"DUMP\"") # (find-eforthfile "eforth.s-" "\"DUMP\"") cd /usr/src/eforth-1.0e/ ./eforth <<'---' : D ( a -- a+16 ) BASE @ >R HEX DUP 16 dm+ DROP SPACE SPACE DUP 16 _TYPE 16 + CR R> BASE ! ; : FOOBIE ." Hi!" CR ; : 1+2 1 2 + ; ' DUMP 16 - D D D .S DROP ' FOOBIE 16 - D D D .S DROP ' 1+2 16 - D D D .S DROP CONTEXT @ @ 160 - D D D D D D D D D D D D BYE --- # cd /usr/src/eforth-1.0e/ eforth & cat /proc/$(pidof eforth)/maps % # (code-c-d "eforth" "/usr/src/eforth-1.0e/") # (find-eforthfile "") # (find-eforthfile "eforth.4th") # (find-eforthfile "test.4th") # (find-eforthfile "eforth.4th" ": WORDS") eeg /usr/src/eforth-1.0e/eforth # Buggy! ##### # # cmForth # 2000jul20 # ##### # (code-c-d "taygeta" "$S/ftp/ftp.uni-bremen.de/pub/mirrors/Taygeta-Archive/") # (find-taygetafile "Archive/others/") # (find-e20file "jka-compr.el") # Where is the .arc support? # (find-e20file "arc-mode.el") # It only understands the dir structure. # (find-fline "~/FORTH/") # cd ~/FORTH/ cat cmforth.blk.txt \ | awk '{ if ($0 ~ /«/) printf "\\ «screen_%d:»\n", n++; else print }' \ |& tee cmforth.blk.txt2 cat cmforthx.scr.txt \ | awk '{ if ($0 ~ /«/) printf "\\ «screen_%d:»\n", n++; else print }' \ |& tee cmforthx.scr.txt2 # # (find-fline "~/FORTH/cmforth.blk.txt2") # (find-fline "~/FORTH/cmforthx.scr.txt2") # (find-angg "FORTH/cmforth.blk.txt2" "screen_33:") # (find-angg "FORTH/cmforth.blk.txt2" "screen_1:") # (find-angg "FORTH/cmforthx.scr.txt2") ##### # # cmForth # 2001dec07 # ##### http://rm-f.net/~orange/arc/cmforth.zip http://rm-f.net/~orange/devel/forth/cmforth.zip http://rm-f.net/~orange/arc/forth/ http://rm-f.net/~orange/arc/forth/pygmy15.zip http://rm-f.net/~orange/arc/forth/pygtools.zip # (find-shttpfile "rm-f.net/~orange/arc/cmforth.zip") # (find-shttpfile "rm-f.net/~orange/devel/forth/cmforth.zip") # (find-shttpfile "rm-f.net/~orange/arc/forth/") # (find-shttpfile "rm-f.net/~orange/arc/forth/pygmy15.zip") # (find-shttpfile "rm-f.net/~orange/arc/forth/pygtools.zip") ##### # # f-cpu docs # 2000oct30 # ##### # Interesting mainly because it is "free"; # Seems to have a bloated architecture. # rm -Rv /tmp/manual/ cd /tmp/ tar -xvzf $S/http/www.mime.up8.edu/~whygee/fcpu_manual.tgz cd /tmp/manual/ ./run.me # (find-fline "/tmp/manual/") # ##### # # c4th # 2000jan16 # ##### # «c4th» (to ".c4th") # (find-shttpw3 "www.users.qwest.net/~loveall/") unzip -l $S/http/www.users.qwest.net/~loveall/binary/c4th100.zip unzip -l $S/http/www.users.qwest.net/~loveall/binary/4thice22.zip unzip -l $S/http/www.users.qwest.net/~loveall/binary/Debug05.zip # rm -Rv /usr/src/c4th/ cd /usr/src/ unzip $S/http/www.users.qwest.net/~loveall/binary/c4th100.zip mkdir /usr/src/c4th/4thice/ cd /usr/src/c4th/4thice/ unzip $S/http/www.users.qwest.net/~loveall/binary/4thice22.zip mkdir /usr/src/c4th/debug/ cd /usr/src/c4th/debug/ unzip $S/http/www.users.qwest.net/~loveall/binary/Debug05.zip # (find-htetfile "Assembly-HOWTO.txt.gz") # (find-sftpfile "x2ftp.oulu.fi/pub/msdos/programming/convert/ta2asv08.zip") mkdir /usr/src/c4th/ta2as/ cd /usr/src/c4th/ta2as/ unzip -L $S/ftp/x2ftp.oulu.fi/pub/msdos/programming/convert/ta2asv08.zip cp -v ta2as.exe .. # # «c4th-dosemu» (to ".c4th-dosemu") # (find-es "dos" "dosemu-0") # (find-fline "/usr/src/c4th/") cd /usr/src/c4th/ cp -v * /tmp/testdos/ # # (find-fline "/usr/src/c4th/") # (find-fline "/usr/src/c4th/!Readme.1st") # (find-fline "/usr/src/c4th/!Readme.1st" " QUICK START:") cat > $EEG <<'---' dir cls c4th.com tcl: ac {^[} square {^]} {dup * ;} ^_ ^M tcl: ac {^[} cube {^]} {dup square * ;} ^_ ^M tcl: ac ^X 4 ^_ "square ." ^M tcl: ac ^X 5 ^_ "cube ." ^M tcl: ac bye ^M exitemu --- eeg2 -c allowtcl dos # ##### # # timbre # 2001feb11 # ##### # «timbre» (to ".timbre") # (find-shttpw3 "www.compusmart.ab.ca/rc/Timbre/timbre.htm") # (find-shttpw3 "www.compusmart.ab.ca/rc/Timbre/TimbreUnitII.html") gv $S/http/www.compusmart.ab.ca/rc/Timbre/Resources/papers.ps/bilingual.ps & gv $S/http/www.compusmart.ab.ca/rc/Timbre/Resources/papers.ps/cwoc.ps & gv $S/http/www.compusmart.ab.ca/rc/Timbre/Resources/papers.ps/ithastim.ps & gv $S/http/www.compusmart.ab.ca/rc/Timbre/Resources/papers.ps/stackver.ps & gv $S/http/www.compusmart.ab.ca/rc/Timbre/Resources/papers.ps/tranfram.ps & # rm -Rv /usr/src/timbre/ mkdir /usr/src/timbre/ cd /usr/src/timbre/ tar -xvzf $S/http/www.compusmart.ab.ca/rc/Timbre/V.7/Unix.tar.Z mv -v Unix/* . rmdir Unix cd /usr/src/timbre/Sources/ #mv Makefile Makefile.orig #sed "s/^ @ / /g" < Makefile.orig > Makefile #make sun |& tee omsun # gcc -g -o sun -O -Dunix -Dfpos_t=int kernel.c ii.c io.c library.c \ shells.c xtras.c theend.c localio.c signals.c file.c aoloader.c \ timeout.c auto.c ties.c timbre.c memmove.c cp -v sun ../timbre cd /usr/src/timbre/Scripts/ cd /usr/src/timbre/Scripts/ForthtoC/ cat > $EEG <<'---' bye --- eeg /usr/src/timbre/timbre for i in timbre.[ch]; do mv $i $i.orig; tr \\r \\n < $i.orig > $i; done # (find-timbrefile "Scripts/") # (find-timbrefile "Scripts/ForthtoC/") # (find-timbrefile "Sources/") # (find-timbrefile "Sources/kernel.c") #gcc -g -I/usr/src/timbre/Sources -o timbre timbre.c gcc -g -I/usr/src/timbre/Sources -o timbre timbre.c |& tee ogcc # # (code-c-d "timbre" "/usr/src/timbre/") # (find-timbrefile "") # (find-timbrefile "Sources/") # (find-timbrefile "Sources/README") # (find-timbrefile "Sources/Makefile" "sun :") ##### # # 4word # 2001feb19 # ##### # «4word» (to ".4word") # (to "c4th-dosemu") # rm -Rv /usr/src/4word/ cd /usr/src/ unzip $S/http/www.users.qwest.net/~loveall/binary/4word15.zip cd /usr/src/4word/ tr -d \\r < 4word.lst > 4word.lst.u cd /usr/src/4word/ cp -v * /tmp/testdos/ # (code-c-d "4word" "/usr/src/4word/") # (find-4wordfile "") # (find-4wordfile "ColorMan.txt") # (find-4wordfile "ReadMe.txt") # (find-4wordfile "ReadMe.txt" "'words' and 'dis'") # (find-4wordfile "ReadMe.txt" "Hex Control ASCII MODE") # (find-4wordfile "ReadMe.txt" "only 13 control keys which are:") # (find-4wordfile "ReadMe.txt" "4word dbg help:") # (find-4wordfile "4word.asm" "':'") # (find-4wordfile "4word.asm" "$code\tmacro") # (find-4wordfile "4word.asm" "do macro") # (find-4wordfile "g.bat") # (find-4wordfile "4word.lst") # (find-4wordfile "4word.lst.u") # (find-angg ".emacs" "hscroll-keys-mode") # (find-enode "Display Vars" "`tab-width'") # (progn (find-4wordfile "4word.lst.u") (hscroll-keys-mode 1)) # (progn (find-4wordfile "4word.lst.u") (setq tab-width 4)) # cat > $EEG <<'---' dir cls 4word N 5 N 6 + u. bye rem 4word fload 4wboot.p rem 4word fload 4wboot.p fload 4wdbg.p fload 4wcedit.p de cls 4word fload 4wBoot.p fload 4wDbg.p fload 4wCedit.p N A 1 - . : square ] dup ] * ; 2 square . tcl: ac {^[^[quare^]dup^]* ; 3 quare . ^M} ' square dis tcl: ac { } { } { } ' quare ' dis dbg tcl: ac { } { } { } { } { } { } { } { } { } { } { } { } words tcl: ac { } { } { } bye exitemu --- eeg2 -c allowtcl dos # ##### # # ficl # 2001dec01 # ##### # «ficl» (to ".ficl") # rm -Rv /usr/src/ficl/ mkdir /usr/src/ficl/ cd /usr/src/ficl/ tar -xvzf $S/http/prdownloads.sourceforge.net/ficl/ficl300a.tar.gz # Only ReadMe.txt was in . mv -v ficl/* . rmdir ficl # cd /usr/src/ficl/ make -f Makefile.linux |& tee om # cd /usr/src/ficl/ cat > $EEG <<'---' words see space bye --- eeg ficl # # (code-c-d "ficl" "/usr/src/ficl/") # (find-ficlfile "") tar -tvzf $S/http/www.geocities.com/SiliconValley/Bay/2334/4th-33a.tgz ##### # # Mark Slicker's version of Chuck's ColorForth, compilable from Linux # 2001nov30 # ##### # «maslicke-colorforth» (to ".maslicke-colorforth") # (find-shttpfile "www.oakland.edu/~maslicke/colorforth/") # (find-shttpw3 "www.oakland.edu/~maslicke/colorforth/") # rm -Rv /tmp/colorforth/ mkdir /tmp/colorforth/ cd $S/http/www.oakland.edu/~maslicke/colorforth/ && \ cp -diPpvR * /tmp/colorforth/ cd /tmp/colorforth/ cp -v $S/ftp/ftp.ultratechnology.com/COLOR.COM . # (find-fline "/tmp/colorforth/") # (find-fline "/tmp/colorforth/compile") as -o color.o color.s if test -a color.o; then objcopy -O binary color.o color.com cp color.com color.com.orig # rm color.o dd if=COLOR.COM of=color.com \ ibs=1024 obs=1024 bs=1024 count=51 seek=12 skip=12 fi # # (find-fline "/tmp/colorforth/") # (find-fline "/tmp/colorforth/write_floppy") cd /tmp/colorforth/ dd if=color.com of=/dev/fd0 # # (find-fline "/tmp/colorforth/") # (find-fline "/tmp/colorforth/color.s" ".include \"boot.s\"") # (find-fline "/tmp/colorforth/boot.s") ##### # # sod32 # 2001dec05 # ##### # «sod32» (to ".sod32") # (find-shttpw3 "www.xs4all.nl/~lennartb/forth.html") # rm -Rv /usr/src/sod32/ tar -C /usr/src/ -xvzf $S/http/www.xs4all.nl/~lennartb/sod32.tar.gz cd /usr/src/sod32/ make asm386 |& tee om # # (code-c-d "sod32" "/usr/src/sod32/") # (find-sod32file "README") # (find-sod32file "") # (find-sod32file "sod32.4") # (find-sod32file "sod32.doc") # cd /usr/src/sod32/ cat > $EEG <<'---' 134 2 * . words S" sod32.4" \ SOD32 forth.img CR BYE --- eeg sod32 forth.img # ##### # # amrforth # 2001dec10 # ##### # «amrforth» (to ".amrforth") # rm -Rv /usr/src/amrforth/ tar -xvzf $S/http/www.amresearch.com/amrforth/amrforthv5.0beta-024.tar.gz \ -C /usr/src/ cd /usr/src/amrforth/ # # (code-c-d "amr" "/usr/src/amrforth/") # (find-amrfile "") # (find-amrfile "source/README" "amrForth hardware") ##### # # isforth # 2001dec14 # ##### # rm -Rv /usr/src/isforth/ mkdir /usr/src/isforth/ cd /usr/src/isforth/ tar -xvzf $S/http/retro.tunes.org/pub/isforth/isforth-tcn-08-15-01.tgz # # (code-c-d "isforth" "/usr/src/isforth/src/") # (find-isforthfile "README") # (find-isforthfile "") ##### # # retro4b # 2001dec14 # ##### # rm -Rv /usr/src/retro/ cd /usr/src/ unzip $S/http/retro.tunes.org/pub/retro4b.zip cd /usr/src/retro/ # # (code-c-d "retro" "/usr/src/retro/") # (find-retrofile "readme") # (find-retrofile "") ##### # # pigmy # 2001dec10 # ##### http://rm-f.net/~orange/arc/cmforth.zip http://rm-f.net/~orange/devel/forth/cmforth.zip http://rm-f.net/~orange/arc/forth/ http://rm-f.net/~orange/arc/forth/pygmy15.zip http://rm-f.net/~orange/arc/forth/pygtools.zip http://www.colorforth.com/cf.html http://www.colorforth.com/forth.html http://www.colorforth.com/parsed.html http://www.colorforth.com/chars.html http://www.colorforth.com/simulation.html http://www.colorforth.com/temperature.html ##### # # The "five lines/two years" quote # 2001dec05 # ##### # «chuck-quote» (to ".chuck-quote") # http://www.ultratechnology.com/mmeta.html # (find-shttpw3 "www.ultratechnology.com/mmeta.html" "about five lines") Mike Perry relates a story about Chuck's CAD system which ran on the board whose design it had been written for. Chuck showed Mike that he had written the core of the CAD application in about five lines of code. When Mike asked him how long it had taken, he replied, "Oh, about two years." ##### # # tile-forth # 2002sep16 # ##### # «tile-forth» (to ".tile-forth") # (code-c-d "tile" "$usr_src/tile-forth-2.1/") # (find-tilefile "") # rm -Rv $usr_src/tile-forth-2.1/ cd $usr_src/ tar -xvzf $S/http/ftp.gnu.org/non-gnu/tile-forth/tile-forth-2.1.tar.gz cd $usr_src/tile-forth-2.1/ # ##### # # forthos # 2002dec23 # ##### # «forthos» (to ".forthos") lynx http://cliki.tunes.org:8000/Forth%20OSes tar -tvzf $S/http/www.forthos.org/dist/forthos07.tz # (code-c-d "forthos" "/tmp/forthos/") # (find-forthosfile "") # (find-forthosfile "") # rm -Rv /tmp/forthos/ mkdir /tmp/forthos/ cd /tmp/forthos/ tar -xvzf $S/http/www.forthos.org/dist/forthos07.tz # cd /tmp/forthos/ make clean make |& tee om # # (code-c-d "forthos" "/tmp/forthos/") # (find-forthosfile "README.ForthOS" "Support for Multiboot") # (find-forthosfile "multiboot.h") # (find-forthosfile "Makefile") # (find-forthosfile "Makefile" "-Tforthos.lnk") # (find-forthosfile "forthos.lnk") # (find-forthosfile "om") # (find-progoutput "cd /tmp/forthos; cpp -D__ASM__ -DCONS_POSIX -DCONS_VGA < eforth.asm") # (find-forthosfile "") # From c.l.f., 2008jul10: # qemu -cdrom forthos.iso -hda forth.Image -boot d # http://www.forthos.org/setup.html #### # # Laxen & Perry's Forth83 # 2003apr15 # #### # «f83» (to ".f83") lynx $S/http/www.eforth.com.tw/academy/library/ # rm -Rv ~/tmp/f83/ mkdir ~/tmp/f83/ cd ~/tmp/f83/ lha x $S/http/www.eforth.com.tw/academy/zip/f83v2-ms.lzh # (find-lua50ref "file:read") for i in *.blk; do lua50e ' while 1 do r = io.read(64); if not r or r=="" then break end print(r) end ' < $i > $i.txt done for i in *.blk; do lua50e ' lines = {}; tinsert = table.insert; getn = table.getn while 1 do r = io.read(64); if not r or r=="" then break end tinsert(lines, r) end nscreen = 0 for i=1,getn(lines),16 do print("\\ «"..nscreen.."»") for j=i,i+15 do if lines[j] then print(lines[j]) end end nscreen = nscreen+1 end ' < $i > $i.e done # # Update, 2007nov20: # ftp://ftp.taygeta.com/pub/Forth/Compilers/native/dos/F83/ #### # # Twee editors # 2003apr18 # #### # «twee-editors» (to ".twee-editors") # lynx http://www.users.qwest.net/~loveall/Twee.htm # lynx $S/http/www.users.qwest.net/~loveall/Twee.htm # # (code-c-d "ue" "/tmp/ue.1.25/") # (find-uefile "README") # (find-uefile "ue.c") rm -Rv /tmp/ue.1.25/ cd /tmp tar -xvzf $S/http/www.users.qwest.net/~loveall/binary/ue.1.25.tgz cd /tmp/ue.1.25/ gcc ue.c -O2 -fomit-frame-pointer -o ue ; strip ue ; ls -al ue # #### # # Xcolorforth # 2003may01 # #### # «xcolorforth» (to ".xcolorforth") # (code-c-d "xcf" "$usr_src/XcolorForth/") # (find-xcffile "") # (find-xcffile "README") # (find-progoutput "grep-available SDL") # rm -Rv $usr_src/XcolorForth/ cd $usr_src/ tar -xvzf $S/http/www.oakland.edu/~maslicke/colorforth/XcolorForth.tar.gz cd $usr_src/XcolorForth/ # ##### # # cmForth source # 2007feb28 # ##### # http://www.eforth.com.tw/academy-n/chips/Harris%20Rtx2000/ # http://www.eforth.com.tw/academy-n/chips/Harris%20Rtx2000/Rtx2000_5.htm ##### # # retroforth (inspired by cmForth) # 2007mar13 # ##### # «retroforth» (to ".retroforth") # http://retroforth.net/wiki/ # http://retroforth.com/handbook/ # http://retroforth.com/get/source/9.2.10-hosted-source.tar.gz # http://charleschilders.com/repos/snapshot/retro-9.3.tar.gz # (find-available "lzh") # (find-status "lha") # (find-vldifile "lha.list") # (find-fline "/usr/doc/lha/") ##### # # Richard E. Haskell's "The Forth Course" # 2007jun10 # ##### # http://www.cse.secs.oakland.edu/haskell/HC12Book/4course.zip # Based on F-PC, written in 1990. ##### # # LaForth # 2007nov20 # ##### # «laforth» (to ".laforth") # http://www.eforth.com.tw/academy-n/chips/More%20on%20forth%20engines/volume12/volume12_4.htm # ?[ ... ][ ... ]? # [[ ... ?[ ... ?[ ... ?[ ... ]] # [[ ... ?[ ... ?[ ... ?[ ... ]]? # [[ ... ?] # [[ n1 =?[ ... ][ # n2 =?[ ... ][ # n3 =?[ ... ][ # default ]]? \ Marc Simpson's implementation:  (eepitch-gforth) : ?[ postpone if ; immediate : ][ postpone else ; immediate : ] postpone then ; immediate : .bool ?[ ." True" ][ ." False" ] ; -1 .bool True 0 .bool False # http://www.zyvra.org/laforth/ # http://www.zyvra.org/laforth/forth.zip ##### # # rubyforth (by Marc Simpson) # 2007dec09 # ##### # «rubyforth-old» (to ".rubyforth-old") # Firefox -> Gmail -> /tmp/ -> ~/tmp/ # (find-fline "/tmp/") # (find-sh0 "cp -v /tmp/rubyforth-186+.tar.gz ~/tmp/") # (find-fline "~/tmp/rubyforth-186+.tar.gz") # (find-sh0 "cp -v /tmp/rubyforth-198.tar.gz ~/tmp/") # (find-fline "~/tmp/rubyforth-198.tar.gz") # rm -Rf ~/usrc/rubyforth/ tar -C ~/usrc/ -xvzf ~/tmp/rubyforth-198.tar.gz cd ~/usrc/rubyforth/ # # (code-c-d "rubyforth" "~/usrc/rubyforth/" :anchor) # (code-c-d "rubyforth" "~/rubyforth/" :anchor) # (find-rubyforth "") # (find-rubyforth "rubyforth") # (find-rubyforth "forth.rb") # (find-rubyforth "primitives.rb") # (find-rubyforth "kernel.rb") # (find-rubyforth "stack.rb") # (find-rubyforth "file.rb") # (find-rubyforth "inspector.rb")  (eepitch-shell)  (eepitch-kill)  (eepitch-shell) ;; rubyforth has no prompt, this may confuse comint...  (eexterm-kill "A")  (eexterm "A") cd ~/usrc/rubyforth/ ruby1.8 -r forth.rb words ;; More demos here: ;; (find-anggfile "rubyforth/") ;; (find-anggfile "rubyforth/test.fs") ;; (find-rubyforth "") ;; (find-rubyforth "scripts/") ;; (find-rubyforth "scripts/f83.fs") ;; (find-rubyforth "demos/") ;; (find-rubyforth "demos/deblock.fs")  (eexterm-kill "A")  (eexterm "A") cd ~/usrc/rubyforth/ cat scripts/f83.fs | ruby1.8 -r forth.rb ##### # # on uploading marc's RubyForth tarballs to twu # 2008jan07 # ##### # «rubyforth» (to ".rubyforth") # «rubyforth-angg» (to ".rubyforth-angg") # «rubyforth-uploading» (to ".rubyforth-uploading") # (find-angg "rubyforth/") # (find-angg "rubyforth/README.too") # http://angg.twu.net/rubyforth/ # http://angg.twu.net/rubyforth/README.too.html # http://angg.twu.net/rubyforth/rubyforth-0.23.tar.gz # http://angg.twu.net/rubyforth/blocks.tar.gz # http://rubyforth.sourceforge.net/ # http://rubyforth.sourceforge.net/blocks.tar.gz # http://rubyforth.sourceforge.net/rubyforth-0.23.tar.gz # rm -Rfv ~/usrc/rubyforth-0.23/ tar -C ~/usrc/ -xvzf \ $S/http/rubyforth.sourceforge.net/rubyforth-0.23.tar.gz cd ~/usrc/rubyforth-0.23/ # cd ~/usrc/rubyforth-0.23/ for i in $(find * -type f | sort); do cp -av $i ~/rubyforth/$i; done # # To update my makefile: # (find-sh "tar -tvzf \ $S/http/rubyforth.sourceforge.net/rubyforth-0.23.tar.gz \ | cut -b 64- | sort \ | awk '{printf \" rubyforth/%s\\n\", $0}'") # (find-blogme3file "anggmake.lua") # (find-blogme3file "anggmake.lua" "rubyforth/") # (code-c-d "rubyforth" "~/usrc/rubyforth-0.19/") # (find-rubyforthfile "") # (find-rubyforthsh "find * -type f | sort") # To upload the binaries to angg/slow_html/:  (eepitch-eshell)  (eepitch-kill)  (eepitch-eshell) # (find-twusfile "rubyforth/") # (find-twusfile "rubyforth/demos/") # (find-angg "rubyforth/") # (find-angg "rubyforth/demos/") cd (ee-twusfile "rubyforth/") cp -v $S/http/rubyforth.sourceforge.net/rubyforth-0.23.tar.gz . cd (ee-twupfile "rubyforth/") cp -v $S/http/rubyforth.sourceforge.net/rubyforth-0.23.tar.gz . # Older scripts... cd ~/rubyforth/ # http://rubyforth.sourceforge.net/rubyforth-0.19.tar.gz cp -v $S/http/rubyforth.sourceforge.net/rubyforth-0.19.tar.gz \ (ee-twusfile "rubyforth/") # http://rubyforth.sourceforge.net/blocks.tar.gz cp -v $S/http/rubyforth.sourceforge.net/blocks.tar.gz \ (ee-twusfile "rubyforth/") cd ~/rubyforth/demos/ cp -v cmforth.blk (ee-twusfile "rubyforth/demos/") cp -v f83kernel.blk (ee-twusfile "rubyforth/demos/") ##### # # rubyforth demos # 2008jan02 # ##### # «rubyforth-demos» (to ".rubyforth-demos") # (find-angg ".emacs" "eepitch-rubyforth")  (eepitch-shell)  (eepitch-kill)  (eepitch-shell) rm -Rv /tmp/rubyforth/ mkdir /tmp/rubyforth/ cd /tmp/rubyforth/ wget http://angg.twu.net/rubyforth/rubyforth-0.19.tar.gz tar -xvzf rubyforth-0.19.tar.gz cd /tmp/rubyforth/rubyforth-0.19/ # (find-angg ".emacs" "eepitch-rubyforth") # (code-c-d "rubyforth" "/tmp/rubyforth/rubyforth-0.19/" :anchor) # (find-rubyforthfile "")  (eepitch-rubyforth)  (eepitch-kill)  (eepitch-rubyforth) 1 2 + . see nip see r@ see rot : .bool ( f -- ) if ." True!" else ." False!" then ; -1 .bool 0 .bool see .bool defer foo ' words is foo foo ' .s is foo foo prim pwd push(Dir.pwd) : .pwd pwd . ; .pwd \ prim chdir Dir.chdir(pop) \ : cd bl parse chdir ; \ " /usr" chdir \ cd /tmp \ prim (ls) system("ls " + pop) \ : ls 0 parse (ls) ; \ ls -l \ ls -l e* include tools/system.fs system ls ls ls *.rb \ (find-rubyforthfile "") \ (find-rubyforthgrep "grep -nH -e prim *")  (eepitch-shell)  (eepitch-kill)  (eepitch-shell) cd /tmp/rubyforth/rubyforth-0.19/ ./install.sh /tmp/rubyforth/ cd /tmp/rubyforth/ ./rubyforth 1 2 + . include tools/system.fs ##### # # modal and intuitionistic logic in RubyForth # 2008jun21 # ##### # «modal-logic» (to ".modal-logic") # (find-rubybookw3m "tut_containers.html") # (find-rubyforthfile "demos/") # (find-angg "rubyforth/demos/") # (find-angg "rubyforth/demos/modaltv.fs")  (eepitch-ruby)  (eepitch-kill)  (eepitch-ruby) v = ["\\Pyr", 1, 1, 0] w = ["\\Pyr", 0, 1, 1] class Array def mand(w) r = [self[0]]; 1.upto(self.length-1) { |i| r[i] = self[i] * w[i] }; r end def mor(w) r = [self[0]]; 1.upto(self.length-1) { |i| r[i] = [self[i],w[i]].max }; r end end v.mand(w) v.mor(w) ##### # # inspect # 2008jun27 # ##### # «inspect» (to ".inspect") # (find-fline "~/rubyforth/kernel.rb" "def enter_forth") # (find-fline "~/rubyforth/file.rb") # (find-fline "~/rubyforth/primitives.rb")  (eepitch-rubyforth)  (eepitch-kill)  (eepitch-rubyforth) 0 parse foo bar . : ruby: ( -- ) 0 parse ruby-eval ; ruby: print 1+2 ruby: push ["foo", ["bar", "plic"]] dup . ruby: print(pop.inspect) ruby: prim "..", "print(pop.inspect)" ruby: push ["foo", ["bar", "plic"]] .. ruby: prim "[]", "push []" ruby: prim "push", "pop.push(pop)" [] 44 swap push 33 push .. [] .. 44 swap [] 44 . . [] 44 .. .. ##### # # R_stack v.1 (broken) # 2008jun27 # ##### # «R_stack_broken» (to ".R_stack_broken")  (eepitch-rubyforth)  (eepitch-kill)  (eepitch-rubyforth) : ruby: ( -- ) 0 parse ruby-eval ; ruby: def parse_line; push(0); parse; end ruby: def R_stack; $R_stack; end ruby: def R_stack_init; $R_stack = []; end ruby: def R_stack_push; $R_stack.push(pop); end ruby: def R_stack_concat; $R_stack.concat; end ruby: prim "R[", "R_stack_init; R_stack_push(parse_line)" ruby: prim "R:", "R_stack_push(parse_line)" ruby: prim "R]", "print R_stack_concat" R[ foo bar R: plic plic R] ruby: print ["foo", ["bar", "plic"]] ruby: print ["foo", ["bar", "plic"]].to_s ruby: print ["foo", ["bar", "plic"]].inspect + "88" prim: hello print "hello world" ;; (find-rubybookw3m "ref_c_array.html#concat") ;; (find-fline "~/rubyforth/primitives.rb")  (eepitch-ruby)  (eepitch-kill)  (eepitch-ruby) print 1 + 2 ##### # # R_stack # 2008jun27 # ##### # «R_stack» (to ".R_stack")  (eepitch-rubyforth)  (eepitch-kill)  (eepitch-rubyforth) : ruby: ( -- ) 0 parse ruby-eval ; prim .. print(pop.inspect) prim \n push "\n" prim [] push [] prim push pop.push(pop) prim []concat d=pop;s="";pop.each{|t|s = s + d + t};push(s) variable R_stack : R_stack_init ( -- ) [] R_stack ! ; : R_stack_push ( str -- ) R_stack @ push ; : R_stack_concat ( -- str ) R_stack @ \n []concat ; : R[ R_stack_init 0 parse R_stack_push ; : R: 0 parse R_stack_push ; : R] R_stack_concat . ; : R] R_stack_concat ruby-eval ; R[ print 1 + R: 2 R] : prim: parse-word [] 0 parse over push ; : prim> 0 parse over push ; : ;prim \n []concat swap make , does> @ ruby-eval ; prim: .hello prim> print "Hello primitive world!\n" prim> push 10 prim> push 10 prim> puts (pop + pop) ;prim ##### # # ruby-and-prim-blocks # 2008jun28 # ##### # «ruby-and-prim-blocks» (to ".ruby-and-prim-blocks")  (eepitch-rubyforth)  (eepitch-kill)  (eepitch-rubyforth) prim \n push "\n" prim make-prim prim(pop, pop) : ruby: 0 parse ruby-eval ; : R[ 0 parse ; : R: \n + 0 parse + ; : R] ruby-eval ; : P[ parse-word 0 parse ; : P: \n + 0 parse + ; : P] swap make-prim ; R[ print 1 + R: 2 R] \ Marc's syntax: alias R: prim> ##### # # Corrections on the miniforth article # 2008jun30 # ##### # «miniforth-article-corr» (to ".miniforth-article-corr") (code-ps "minifproof" "~/tmp/miniforth-proof.pdf") (code-pdftotext "minifproof" "~/tmp/miniforth-proof.pdf") ;; (find-minifproofpage 1) ;; (find-minifprooftext) words as executed -> words are executed given by `read' -> given by `{\tt read}' only one mode -- `interpret' -> only one mode -- `{\tt interpret}' 5 dup . -- 25 ok -> 5 dup . 25 ok : SQUARE DUP * ; ok : CUBE DUP SQUARE * ; ok 5 CUBE . 125 ok in mode "forth" -> in mode {\tt "forth"} It can be read aloud as this: Define two new words: SQUARE: run DUP, then multiply; CUBE: run DUP, then run SQUARE, then multiply. Now put 5 on the stack, CUBE it, and print the result. [quotes?] where are are -> where we are Propor fonte menor pras listagens grandes 32 lines of code 5 blank lines 13 lines of comments # (find-THLw3m "miniforth-article.html") subj = [=[ %L _F["\n"] = function () end %L _F[""] = function () mode = "stop" end %L _F["[L"] = function () eval(parsebypattern("^(.-)%sL]()")) end [L DS = { n = 0 } push = function (stack, x) stack.n = stack.n + 1; stack[stack.n] = x end pop = function (stack) local x = stack[stack.n]; stack[stack.n] = nil; stack.n = stack.n - 1; return x end _F["5"] = function () push(DS, 5) end _F["DUP"] = function () push(DS, DS[DS.n]) end _F["*"] = function () push(DS, pop(DS) * pop(DS)) end _F["."] = function () io.write(" "..pop(DS)) end L] ]=] -- Now run it. There's no visible output. pos = 1 mode = "interpret" run() -- At this point the dictionary (_F) has eight words. -- ( Program 3b: a first program in miniforth ) After running Program 3b the system is already powerful enough to run simple Forth programs like, for example, 5 DUP * . Note that to `run' that what we need to do is: ##### # # Foerthchen # 2008oct21 # ##### # «foerthchen» (to ".foerthchen") # (find-es "anatocc" "fasm") # http://maschenwerk.de/foerthchen/ # http://maschenwerk.de/dl/foerthchen-current.tgz # rm -Rv ~/usrc/foerthchen8/ tar -C ~/usrc/ -xvzf \ $S/http/maschenwerk.de/dl/foerthchen-current.tgz cd ~/usrc/foerthchen8/ # cd ~/usrc/foerthchen8/ rm -v foer.bin foerthchen make FASM=$HOME/usrc/fasm/fasm # foerthchen.asm [12]: # STATIC = 1 # error: reserved word used as symbol. #  (eepitch-shell)  (eepitch-kill)  (eepitch-shell) cd ~/usrc/foerthchen8/ ./foerthchen words cr 2 3 + (.) 10 emit : cr 10 emit ; : . (.) cr ; 2 3 + . # (code-c-d "fchen" "~/usrc/foerthchen8/") # (find-fchenfile "") # (find-efunction 'eepitch-latex) (defun eepitch-fchen () (interactive) (ee-eepitch-comint "~/usrc/foerthchen8/" "foerthchen" "foerthchen")) ;; The examples below are broken - ;; comint waits for a prompt, and blocks...  (eepitch-fchen)  (eepitch-kill)  (eepitch-fchen) words 2 3 + (.) 10 emit  (eepitch-fchen)  (eepitch-kill)  (eepitch-fchen) : cr 10 emit ; : . (.) cr ; 2 3 + . words cr # RubyForth and MiniForth can be an answer to this: # http://groups.google.com/group/comp.lang.forth/msg/446988d72234f64d # F83 http://www.forth.org/eforth.html # Other links (2007nov21) http://www.falvotech.com/blog/index.php?/archives/200-Forth-Day-Report.html http://home.hccnet.nl/a.w.m.van.der.horst/forthprojects.html http://home.hccnet.nl/a.w.m.van.der.horst/ciforth.html http://www.complang.tuwien.ac.at/papers/ertl02.ps.gz http://groups.csail.mit.edu/medg/people/psz/Licklider.html http://toka.s3.amazonaws.com/toka.html http://www.complang.tuwien.ac.at/forth/objects/opinion.html # Goto: http://groups.google.com/group/comp.lang.forth/msg/d7903e3c8cd09dc4 http://home.earthlink.net/~neilbawd/goto.txt # Neon: http://groups.google.com/group/comp.lang.forth/browse_thread/thread/7b2d8f109b6565c0 http://members.talkamerica.net/douglashoffman@talkamerica.net/neon+.zip # OO primitives: http://groups.google.com/group/comp.lang.forth/browse_thread/thread/f3de672b8a96874a http://www.vpri.org/pdf/tr2006003a_objmod.pdf # FORGET http://groups.google.com/group/comp.lang.forth/browse_thread/thread/bbbfa3092920e257 # System guide to FigForth: http://groups.google.com/group/comp.lang.forth/browse_thread/thread/c8ce13c08897701f http://www.eforth.com.tw/academy-n/library/System%20Guide.htm http://www.forth.org/library/eforth_SOC/eforth_SOC_source/figforth/guide.ZIP http://groups.google.com/group/comp.lang.forth/msg/61d97368dfdbc2f8 http://xkcd.com/644/ http://xkcd.com/645/ http://www.imd.uni-rostock.de/veroeff/ef95.pdf http://www.forth.org/svfig/videos/ http://www.karig.net/os/ http://thinking-forth.sourceforge.net/ # Local Variables: # coding: raw-text-unix # ee-delimiter-hash: "\n#\n" # ee-delimiter-percent: "\n%\n" # ee-anchor-format: "«%s»" # End: