Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#######
#
# E-scripts on PForth, TinyScript/Minotaur, PFE and (old) GForth.
#
# 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.
# An introduction to eev can be found here:
#
#   (find-eev-quick-intro)
#   http://angg.twu.net/eev-intros/find-eev-quick-intro.html
#
# 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 <http://angg.twu.net/e/forth.e>
#           or at <http://angg.twu.net/e/forth.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######



# «.retro»			(to "retro")
# «.gforth-0.4»			(to "gforth-0.4")
# «.gforth_rr»			(to "gforth_rr")
# «.ts2»			(to "ts2")
# «.ts2b»			(to "ts2b")
# «.pforth»			(to "pforth")
# «.pforth-custom0»		(to "pforth-custom0")
# «.first_pfcustom.c»		(to "first_pfcustom.c")

# «.crim1_on_pfe»		(to "crim1_on_pfe")
# «.pforth_and_tcl»		(to "pforth_and_tcl")
# «.epforth»			(to "epforth")
# «.gforth-bytecode»		(to "gforth-bytecode")

# «.tasker»			(to "tasker")
# «.pfe-0.33»			(to "pfe-0.33")
# «.pforth-2011»		(to "pforth-2011")
# «.yforth»			(to "yforth")

# «.forth2012»			(to "forth2012")
# «.pentom»			(to "pentom")
# «.hakkinen-f»			(to "hakkinen-f")
# «.elforth»			(to "elforth")
# «.forth-mode»			(to "forth-mode")
# «.chuck-moore-5-lines»	(to "chuck-moore-5-lines")




#####
#
# retro
# 2000nov10
#
#####

# «retro»  (to ".retro")
# (find-es "retro")
#*
# retro2 needs a drive "r" for mtools stuff.
# We create one in /tmp.
# Tcn said that retro2 is an abomination compared to retro3, but anyway.
# (find-fline "/usr/src/retro/INSTALL")
# (find-fline "/etc/mtools.conf" "drives_for_retro")
#drive r: file="/tmp/floppy-r"

dd if=/dev/zero of=/tmp/floppy-r bs=1024 count=1440
mkdosfs /tmp/floppy-r
mdir r:

#*
rm -Rv /usr/src/retro/
cd /usr/src/
tar -xvzf $S/http/retro.tunes.org/pub/retro2/retro-19991119.tar.gz
cd /usr/src/retro/
make options
make	|& tee om

#*
# (find-fline "/usr/src/retro/")
# (find-fline "/usr/src/retro/INSTALL")
# (find-fline "/usr/src/retro/om")

# (find-fline "/etc/mtools.conf")
#drive r: file="/r/retro/kernel/dosimage"
#drive s: file="/r/retro/kernel/hdimage" offset=17920



#*
# This is for retro3, that tcn said that doesn't do much.
rm -Rv /usr/src/fos/
cd /usr/src/
tar -xvzf $S/http/retro.tunes.org/pub/retro3/fos-0812.tgz
cd /usr/src/fos/

gforth retro.f
#*

# (code-c-d "retro3" "/usr/src/fos/")
# (find-retro3file "")
# (find-retro3file "README")
# (find-retro3file "retro.f")
# (find-fline "/usr/src/fos/")
# (find-fline "/usr/src/fos/README")
lynx http://retro.tunes.org/pub/retro3/

# (find-node "(gforth)Blocks")

zcatinfo /usr/share/info/gforth > /tmp/gf
# (find-fline "/tmp/gf")
# (find-fline "/usr/doc/gforth/")





#####
#
# gforth 0.4.9 (potato)
# 2000oct20
#
#####

# (find-status "gforth")
# (find-vldifile "gforth.list")
# (find-fline "/usr/doc/gforth/")

# (code-c-d "gfshare" "/usr/share/gforth/0.4.9-19990617/" "gforth")
# (find-gfsharefile "")

# (find-node "(gforth)Top")
# (find-node "(gforth)Engine")
# (find-node "(gforth)Emacs and Gforth")
#   (autoload 'forth-mode "gforth.el")
#   (setq auto-mode-alist (cons '("\\.fs\\'" . forth-mode) auto-mode-alist))

# (find-fline "/etc/emacs/site-start.d/50gforth.el")
# (find-sitelispfile "gforth.el")
# (find-sitelispfile "gforth.el" "defun run-forth")
# (find-sitelispfile "gforth.el" "defun forth-send-string")
# (find-sitelispfile "gforth.el" "'forth-send-buffer")
# (find-sitelispfile "gforth.el" "'forth-send-paragraph")
# (find-sitelispfile "gforth.el" "\n Forth-send-paragraph")

# (load-library "gforth")
# (forth-mode)
# (define-key forth-mode-map "\eo" nil)
# (run-forth "gforth")

# (describe-mode)

1 2 + .

# (kill-buffer "*forth*")






######
#
# GForth 0.4.0 (potato, on hamm)
# 99dec03
#
######

# (find-vldifile "gforth.list")
# (find-fline "/usr/doc/gforth/")

# (code-c-d "gfshare" "/usr/share/gforth/0.4.0/")
# (find-gfsharefile "")

# (find-es "zsh" "heredoc")
# (find-gfsharefile "kernel/comp.fs" "Defers")

#*
clear
heredoc /tmp/test0.fs -m 766 <<'---'
#! /usr/bin/gforth
: test0 40 4 at-xy ." Hi"  40 14 at-xy ." Bye" ;
test0
bye
---
/tmp/teste.fs
#*

gforth <<'---'
: teste 40 11 at-xy ." Oi" ;
:noname   defers 'cold
  teste  bye ;  is 'cold
savesystem /tmp/teste.fi
bye
---

gforth -i /tmp/teste.fi






#####
#
# x3j14 (pdf)
#
#####

# (find-fline "/snarf/ftp/ftp.uu.net/vendor/minerva/x3j14/")
gv /snarf/ftp/ftp.uu.net/vendor/minerva/x3j14/drafts/dpans99a.pdf &




######
#
# gforth 0.3.0 hamm
#
######

pdsc /debian/main/source/interpreters/gforth_0.3.0-3.dsc
cd /usr/src/gforth-0.3.0/

dpkg -i ~/HASH/gforth
# (code-c-d "g4" "/usr/share/gforth/0.3.0/" "gforth")

# (find-g4node "Top")
# (find-g4file "")
# (find-g4tag "words")

words cr


context @ @ name>string
.s
nip 2 + +
.s
.name
cr

0 context @ .s name>string .s

: vords ( -- ) \ tools
    cr 0 context @
    BEGIN
	@ dup
    WHILE
	2dup name>string ~~ nip 2 + dup >r + 
	drop
	dup ~~ .name cr r> rot + swap
    REPEAT
    2drop ;
vords

# (find-g4node "Concept Index" "debug tracer")
# (find-g4node "Emacs and Gforth")
# (find-fline "/etc/emacs/site-start.d/50gforth.el")
# (find-fline "/usr/share/emacs/site-lisp/gforth.el")

: foo
    cr 0 context @
    @
    2dup name>string nip 2 + dup >r + 
    dup .name cr r> rot + swap ;
