Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
####### # # E-scripts on 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/gforth.e> # or at <http://angg.twu.net/e/gforth.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/>. # ####### # «.gforth-basics» (to "gforth-basics") # «.gforth-debian-source» (to "gforth-debian-source") # «.ffcall-debian-source» (to "ffcall-debian-source") # «.fflib.fs» (to "fflib.fs") # «.gforth-lua» (to "gforth-lua") # (find-status "gforth") # (find-vldifile "gforth.list") # (find-udfile "gforth/") # (find-node "(gforth)Top") # (find-node "(vmgen)Top") ##### # # gforth - basics # 2007mar02 # ##### # «gforth-basics» (to ".gforth-basics") # (find-angg ".emacs" "gforth") # (find-status "gforth") # (find-vldifile "gforth.list") # (find-udfile "gforth/") # (find-status "gforth-common") # (find-vldifile "gforth-common.list") # (find-udfile "gforth-common/") # (find-sitelispfile "gforth.el") # (find-gforthnode "Emacs and Gforth") # (find-efunction 'run-forth) * (eepitch-gforth) 1 2 + . . # (find-fline "/usr/share/gforth/0.6.2/fflib.fs") ##### # # recompiling the debian package # 2007mar02 # ##### # «gforth-debian-source» (to ".gforth-debian-source") # Note: libffcall1-dev is not specified in the build-depends, # and we get a build that supports "needs fflib.fs" when libffcall1-dev # is installed, and the default, slightly broken build, when not. # # http://ftp.debian.org/debian/pool/main/g/gforth/ # http://ftp.debian.org/debian/pool/main/g/gforth/gforth_0.6.2-4.dsc # http://ftp.debian.org/debian/pool/main/g/gforth/gforth_0.6.2-4.diff.gz # http://ftp.debian.org/debian/pool/main/g/gforth/gforth_0.6.2.orig.tar.gz #* rm -Rv ~/usrc/gforth/ mkdir ~/usrc/gforth/ cd $S/http/ftp.debian.org/debian/pool/main/g/gforth/ cp -v gforth_0.6.2* ~/usrc/gforth/ cd ~/usrc/gforth/ dpkg-source -sn -x gforth_0.6.2-4.dsc cd ~/usrc/gforth/gforth-0.6.2/ dpkg-buildpackage -us -uc -b -rfakeroot |& tee odb #* # (code-c-d "gforth" "~/usrc/gforth/gforth-0.6.2/" :grep) # (find-gforthfile "") # (find-gforthfile "odb") # (find-gforthfile "odb" "dlopen") # (find-gforthfile "fflib.fs") * (eepitch-shell) cd ~/usrc/gforth/ sudo dpkg -i *.deb * (eepitch-shell) cd ~/usrc/gforth/gforth-0.6.2/ ./gforth needs fflib.fs # (find-gforthgrep "grep -niH -e av-int *") # (find-gforthfile "prim") # (find-gforthfile "prim.b") # (find-gforthfile "prim" "av-int ( w -- )") # (find-gforthfile "prim.b" "av-int ( w -- )") # (find-gforthfile "prim" "\\+FFCALL") # (find-gforthfile "prim.b" "\\+FFCALL") # (find-gforthgrep "grep -niH -e FFCALL *") # (find-gforthfile "INSTALL" "install the ffcall libraries") # (find-gforthfile "configure") ##### # # ffcall from the debian sources # 2007mar02 # ##### # «ffcall-debian-source» (to ".ffcall-debian-source") # http://ftp.debian.org/debian/pool/main/f/ffcall/ # http://ftp.debian.org/debian/pool/main/f/ffcall/ffcall_1.10-2.dsc # http://ftp.debian.org/debian/pool/main/f/ffcall/ffcall_1.10-2.diff.gz # http://ftp.debian.org/debian/pool/main/f/ffcall/ffcall_1.10.orig.tar.gz #* rm -Rv ~/usrc/ffcall/ mkdir ~/usrc/ffcall/ cd $S/http/ftp.debian.org/debian/pool/main/f/ffcall/ cp -v ffcall_1.10* ~/usrc/ffcall/ cd ~/usrc/ffcall/ dpkg-source -sn -x ffcall_1.10-2.dsc cd ~/usrc/ffcall/ffcall-1.10/ dpkg-buildpackage -us -uc -b -rfakeroot |& tee odb #* # (code-c-d "ffcall" "~/usrc/ffcall/ffcall-1.10/") # (find-ffcallfile "") * (eepitch-shell) cd ~/usrc/ffcall sudo dpkg -i *.deb ##### # # fflib.fs # 2007mar04 # ##### # «fflib.fs» (to ".fflib.fs") * (eepitch-shell) # (find-node "(gforth)Invoking Gforth" "-e forth-code") gforth -e 'needs fflib.fs library libc libc.so bye' strace-to ~/s \ gforth -e 'needs fflib.fs library libc libc.so bye' # (find-fline "~/s") * (eepitch-gforth) needs fflib.fs library liblua /home/edrx/usrc/lua-5.1.1/src/liblua.so library libc libc.so.6 libc gets ptr (ptr) gets libc printf ptr (int) printf create string 80 chars allot string gets printf foo bar ##### # # gforth <-> lua using ffcall (by marc simpson) # 2007mar06 # ##### # «gforth-lua» (to ".gforth-lua") # lua_State *L = luaL_newstate(); # luaL_openlibs(L); # luaL_loadbuffer(L, buff, strlen(buff), "chunkname"); # lua_pcall(L, 0, 0, 0); # lua_close(L); * (eepitch-gforth) needs fflib.fs \ library liblua liblua.dylib library liblua /home/edrx/usrc/lua-5.1.1/src/liblua.so liblua lua-new-state (ptr) luaL_newstate liblua lua-open-libs ptr (void) luaL_openlibs liblua lua-load-buffer ptr ptr int ptr (int) luaL_loadbuffer liblua lua-pcall ptr int int int (int) lua_pcall liblua lua-close ptr (void) lua_close create lua-state 0 , : new-state ( -- state ) lua-new-state dup lua-state ! ; : close-current-state ( -- ) lua-state @ lua-close ; : pcall ( -- ) lua-state @ 0 0 0 lua-pcall drop ; : load-buffer ( state c-addr u -- ) 0 lua-load-buffer ; : load-to-current ( c-addr u -- ) lua-state @ -rot load-buffer ; new-state lua-open-libs : test-string s" print(2+3)" ; test-string load-to-current pcall close-current-state * (eepitch-gforth) : str<> compare 0<> ; : <<< parse-word save-mem begin refill while 0 parse 2over 2over str<> while type cr repeat 2drop then drop free throw ; <<< end-marker some text end-marker <ASau> http://www.jwdt.com/~paysan/httpd-en.html # Local Variables: # coding: utf-8-unix # End: