Skip to content
/ frth Public
forked from frno7/frth

Frth is a subroutine threaded Forth system written in Forth itself for the targets x86, x64 and 68k on Linux and macOS among others.

License

Notifications You must be signed in to change notification settings

dfischer/frth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frth

Frth is a subroutine threaded Forth system written in Forth itself for the targets x86, x64 and 68k on Linux, macOS, Atari ST and Amiga 500. All targets are self-relocating and can therefore load into memory at any address.

Targets

System Processor
Linux x86, x64
macOS x86, x64
Atari ST 68k
Amiga 500 68k

Options

Usage: frth [option]... [input]...

Options:

  --help                   Display this help and exit.
  -v, --verbose            Print verbously.
  -e, --evaluate <expr>    Evaluate Forth expression.
  -t, --target <target>    Compile for given target.
  -o, --output <file>      Compile to output image.

Compiling to an output image requires a target. Providing a target
without giving an output image has no effect. Valid targets are:

  linux/x64 linux/x86
  macos/x64 macos/x86
  atari/68k amiga/68k

Compiling

Since Frth is written in Forth, another Forth system, for example Gforth, is needed to compile Frth the first time. Once Frth has been compiled, it can recompile or cross-compile itself for any target. To compile Frth for Linux/x64 one can for example do

% gforth -e "fpath+ $PWD" contrib/gforth.fth -e bye -- -o frth-linux-x64 --target linux/x64

where the arguments after -- are forwarded to the Frth emulation. After this first compilation Frth can recompile itself, for example to macOS/x64:

% ./frth-linux-x64 -o frth-macos-x64 --target macos/x64

Testing

There is a test suite with 460 tests, many of them based on the Forth 2012 Standard. These can be run by giving test/test.fth as a command input argument, or by giving include test/test.fth at the Forth prompt.

Licence

Copyright © 2017 Fredrik Noring. See the LICENCE file.

About

Frth is a subroutine threaded Forth system written in Forth itself for the targets x86, x64 and 68k on Linux and macOS among others.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Forth 100.0%