foo cr

# (forth-mode)
cd /usr/src/gforth-0.3.0/
cd /usr/share/gforth/0.3.0/

# (find-g4file "debug.fs")
# (find-g4file "debugging.fs")




######
#
# GForth 0.3.0
#
######

cd /usr/src/
rm -Rv gforth-0.3.0/
tar -xvzf /snarf/ftp/prep.ai.mit.edu/pub/gnu/gforth-0.3.0.tar.gz
cd /usr/src/gforth-0.3.0/
./configure |& tee oc
# segfault loop at:
# (find-gffile "om" "-o gforth-ditc")
# (find-gffile "gforth-makeimage")
# (find-gffile "Makefile" "GFORTHD=")
# (find-gffile "om" "-o engine-ditc.o")
# (find-gffile "om" "-o main-ditc.o")
# (find-gffile "om" "-o io.o")
# (find-gffile "om" "-o memcasecmp.o")
# (find-gffile "engine.c")
# (find-gffile "main.c")
# (find-gffile "io.c")
# (find-gffile "memcasecmp.c")

cd /usr/src/gforth-0.3.0/
rm -v engine-ditc.o main-ditc.o io.o memcasecmp.o
make DEBUGFLAG=-g gforth-ditc |& tee omgd
make DEBUGFLAG=-g gforth.fi |& tee omgf

make |& tee om

make install |& tee omi


: foo dup * ;
: fee dup foo * ;
4 variable qa

' foo xt-see
' qa seevar
' foo S" bar" .defname
' foo S" bar" .defname drop drop drop drop drop drop drop

\ (find-g4file "debug.fs" ": dbg")

# (find-esfile "forth.e")
# (find-g4tag ".s")

# (find-g4tag ".name")
# (find-g4tag "bounce")





#####
#
# GForth 0.4
#
#####

# «gforth-0.4»  (to ".gforth-0.4")

dpkg -i $SDEBIAN/dists/potato/main/binary-i386/interpreters/gforth_0.4.0-2.deb
cd /usr/share/gforth/0.4.0/
cp TAGS TAGS.0
# (find-gffile "TAGS.0")
# (find-gffile "TAGS")

cd /usr/share/gforth/0.4.0/
perl -nle 's:debian/tmp/usr/share/gforth/0.4.0/::; print $_' < TAGS.0 > TAGS

# (find-gftag "(type)")
# (find-gftag "count")

mkdir -p /usr/share/gforth/0.4.0/debian/
ln -s /  /usr/share/gforth/0.4.0/debian/tmp

pdsc $SDEBIAN/dists/potato/main/source/interpreters/gforth_0.4.0-2.dsc
find * -type f | sort > .files
grep '\.fs$' .files   > .files.fs


debian/rules binary |& tee odrb
# (find-fline "$SDEBIAN/dists/potato/main/source/interpreters/gforth_0.4.0-2.diff.gz")
# (find-gffile "odrb")
# (find-gffile "odrb" "gforth.fi")
# (find-gffile "gforthmi" "savesystem")
# (find-gffile "gforthmi2" "savesystem")

# (find-gffile "Makefile" "\ngforth-ditc")

# (find-gfstag "savesystem")

cat > /tmp/x <<'---'
#!/bin/bash
cd /usr/src/gforth-0.4.0/
GFORTHD="./gforth-ditc -p .:." GFORTH="./gforth-ditc -p .:. -i kernl32l.fi startup.fs" ./gforthmi2 gforth.fi  --die-on-signal -p ".:~+:." -i kernl32l.fi startup.fs
---
chmod 777 /tmp/x
/tmp/x > ~/o

# (find-gfnode "Top")
# (find-gfnode "Threading Words")
# (find-gfnode "Threading")
# (find-gfnode "Tokens for Words")
# (find-gfstag "(type)")

# (find-vldifile "gforth.list")
# (find-fline "/usr/share/gforth/0.4.0/")
# (find-fline "/etc/emacs/site-start.d/50gforth.el")
# (find-fline "/usr/share/emacs/site-lisp/gforth.el")

# (find-gffile "prim" "dlopen")
# (find-gffile "prim" "SYSCALL")
# (find-gfsrcfile "prim.b" "SYSCALL")
# (find-gfsrcfile "Makefile" "engine/prim.i:")
# (find-gfsrcfile "engine/prim.i")
# (find-gfsrcfile "engine/engine.c")

lynx /snarf/http/www.complang.tuwien.ac.at/forth/index.html
lynx /snarf/http/www.complang.tuwien.ac.at/forth/dpans-html/dpansf.htm




#####
#
# gforth_rr
#
#####

# «gforth_rr»  (to ".gforth_rr")

# (find-gfnode "Top")
# (find-gfnode "Word Index")
# (find-gfnode "Words for Including")
# (find-fline "~/FORTH/emacs.rr")

cd ~/bin/
gforth <<'---'
: rr s" ~/FORTH/emacs.rr" included ;
savesystem gforth_rr
bye
---
chmod 755 gforth_rr



# (find-gffile "")
# (find-gfsrcfile "")
# (find-fline "~/FORTH/tcl.fs")

# (find-node "(gforth)Automatic Generation")





#####
#
# TinyScript2 (pforth+Tcl+Perl+Python+...)
# 99sep??
#
#####

# (code-c-d "ts2" "/usr/src/ts2/")

rm -Rv /usr/src/ts2/
cd /usr/src/
tar -xvzf $S/http/mini.net/pub/ts2-19990704.tar.gz
cd /usr/src/ts2/

# Remove some misterious binary files
rm -v $(find * | grep 'mcp$')

cd /usr/src/ts2/forth/csrc/
diff -b -c -rs . /usr/src/pforth/csrc/ | tee ~/o
# diff -b -c -rs . /usr/src/pforth-21/csrc/ | tee ~/o

cd /usr/src/ts2/forth/csrc/
for i in *; do
  if [[ -e /usr/src/pforth/csrc/$i ]] then
    # tkdiff $i /usr/src/pforth/csrc/$i
  else
    echo Only in ts2: $i
  fi
done


# lynx /usr/src/ts2/minotaur.html
# (find-ts2file "minotaur.html" "ShLib")
agrep -l ShLib $(find *)

# (find-ts2file "forth/csrc/pfcustom.c")


psner -nc -np http://mini.net/pub/ts2/
# (find-fline "$S/http/mini.net/pub/ts2/")


forTcl
forPl

lynx http://www.dcs.gla.ac.uk/~meurig/TclHaskell/





#####
#
# Minotaur/tinyscript
# 99nov17
#
#####

# (find-fline "$S/http/mini.net/pub/")
# (find-fline "$S/http/mini.net/pub/ts2-19990704.tar.gz")
# (find-fline "$S/http/mini.net/pub/ts2/")
# (find-fline "$S/http/mini.net/pub/ts2/index.html" "Tcl (Windows):")

# (find-fline "/usr/src/ts2/")
# (find-fline "/usr/src/ts2/forth/")
# (find-fline "/usr/src/ts2/forth/csrc/")

# (find-node "(make)Selective Search")
# (find-fline "/usr/src/ts2/forth/gnuc/Makefile")

# «ts2»  (to ".ts2")

rm -Rv /usr/src/ts2/
cd /usr/src/
tar -xvzf $S/http/mini.net/pub/ts2-19990704.tar.gz
cd /usr/src/ts2/
find * -type f | sort > .files

cd /usr/src/ts2/forth/gnuc/
make -f ../gnuc/Makefile pforth		|& tee omp
make -f ../gnuc/Makefile dict		|& tee omd

cd /usr/src/ts2/forTcl/gnuc/
./configure --with-tcl=/usr/lib		|& tee oc
sed 's/gluetcl.o/pfcustom.o common.o/' < Makefile > Makefile-
diff Makefile{,-}

cd /usr/src/ts2/forTcl/gnuc/
make -f Makefile-			|& tee om

cd /usr/src/ts2/forTcl/gnuc/
strace-to ~/s expect -c '
  load ./forTcl.so
  forTcl::init
  puts [forTcl::eval {123 456 +}]
  puts [forTcl::eval {123 456 + .}]
'

cd /usr/src/ts2/forTcl/gnuc/
expect -c ' load ./forTcl.so; forTcl::init
  set a [forTcl::eval {2 . 3 . 4 5}]
  puts b
  puts $a
  puts c
'

# (find-ts2file "forth/csrc/")
# (find-ts2file "forTcl/")
# (find-ts2file "forTcl/initTcl.c" "int Fortcl_Init(")
# (find-ts2file "forTcl/gnuc/")
# (find-ts2file "forTcl/gnuc/om" "forTcl.so")
# (find-ts2file "minotaur/")
# (find-ts2file "minotaur/gnuc/")




# How I discovered which files to include in forTcl/gnuc/Makefile:
# (find-ts2file "forTcl/gnuc/om")

cd /usr/src/ts2/
agrep CustomFunctionTable $(<.files)

cd /usr/src/ts2/
agrep initForth $(<.files)



cd /usr/src/ts2/
# (find-ts2file ".files")
# (find-ts2file "forTcl/gnuc/")

# (find-fline "/usr/src/ts2/forTcl/")
# (find-fline "/usr/src/ts2/forTcl/gnuc/")

# (find-fline "/usr/src/ts2/minotaur/")

# (find-ts2file "forth/csrc/pfcustom.c")
# (find-ts2file "forth/csrc/pfcustom.c" "CreateGlueToC( \"ShLibOpen\",   0")

# (find-ts2file "forTcl/initTcl.c" "Fortcl_Init")
# (find-ts2file "forTcl/initTcl.c" "&init_forTcl")






#####
#
# Minotaur/tinyscript: gdb'ing
# 99nov30
#
#####

# «ts2b»  (to ".ts2b")
# (find-es "forth" "ts2")
# (find-ts2file "forTcl/gnuc/")
# (find-ts2file "forTcl/gnuc/Makefile")

rm -Rv /usr/src/ts2/
cd /usr/src/
tar -xvzf $S/http/mini.net/pub/ts2-19990704.tar.gz
cd /usr/src/ts2/
find * -type f | sort > .files

cd /usr/src/ts2/forTcl/gnuc/
./configure --with-tcl=/usr/lib		|& tee oc
sed 's/gluetcl.o/pfcustom.o common.o/' < Makefile > Makefile-
diff Makefile{,-}

cd /usr/src/ts2/forTcl/gnuc/
echo -n > .before-make; sleep 2
make CC='gcc -g -DPF_USER_CUSTOM' -f Makefile-		|& tee om
find ../.. -name '*.[ch]' -and -anewer .before-make > .files.ch
etags $(<.files.ch)

cd /usr/src/ts2/forTcl/gnuc/
expect -c '
  # exec $env(HOME)/TCL/attachgdb expect
  # load ./forTcl.so
  load $env(PWD)/forTcl.so
  exec $env(HOME)/TCL/attachgdb expect
  forTcl::init
  puts [forTcl::eval {123 456 +}]
  puts [forTcl::eval {123 456 + .}]
'



# (find-ts2file "forTcl/")
# (find-ts2file "forTcl/initTcl.c" "forTcl::init")

# (code-c-d "4tcl" "/usr/src/ts2/forTcl/gnuc/")
# (find-4tcltag "eval_forTcl")
# (find-4tclfile "../initTcl.c" 77)

    if (EDRXOBJ_FLAG) {
      Tcl_SetObjResult(interp, Tcl_NewStringObj(EDRXOBJ_PTR, EDRXOBJ_LEN));
      EDRXOBJ_FLAG = 0;
      return 0;
    }

# (find-4tclfile "../../forth/csrc/")
# (find-4tclfile "../../forth/csrc/common.h" 38)

extern int EDRXOBJ_FLAG, EDRXOBJ_LEN;
extern char *EDRXOBJ_PTR;

# (find-4tclfile "../../forth/csrc/pfcustom.c")



# (find-angg ".emacs" "f3")

%*
br TclLoadFile
c
info share
%*

# (find-tclfile "unix/" "tclLoadDl.c")
# (find-node "(gdb)Files" "`load FILENAME'")
# (find-node "(gdb)Files" "`info share'")

strace-to ~/s






#####
#
# Minotaur/tinyscript: returning strings
# 99nov30
#
#####

rm -Rv /usr/src/ts2/
cd /usr/src/
tar -xvzf $S/http/mini.net/pub/ts2-19990704.tar.gz
cd /usr/src/ts2/
find * -type f | sort > .files

cd /usr/src/ts2/forTcl/gnuc/
./configure --with-tcl=/usr/lib		|& tee oc
sed 's/gluetcl.o/pfcustom.o common.o/' < Makefile > Makefile-
diff Makefile{,-}

cd /usr/src/ts2/forTcl/gnuc/
cp -v ~/PFORTH/initTcl.c ..
cp -v ~/PFORTH/{common.h,pfcustom.c} ../../forth/csrc/

cd /usr/src/ts2/forTcl/gnuc/
echo -n > .before-make; sleep 2
make CC='gcc -g -DPF_USER_CUSTOM' -f Makefile-		|& tee om
find ../.. -name '*.[ch]' -and -anewer .before-make > .files.ch
etags $(<.files.ch)

cd /usr/src/ts2/forTcl/gnuc/
# strace-to ~/s \
expect -c '
  load $env(PWD)/forTcl.so
  forTcl::init
  # forTcl::eval {words}
  forTcl::eval {: shlibcall2 33 ;}
  # forTcl::eval {: mmm s" mmm -- aaah." ; mmm SetObjPtr}
' |& tee ~/o



# (find-fline "~/PFORTH/")
# (find-ts2file "forTcl/gnuc/")
# (find-ts2file "forTcl/gnuc/om")
# (find-ts2file "forth/csrc/")



cd /usr/src/ts2/forTcl/gnuc/
expect -c '
  # exec $env(HOME)/TCL/attachgdb expect
  # load ./forTcl.so
  load $env(PWD)/forTcl.so
  exec $env(HOME)/TCL/attachgdb expect
  forTcl::init
  puts [forTcl::eval {123 456 +}]
  puts [forTcl::eval {123 456 + .}]
