FTH Forth Scripting

Get FTH Forth Scripting at SourceForge.net. Fast, secure and Free Open Source software downloads

About FTH

Fth is a BSD licensed free software package which includes the interpreter fth and the extension library libfth. You can use Fth as a command line interpreter like Awk, Perl, or Ruby, you can write Forth scripts, use the repl for interactive input or you can link the libfth into an application using Fth as an extension language.

Fth's core language is Ficl, Forth-inspired command language, written by John Sadler . The manipulated Ficl source is included in Fth's source tree. The original Ficl source is slightly modified because of Fth' special needs.

Fth has the following ANS Forth labels:

Label Value Label Value
core yes core-ext yes
/counted-string 1024 /hold 1024
/pad 1024 address-unit-bits 8
floored no max-char 0xFF
max-n 0x7FFFFFFF max-u 0xFFFFFFFF
stack-cells 1024 return-stack-cells 1024
double no double-ext no
max-d 0x7FFFFFFFFFFFFFFF max-ud 0xFFFFFFFFFFFFFFFF
exception yes exception-ext yes
locals yes locals-ext yes
#locals 2048 memory-alloc yes
tools yes tools-ext no
file yes file-ext yes
floating yes floating-ext yes
floating-stack 0 max-float Infinity
search-order yes search-order-ext yes
wordlists 32

Fth' double word set doesn't eat two stack entries and the so called double word numbers are actually ficl2Integers.

The Fth library contains at most object type extensions, for example arrays, hashs, strings, regexp and others. A garbage collector handles the memory management of object types.

If you are new to Forth, a very good introduction to the programming language Forth can be found in the Gforth distribution. The description of the Gforth language fits generally to Ficl/Fth.

You can get the latest fth-1.2.9.tar.gz or fth-1.2.9.tar.bz2 from http://sourceforge.net/projects/fth/ . If you prefer anonymous CVS, the following example may show the way. The first time you have to checkout the whole source tree, but afterwards a CVS session is much simpler:

% mkdir ~/src
% cd ~/src
% cvs -z3 -d:pserver:anonymous@fth.cvs.sourceforge.net:/cvsroot/fth co -P fth

A new directory ~/src/fth now exists with a copy of the source tree of Fth. Later on, say, two days later, you have to type only

% cd ~/src/fth
% cvs update -P -d

The -P option means prune empyt directories and the -d option means create directories. One can write CVS options to ~/.cvsrc.

% cat ~/.cvsrc
update -Pd

So the commands above are reduced to

% cd ~/src/fth
% cvs update

Happy Forthing!

Web Hosting by SourceForge DNS Hosting by ZoneEdit Forth Programming Language Information

Email: Michael Scholz
SIP: *011-49-621-483-4621
Phone: +1-920-965-6373
Last modified: 12-Jan-2012 12:32AM CET