Edrx's page on Lua, Forth, and in-betweens

December, 2008: the Lua Gems book was
published (finally!8-), with my article
about "bootstrapping a Forth in 40 lines of Lua code" in it. The
bootstrap-ish Forth described in it, "MiniForth", is not really
usable, but Marc Simpson's RubyForth (e-scripts, ref) is, and my port of it to Lua (tests) is half-done.

I have not cleaned the rest of this page yet! There are still
some fossil parts in it - some 4 or 5 years old -, and most parts are
not dated...

People are discussing in the mailing list about creating a common stdlua.lua file that
we'd import with a dofile("stdlua.lua") command... I've
been using something like that in my programs: inc.lua. Be warned that it is ugly and changes very often.

The relevant code is in this GDB script: PP.gdb. Some functions
in it call global Lua functions - PP and PPeval - that are defined in my $LUA_INIT file.

The first GDB transcript below uses neither PP.gdb nor PP; the second one uses everything. The e-script that I used to
generate them is here, and here is a screenshot
of Emacs running it (click to enlarge):

an extra API function, dllua_open, that works as
lua_open but also loads all the standard
libraries, plus the bitops/regexps/loadlib libraries, into the
newly-created Lua_State.

Forth:

The Forth world has largely split into a pro-ANSForth
half (which is the bad half, so no links) and an anti-ANSForth
half, for which http://www.ultratechnology.com/ is a good
starting point. Other interesting links:

Forth-like languages interpreted on top of Lua:

An outdated project: Flua. It has access to the
standard C library and to extensions written in C
and in other languages (see jcw's project Minotaur). I'm
planning to use Flua for the computational part of my ideas
about skeletons of mathematical proofs, and for adding cLIeNUX-like extensions to the Hurd.

A follow-up to Flua: miniforth, and the bare
beginnings of a technical report on its
main ideas. It has the same goals as Flua, and it is much more
modular; the part that generates bytecodes for an inner
interpreter written in C is kept separate
from the rest.

Flua is the newest incarnation of the Crim project; see my
Forth page for some old docs, and my Crim page for some VERY old docs that may contain
some interesting things about the RSR words and the third
stack.

I gave a minicourse about Lua in 2004 (link?) and I'll give it
again (much updated, of couse!) at the beginning of October/2005, at
http://www.c3sl.ufpr.br/secomp/... Here is the current summary
(in Portuguese only, and still without links):