'




#####
#
# shared libs on gforth
# 99may10?
#
#####

mail -s 'Re: using shared libs' GForth@ChaosSolutions.com <<'---'
> From: Ivan Tihonov <ivan>
> 
> If someone mail to me how to use Linux shared-libs with GForth,
> i'll write info page for this topic. :)

Hi Ivan,
here's some ugly code that links to libtcl8.0.so and invokes the tcl
interpreter on a string. It works for me, but I would love to see a
prettier version of it...


  \ s0" is like s" , but places a \0 after the string and works only
  \ in interpretation mode.
  
  : s0" ( "ccc<quote>" -- c-addr )
        [char] " parse                  ( c-addr u )
        2dup s"-buffer swap cmove       ( c-addr u )
        s"-buffer over + 0 swap c!      ( c-addr u )
        2drop s"-buffer ;
  
  : strlen ( c-addr -- len ) dup &1024 0 scan drop swap - ;
  
  s" libtcl8.0.so"      open-lib        dup .   constant libtcl
  s" Tcl_CreateInterp"  libtcl lib-sym  dup .   constant &Tcl_CreateInterp
  s" Tcl_Eval"          libtcl lib-sym  dup .   constant &Tcl_Eval
  &Tcl_CreateInterp     icall0          dup .   constant &interp
  
  &interp s0" expr 22+3"        &Tcl_Eval icall2 dup .  drop
  
  cr &interp @ dup strlen type
  
  \ The last line should output "25".


More hints later.
  [], Edrx
  edrx@inx.com.br
  edrx@mat.puc-rio.br
  http://www.mat.puc-rio.br/~edrx/
---


\ (find-gffile "kernel/basics.fs" ": scan")
\ (find-fline "~/TCL/tclev.c")





#####
#
# pforth 21 (potato, on slink)
# 99nov19
#
#####

# «pforth»  (to ".pforth")
# (find-es "forth" "pforth-edrx")

rm -Rv /usr/src/pforth-21/
pdsc $SDEBIAN/dists/potato/main/source/interpreters/pforth_21-2.dsc

cd /usr/src/pforth-21/
for i in docs/* README.txt; do
  tr -d \\r < $i > tmpdoc
  mv -v tmpdoc $i
done
cd /usr/src/pforth-21/docs/
for i in *.htm; do
  unhtml < $i | sed -e 's/&nbsp;/ /g' -e 's/&lt;/</g' > $(basename $i .htm)
done
cd /usr/src/pforth-21/
cat >> debian/docs <<'---'
docs/pf_ref
docs/pf_tut
---
etags csrc/*.[ch]

debian/rules binary	|& tee odrb

# (find-pffile "odrb" "pforth -i")

mv -v /usr/src/pforth*.deb /usr/src/.debs/
apt-update
apti pforth

# (find-vldifile "pforth.list")
# (find-fline "/usr/doc/pforth/")



echo words		| pforth	| tee ~/o
echo see koo cr see foo | pforth	| tee ~/o

# (find-fline "~/o")
# (find-pffile "trace.fth" "KOO")

cd /usr/src/pforth/docs/
lynx 'pf_ref.htm#Single Step Trace'


# (code-c-d "pf" "/usr/src/pforth-21/")
# (find-pffile "")
# (find-pffile "csrc/")
# (find-pffile "docs/")
# (find-pffile "utils/")

# (find-pffile "see.fth")
# (find-pffile "csrc/")
# (find-pffile "csrc/pf_guts.h" 82)
# (find-pffile "system.fth" ": >CODE")
# (find-pffile "misc1.fth" ": >NAME")

(defun eepf-bounded () (interactive)
  (ee-strbounded 'write-ee "%*" "%*" "" "" "/usr/src/pforth/ee.fth"))
(global-set-key [f3] 'eepf-bounded)

cd /usr/src/pforth/
pforth ee.fth

%*
hex
cr see foo
cr ' foo .xt
cr ' foo .
cr ' foo >code .
cr ' foo >code 10 - 30 dump
%*

# (find-pffile "csrc/pf_words.c" "Stack<")



'(s e pre post &optional other-ee-file fmode)
(debug-on-entry 'eepf-bounded)
# (find-elinode "Debugging")





#####
#
# pforth-21 with my own extensions
# 99dec11
#
#####

# «pforth-custom0»  (to ".pforth-custom0")
# (find-es "forth" "pforth")

###
### Part 1: understanding pfcustom.c
###

rm -Rv /usr/src/pforth-21/
pdsc $SDEBIAN/dists/potato/main/source/interpreters/pforth_21-2.dsc
cd /usr/src/pforth-21/
for i in $(find * -name '*.[ch]' -or -name '*.fth'); do
  tr -d \\r < $i > $i.lf; mv $i.lf $i
done
etags csrc/*.[ch]
cp -v csrc/pfcustom.c csrc/pfcustom.c.orig
debian/rules build	|& tee odrbu

laf csrc/*.c objects/* 

# (find-pffile "README.txt" "PF_USER_CUSTOM")
# (find-pffile "csrc/pfcustom.c" "PF_USER_CUSTOM")
# (find-pffile "csrc/pf_cglue.c")
# (find-pffile "odrbu")

g++ -DPF_SUPPORT_FP -E csrc/pfcustom.c > csrc/pfcustom.E
grep -v '^[ 	]*$' csrc/pfcustom.E \
  | awk '{
      if ($1=="#") { verbose = ($3 ~ /csrc/); print }
      else if (verbose) { print }
    }' \
  > csrc/pfcustom.E-
agrep '"C"' $(getstrings < csrc/pfcustom.E- | sort | uniq | grep usr)


###
### Part 2: printing and inspecting pfcustom.{c,E-}
###

cd /usr/src/pforth-21/csrc/
a2ps850dj -o /tmp/o.ps pfcustom.c pfcustom.E-
cd /tmp/
make -f ~/LATEX/Makefile o.p01

cd /usr/src/pforth-21/
find * -name '*.[ch]' -or -name '*.fth' > .files.chfth
agrep LoadCustom $(<.files.chfth)

# (find-pffile "csrc/pfcustom.c")
# (find-pffile "csrc/pfcustom.E")
# (find-pffile "csrc/pfcustom.E-")

# (find-node "(gawk)Using Constant Regexps")
# grep -v '^[ 	]*$' csrc/pfcustom.E | l -S


###
### Part 3: writing my first pfcustom.c
### «first_pfcustom.c»  (to ".first_pfcustom.c")
###

cd /usr/src/pforth-21/
cat > csrc/pfcustom.c <<'--%%--'
#include "pf_all.h"
/***/
static int32 CTest0( int32 Val );
static void CTest1( int32 Val1, cell Val2 );
static int32 CTest0(int32 Val) {
  MSG_NUM_D("CTest0 (!!!): Val = ", Val);
  return Val+1;
}
static void CTest1(int32 Val1, cell Val2) {
  MSG("CTest1 (!!!): Val1 = "); ffDot(Val1);
  MSG_NUM_D(", Val2 = ", Val2);
}
/***/
void *CustomFunctionTable[]={
  (void *)CTest0,
  (void *)CTest1
};	
Err CompileCustomFunctions(void) {
/* Params are: Name in UPPER CASE, Function, Index, #rets (0/1), NumParams */
  CreateGlueToC( "CTEST0", 0, C_RETURNS_VALUE, 1 );
  CreateGlueToC( "CTAST1", 1, C_RETURNS_VOID, 2 );
  return 0;
}
--%%--
make	|& tee om

./pforth <<'---'
22 55
ctest0
ctast1
---


###
### Part 4: writing my own pf_main
###

cd /usr/src/pforth-21/
for i in csrc/*.c; do
  echo $i '->' csrc/$(basename $i .c).E-
  g++ -DPF_SUPPORT_FP -E $i \
  | grep -v '^[[:space:]]*$' \
  | awk '{
      if ($1=="#") { verbose = !($3 ~ /^..usr/); print }
      else if (verbose) { print }
    }' \
  > csrc/$(basename $i .c).E-
done

# (find-pffile "csrc/pf_main.E-" "Result = pfDoForth(")
# (find-pffile "csrc/pf_core.E-" "int32 pfDoForth(")
# (find-pffile "csrc/pf_main.c")
# (find-node "(libc)Table of Output Conversions")
# (find-pffile "om")
# (find-pffile "Makefile")

cd /usr/src/pforth-21/csrc/
cat > mypfmain.c <<'---'
#include "pforth.h"
#include <stdio.h>
#define S(ptr) (*(ptr)?ptr:0)
/* */
int main(int argc, char **argv) {
  printf("pfDoForth result: %ld\n",
	 pfDoForth(S(argv[1]), S(argv[2]), *(argv[3])&1));
}
---
g++ -DPF_SUPPORT_FP -Wall -c -o mypfmain.o mypfmain.c
g++ -o mypfmain mypfmain.o ../objects/pf{_{cglue,clib,core,inner,io,mem,save,text,words},compil,custom}.o

cd /usr/src/pforth-21/csrc/
./mypfmain ../pforth.dic '' 0
./mypfmain '' '' 1

# All standard ".o"s: in ../objects/,
# pf{_{cglue,clib,core,inner,io,main,mem,save,text,words},compil,custom}.o



###
### Part 5: replacing pfDoForth
###

# (find-pffile "csrc/pf_core.E-" "int32 pfDoForth(")
# (find-pffile "csrc/pf_core.c" "int32 pfDoForth(")

cd /usr/src/pforth-21/csrc/
cat > mydoforth.c <<'---'
#include "pf_all.h"
#include <stdio.h>
#define S(ptr) (*(ptr)?ptr:0)
/* */
int main(int argc, char **argv) {
  char *DicName = argv[1];
  cfTaskData *cftd;
  cfDictionary *dic;
  int32 Result = 0;
  ExecToken EntryPoint = 0;
  pfInitGlobals();
  cftd = pfCreateTask( (512), (512) );
  pfSetCurrentTask( cftd );
  dic = pfLoadDictionary( DicName, &EntryPoint );
  pfExecByName("AUTO.INIT");
  Result = pfRunForth();
  pfExecByName("AUTO.TERM");
  pfDeleteDictionary( dic );
  pfDeleteTask( cftd );
  return 0;
}
---
g++ -DPF_SUPPORT_FP -Wall -c -o mydoforth.o mydoforth.c
g++ -o mydoforth mydoforth.o ../objects/pf{_{cglue,clib,core,inner,io,mem,save,text,words},compil,custom}.o

cd /usr/src/pforth-21/csrc/
./mydoforth ../pforth.dic


cd /usr/src/pforth-21/csrc/
./mypfmain ../pforth.dic '' 0
./mypfmain '' '' 1




# Almost the original pfDoForth:

int32 pfDoForth(const char *DicName, const char *SourceName, int32 IfInit) {
  cfTaskData *cftd;
  cfDictionary *dic;
  int32 Result = 0;
  ExecToken EntryPoint = 0;
  pfInitGlobals();
  cftd = pfCreateTask( (512), (512) );
  if(cftd) {
    pfSetCurrentTask( cftd );
    if( IfInit ) {
      dic = pfBuildDictionary( (120000), (300000) );
    } else {
      dic = pfLoadDictionary( DicName, &EntryPoint );
    }
    pfExecByName("AUTO.INIT");
    if( EntryPoint != 0 ) {
      pfExecuteToken( EntryPoint );
    } else {
      if( SourceName == __null  ) {
	Result = pfRunForth();
      } else {
	Result = pfIncludeFile( SourceName );
      }
    }
    pfExecByName("AUTO.TERM");
    pfDeleteDictionary( dic );
    pfDeleteTask( cftd );
  }
  return Result;
}



###
### Part ??: calling Tcl from a pfcustom.c
###





#######
#
# Crim1 on PFE
# 00jan24
#
#######

# «crim1_on_pfe»  (to ".crim1_on_pfe")

# (code-c-d "pfe" "/usr/src/pfe-0.9.14/")
# (find-pfefile "")
# (find-pfefile "INSTALL" "of Linux, FreeBSD,")
# (find-pfefile "src/config/Linux/")

# (find-pfefile "src/config/Linux/options.mk" "ncurses")
# cd /usr/src/pfe-0.9.14/src/
# diff config/Linux/options.mk{~,}	|& tee ~/o

# (find-fline "~/crim/patchpfe.txt")
# (find-pfefile "src/config/default/depend.mk" "ENVOBJ")
# diff config/default/depend.mk{~,}	|& tee ~/o
#
# (find-fline "~/crim/patchpfe.txt" "At src/vocs.c")
# (find-pfefile "src/vocs.c" "extern const Words")
# diff vocs.c{~,}	|& tee ~/o


rm -Rv /usr/src/pfe-0.9.14/
cd /usr/src/
tar -xvzf $S/ftp/ftp.taygeta.com/Taygeta/Forth/Linux/pfe-0.9.14.tar.gz
cd /usr/src/pfe-0.9.14/src/

(
patch config/Linux/options.mk <<'%%'
20,21c20,21
< OPTIONS	=
< LIBS	= -ltermcap -lm
---
> #OPTIONS	=
> #LIBS	= -ltermcap -lm
25,26c25,26
< #OPTIONS = -I/usr/include/ncurses
< #LIBS	= -lncurses -lm
---
> OPTIONS = -I/usr/include/ncurses
> LIBS	= -lncurses -lm
%%

cp -iv ~/crim/crim.c.txt crim.c
#
patch config/default/depend.mk <<'%%'
24c24
< 		yours$o
---
> 		yours$o crim$o
%%
#
patch vocs.c <<'%%'
47c47
<   your_words;
---
>   your_words,		crim_words;
55a56
>   &crim_words,
%%
)	|& tee op

./config.sh	|& tee oc
make		|& tee om

rm -Rv /tmp/crim/
mkdir /tmp/crim/
cd ~/crim/
for i in *.txt; do cp -iv $i /tmp/crim/$(basename $i .txt); done

cd /tmp/crim/
echo "INCLUDE 1.4th BYE" > 1q.4th
echo "INCLUDE 2.4th BYE" > 2q.4th

cd /tmp/crim/
/usr/src/pfe-0.9.14/src/pfe -q 1q.4th
/usr/src/pfe-0.9.14/src/pfe -q 1-autod.4th
/usr/src/pfe-0.9.14/src/pfe -q 2q.4th
/usr/src/pfe-0.9.14/src/pfe -q 2-autod.4th





#####
#
# old notes on pforth and tcl
# 00jan??
#
#####

# (find-pffile "docs/")
# (find-pffile "docs/pf_ref" " pf_main.c")
# (find-pffile "csrc/pf_main.c")
# (find-pffile "csrc/pf_main.c" "module from 'C' based application")
# (find-pffile "csrc/pfcustom.c")
# (find-pffile "csrc/")
# (find-pffile "")
# (find-pffile "Makefile")
# (find-pffile "odrb")
# (find-pftag "pfDoForth")

cd /usr/src/pforth-21/
cat > testmain.c <<'---'
/*
 */
#include <stdio.h>
#include "pforth.h"
int main(int argc, char **argv) {
  const char *DicName = "pforth.dic";
  const char *SourceName = NULL;
  char IfInit = 0;
  char *s;
  int32 i;
  int Result;
  pfSetQuiet(1);
  Result = pfDoForth(DicName, SourceName, IfInit);
  printf("%d\n", Result);
}
---
g++ -c -I csrc -o testmain.o testmain.c
g++ -o testmain $(ls objects/* | grep -v main) testmain.o -lm




######
#
# Debugging pforth
# 00jan23
#
######

rm -Rv /usr/src/pforth-21/
pdsc $SDEBIAN/dists/potato/main/source/interpreters/pforth_21-2.dsc
cd /usr/src/pforth-21/
for i in $(find * -name '*.[ch]' -or -name '*.fth'); do
  tr -d \\r < $i > $i.lf; mv $i.lf $i
done
etags csrc/*.[ch]
cp -v csrc/pfcustom.c csrc/pfcustom.c.orig
# (find-pffile "Makefile" "$(COMPILE)")
debian/rules CDEFS=-g build	|& tee odrbu

cd /usr/src/pforth-21/
for i in csrc/*.c; do
  echo $i '->' csrc/$(basename $i .c).E-
  g++ -DPF_SUPPORT_FP -E $i \
  | grep -v '^[[:space:]]*$' \
  | awk '{
      if ($1=="#") { verbose = !($3 ~ /^..usr/); print }
      else if (verbose) { print }
    }' \
  > csrc/$(basename $i .c).E-
done

# (find-pffile "csrc/pfcustom.c" "CustomFunctionTable[] =")
cat > /tmp/4 <<'---'
: square dup * ;
20 ctest0 square .
bye
---

/usr/src/pforth-21/pforth -q /tmp/4

%*
set args -q /tmp/4
br CTest0
run
bt
%*

# (gdb "gdb /usr/src/pforth-21/pforth")





#####
#
# Linking pforth and Tcl
# 00feb14
#
#####

# «pforth_and_tcl»  (to ".pforth_and_tcl")

# (find-fline "~/PFORTH/")
# (find-fline "~/PFORTH/Makefile")
# (find-fline "~/PFORTH/tclpforth.c")
# (find-fline "~/PFORTH/tclpforth.tcl")

# The "pf_runforth" in the script below enters pforth's interactive
# mode. Use "bye" to return to Tcl.

cd ~/PFORTH/
make CFLAGS=-g
cat > /tmp/test.4th <<'---'
1 2 + . cr
---
expect -c '
  load ./tclpforth.so
  pf_init pforth.dic
  pf_includefile /tmp/test.4th
  pf_includefile $env(HOME)/crim.fth
  # pf_runforth
  pf_finish
  puts "bye from Tcl!"
'

cd ~/PFORTH/
make clean

cd ~/PFORTH/
make CFLAGS=-g
expect -c '
  source /home/root/PFORTH/tclpforth.tcl
  fdo "1 2 .s .s"
  # attachgdb expect
  fdo "99 100"
  fdo ".s"
  # pfevaluate "quit"
  # fdo "quit"
  puts [fdo "33 22 + N->TCL"]
  puts [fdo {: foo! s" foo!" ;  foo! ->TCL}]
  fdo ".s"
  pf_finish
'

%*
br pfIncludeFile
br ffIncludeFile
cont
%*

# (find-fline "~/PFORTH/tclpforth.tcl")
# (find-fline "~/PFORTH/tclpforth.c")





cd /usr/src/pforth-21/csrc/
# (find-node "(gdb)Files")
# (find-node "(gdb)Files" "add-symbol-file")
# (find-node "(gdb)Source Path")
# (find-node "(gdb)File Options" "-d ")

cd /usr/src/pforth-21/csrc/
agrep gCurrentTask *.[ch]
# (find-pffile "csrc/pf_core.c" "gCurrentTask")
# (find-pftag "cfTaskData")

# (find-pftag "ffOK")
# (find-pftag "ffPushInputStream")
# (find-pftag "ffPopInputStream")
# (find-pftag "pfExecByName")








# (find-fline "/usr/doc/mktclapp/examples/")
# (find-fline "/usr/doc/mktclapp/examples/README")
# (find-fline "/usr/doc/mktclapp/examples/Makefile")


##
## Adding stuff to let forth return a result to Tcl
##

# (find-es "forth" "first_pfcustom.c")
# (find-fline "~/PFORTH/mtamacros.h")
# (find-fline "~/PFORTH/tclpf_custom.c")
# (find-fline "~/PFORTH/tclpf_hook.c")
# (find-vldifile "tcl8.0-dev.list")
# (find-fline "/usr/doc/tcl8.0-dev/")
# (eeman "Tcl_SetResult")
# (eeman "Tcl_SetObjResult")
# (eeman "Tcl_NewIntObj")

# (find-fline "~/PFORTH/Makefile")
cd ~/PFORTH/
make clean
make |& tee ~/om
# (find-fline "~/om")
strings < tclpforth0 | grep -i TCL
strings < tclpforth.dic | grep -i tcl






#####
#
# Understanding more of PForth
# 2000mar10
#
#####

# «epforth»  (to ".epforth")
# (find-fline "~/EXPECT/epforth")

hex
see foo
' foo .
' foo rel->use .
' foo rel->use 20 - 40 dump
' foo rel->use @ .
' dup .
' dup >name .
' dup >name 20 - 40 dump
' dup >name 4 - @ .
' dup >name 8 - @ use->rel .


map
\ see map
\ (find-pffile "misc2.fth" "MAP")


\ (find-pffile "")
\ (find-pffile "misc1.fth" ">NAME")
\ (find-pffile "system.fth" "nfa")


\ (find-pffile "csrc/pfcompil.c")




#####
#
# box diagrams of pforth's memory 
# 2000mar22
#
#####

# (find-fline "~/PFORTH/")




\ BD  = box diagram
\ BDM = BD memory - where we are reading from.
\ BDH = BD horizontal pos

CREATE BD1  200 ALLOT
CREATE BD2  200 ALLOT
CREATE BD3  200 ALLOT
CREATE BD4  200 ALLOT

0 VALUE BDH
: H+ ( adr -- adr+bdh ) BDH + ;
: H+= ( delta -- ) BDH + TO BDH ;

: BDCLEAR ( -- )
    BD1 200 BL FILL
    BD2 200 BL FILL
    BD3 200 BL FILL
    BD4 200 BL FILL
    0 TO BDH ;
: .BD ( -- )
    CR BD1 BDH TYPE
    CR BD2 BDH TYPE
    CR BD3 BDH TYPE
    CR BD4 BDH TYPE ;

BDCLEAR

ASCII - VALUE  ROOFCHAR
ASCII - VALUE FLOORCHAR

: VWALL ( c -- )
    ASCII + BD1 H+ C!
      ( c ) BD2 H+ C!
    ASCII + BD3 H+ C!
    1 H+= ;
: SPVWALL ( -- ) SPC VWALL ;
: |VWALL ( -- ) ASCII | VWALL ;
: HWALLS ( -- )
     ROOFCHAR BD1 H+ C!    ROOFCHAR BD1 H+ 1+ C!
    FLOORCHAR BD3 H+ C!    ROOFCHAR BD3 H+ 1+ C!
    2 H+= ;

: U>D ( u -- d ) 0 ;
: <##> ( d -- $adr $len ) <# # # #> ;
: <########> ( d -- $adr $len ) <# # # # # # # # # #> ;
: $! ( adr len destadr -- ) SWAP MOVE ;

\ The prefixes say the number of digits.
\ 8VWALL advances BDH a lot, 2VWALL only one char.
\ They're made to be called in hex mode (but we're in decimal now)

NAMEBASE VALUE BDM
: BDM+= ( delta -- ) BDM + TO BDM ;

: 8VWALL ( -- ) BDM <########> BD4 H+ $!  6 H+=  |VWALL ;
: 2VWALL ( c -- ) BDM 255 AND <##> BD4 H+ $!  |VWALL ;

32 CONSTANT SPC
: 2HWALLS ( -- ) BDM C@ <##> BD2 H+ $!   HWALLS   1 BDM+= ;
: HHWALLS ( -- ) HWALLS SPC VWALL HWALLS ;
: HHHHWALLS ( -- ) HHWALLS SPC VWALL HHWALLS ;
: 8HWALLS ( -- ) BDM @ <########> BD2 H+ 2 + $!   HHHHWALLS   4 BDM+= ;

8VWALL HHHHWALLS ASCII | 2VWALL





ASCII | VWALL  HWALLS  ASCII i VWALL  .BD





\ <##> BD4 H+ $!





#####
#
# PForth's bytecode
#
#####

# (find-fline "~/crim/autodoc.4th.txt")
# (find-fline "~/crim/2-autod.4th.txt")
# (find-fline "~/crim/2.aud.txt")


# (find-node "(emacs-e20)RegConfig")
# (find-etag "window-configuration-to-register")
# (find-etag "enlarge-window")
# (find-node "(elisp)Index")
# (find-node "(elisp)Size of Window")


(set-windows
 6 0 '(find-fline "~/crim/2-autod.4th.txt" "0 N~")
 5 0 '(find-fline "~/crim/2-autod.4th.txt" "\\\\")
 14 0 '(find-fline "~/crim/2.aud.txt" "%END-CRIM")
 3 0 '(find-fline "~/crim/2-autod.4th.txt" "BOX\"")
 9 0 '(find-fline "~/crim/2.aud.txt" "+--+")
)




#####
#
# More about GForth's bytecode
# 2000jul26
#
#####

# «gforth-bytecode»  (to ".gforth-bytecode")
#*
cat > /tmp/gf <<'---'
: hu.r ( n ndigits -- ) base @ >r hex u.r r> base ! ;
: h. ( byte -- ) 2 hu.r ;
: hadr ( adr -- ) 8 hu.r ." : " ;
here value old-here
: .bytes ( -- )
  begin old-here here <
  while old-here c@ h. space old-here 1+ to old-here
  repeat ;
: b" ( -- ;" ) cr old-here hadr .bytes ."   " 34 parse type ; immediate

here to old-here
create foo b" foo"
create bar b" bar"
create bz  b" bz"
create baz b" baz"
create bazz b" bazz"
: nop ;          b" nop"
: sq dup * ;     b" sq"
: cub dup sq * ; b" cub"

cr ' foo	hadr ." ' foo"
cr   foo	hadr ."   foo"
cr dovar:	hadr ." dovar:"
cr ' sq		hadr ." ' sq"
cr ' sq	@	hadr ." ' sq @"
cr ' sq	8 + @	hadr ." ' sq 8 + @"
cr ' dup	hadr ." ' dup"
cr ' sq	12 + @	hadr ." ' sq 12 + @"
cr ' *		hadr ." ' *"
cr ' sq	16 + @	hadr ." ' sq 16 + @"
cr comp'  exit	hadr ." comp' exit"

cr bye
---

gforth /tmp/gf
#*


4012DBC4: 84 DB 12 40 83 66 6F 6F 20 20 20 20
                                  A0 A0  4  8  0  0  0  0   foo
4012DBD8: C4 DB 12 40 83 62 61 72 A0 A0  4  8  0  0  0  0   bar
4012DBE8: D8 DB 12 40 82 62 7A 20 A0 A0  4  8  0  0  0  0   bz
4012DBF8: E8 DB 12 40 83 62 61 7A A0 A0  4  8  0  0  0  0   baz
4012DC08: F8 DB 12 40 84 62 61 7A 7A 20 20 20 20 20 20 20
                                  A0 A0  4  8  0  0  0  0   bazz

4012DBD0: ' foo
4012DBD8:   foo
 804A0A0: dovar:


# (find-node "(gforth)DOES>")
# (find-node "(nasm)Section 4.7.5")
# (find-gfsrcfile "kernel/int.fs" "(name>x)")
# (find-gfsrcfile "kernel/int.fs" ": '")

# (find-gfsrcfile "kernel/comp.fs" "\n: ; ")
# (find-gfsrcfile "kernel/comp.fs" ": POSTPONE ")
# (find-gfsrcfile "kernel/comp.fs" ": postpone,")


: name' name name-too-short? find-name ;
: my' name' (name>x) drop ;
: my'c name' (name>comp) drop ;






; HERE is here before CREATE FOO
	dd HERE0
	align 4
	db 0x80+3,'foo'
	align 8, db ' '
TICK_FOO:			; ' FOO returns this address
	dd DOVAR		; DOVAR: returns DOVAR
	dd 0			; what's this 0?
ADR_FOO:			; FOO returns this address

; HERE is here before CREATE BAR 
HERE2:
	dd HERE1
	align 4
	db 0x80+3,'foo'
	align 8, db ' '
TICK_FOO:			; ' FOO returns this address
	dd DOVAR		; DOVAR: returns DOVAR
	dd 0			; what's this 0?
ADR_FOO:			; FOO returns this address



	align 4
	db 0x80+2,'bz'
	align 8, db ' '
	dd DOVAR		; ( ) dovar: ( DOVAR )
	dd 0
FOO_ADR:




#####
#
# tasker.fs in gforth
# 2001apr19
#
#####

# «tasker»  (to ".tasker")
#*
cat > $EEG <<'---'
require tasker.fs
: testa $100 newtask activate $10 0 DO 'A emit LOOP stop ;
: testb $100 newtask activate $10 0 DO 'B emit LOOP stop ;
testa testb

bye
---
eeg gforth
#*




#####
#
# pfe-0.33.66
# 2008apr20
#
#####

# «pfe-0.33»  (to ".pfe-0.33")
# http://pfe.sourceforge.net/
# http://ufpr.dl.sourceforge.net/sourceforge/pfe/pfe-0.33.66.tar.bz2
#*
rm -Rv ~/usrc/pfe-0.33.66/
tar -C ~/usrc/ -xvjf \
  $S/http/ufpr.dl.sourceforge.net/sourceforge/pfe/pfe-0.33.66.tar.bz2
cd     ~/usrc/pfe-0.33.66/

./configure  |& tee oc
make         |& tee om
# make install

#*
# (code-c-d "pfe" "~/usrc/pfe-0.33.66/")
# (code-ps        "forthprimer" (ee-pfefile "doc/Forthprimer.pdf"))
# (code-pdftotext "forthprimer" (ee-pfefile "doc/Forthprimer.pdf"))
# (find-pfefile "")
# (find-pfefile "INSTALL.TXT")
# (find-pfefile "README")
# (find-pfefile "README" "Forthprimer.pdf")
# (find-pfefile "doc/")
# (find-pfefile "doc/src/PFE.css")
# (find-forthprimerpage 1)
# (find-forthprimertext)





* (eepitch-gforth)
* (eepitch-kill)
* (eepitch-gforth)
\ draw stars!
: star ." *";
: stars 0 ?do star loop ;
: triangle dup 1 do cr dup i - spaces i 2* 1- stars loop drop ;
12 triangle
bye




#####
#
# PForth (2011)
# 2011nov25
#
#####

# «pforth-2011»  (to ".pforth-2011")
# (find-status   "pforth")
# (find-vldifile "pforth.list")
# (find-udfile   "pforth/")

# (find-udfile "pforth/pf_ref.htm")
# (find-udfile "pforth/pf_todo.txt")
# (find-udfile "pforth/pf_tut.htm")
# (find-udfile "pforth/pfmanual.txt")
# (find-udfile "pforth/copyright")
# (find-udfile "pforth/README.txt.gz")
# (find-udfile "pforth/changelog.Debian.gz")
# (find-man "1 pforth")

* (eepitch-pforth)
* (eepitch-kill)
* (eepitch-pforth)
1 2 + .
words
: square dup * ;
: cube dup square * ;
see cube




#####
#
# yforth
# 2011nov25
#
#####

# «yforth»  (to ".yforth")
# (find-status   "yforth")
# (find-vldifile "yforth.list")
# (find-udfile   "yforth/")

* (eepitch-yforth)
* (eepitch-kill)
* (eepitch-yforth)
1 2 + .
words
: square dup * ;
: cube dup square * ;
see cube




#####
#
# The Forth2012 standard
# 2019feb11
#
#####

# «forth2012» (to ".forth2012")
# http://lars.nocrew.org/forth2012/
# http://lars.nocrew.org/forth2012/core/
# http://lars.nocrew.org/forth2012/core/DivMOD.html




#####
#
# pentom
# 2021sep10
#
#####

# «pentom»  (to ".pentom")
# https://github.com/benhoyt/python-pentomino/
# https://github.com/benhoyt/python-pentomino/blob/master/pentom.fs
# https://benhoyt.com/writings/python-pentomino/




#####
#
# hakkinen-f
# 2021dec05
#
#####

# «hakkinen-f»  (to ".hakkinen-f")
# https://github.com/petrihakkinen/f
# (find-git-links "https://github.com/petrihakkinen/f" "hakkif")
# (code-c-d "hakkif" "~/usrc/f/")
# (find-hakkiffile "")
# (find-hakkiffile "f.lua")
# (find-hakkiffile "test/")
# (find-hakkiffile "test/mandel.f")




#####
#
# elforth
# 2021dec05
#
#####

# «elforth»  (to ".elforth")
# (find-epackage-links 'elforth "elforth" t)
# (find-epackage       'elforth)
# https://github.com/lassik/elforth




#####
#
# forth-mode
# 2021dec05
#
#####

# «forth-mode»  (to ".forth-mode")
# (find-epackage-links 'forth-mode "forthmode" t)
# (find-epackage       'forth-mode)
# (code-c-d "forthmode" "~/.emacs.d/elpa/forth-mode-20210829.1824/")
# (find-forthmodefile "")
# https://github.com/larsbrinkhoff/forth-mode




#####
#
# chuck-moore-5-lines
# 2022oct29
#
#####

# «chuck-moore-5-lines»  (to ".chuck-moore-5-lines")

# https://retrocomputing.stackexchange.com/questions/25506/did-forths-inventor-charles-moore-really-write-a-cad-program-in-only-5-lines-of
# https://wiki.osdev.org/Beginner_Mistakes#Memory_usage

It can take a lot of time and thought to figure out how to reduce code
size. Charles Moore, inventor of Forth, wrote a CAD program which was
structured around just 5 lines of code. When asked how long it took to
write those 5 lines, he replied, "Ooh, about 2 years"!




# 2011jul13:
# http://www.softsynth.com/pforth/
# http://www.mailsend-online.com/blog/flirting-with-forth.html
# http://pygmy.utoh.org/forth.html

# New links, 2019feb11:

http://ficl.sourceforge.net/ficl.html
http://www.forth.org/
http://www.forth.org/svfig/
http://www.forth.org/POL.pdf
http://www.forth.org/svfig/zorkmail.html
http://wiki.c2.com/?ForthLanguage
http://www.ultratechnology.com/okad2.htm
http://home.hccnet.nl/a.w.m.van.der.horst/figforth.html
http://home.hccnet.nl/a.w.m.van.der.horst/forthlectureH.html

https://news.ycombinator.com/item?id=30944881 ACM Opens First 50 Years Backfile (acm.org)
"Looks like they have a bunch of papers about my current interest (FORTH - in fact there there is (was: final issue 1994) a SIGFORTH)"

https://news.ycombinator.com/item?id=33180796 Programming a Problem-Oriented Language (1970) [pdf] (forth.org) - chuck moore
https://news.ycombinator.com/item?id=34373279 What the hell is Forth? (2019) (information-superhighway.net) ***
https://blog.information-superhighway.net/a-forth-vocabulary-for-iteration ***

https://compilercrim.es/bootstrap/miniforth/






#  Local Variables:
#  coding:               utf-8-unix
#  End: