Gforth

A free, fast, featureful and portable implementation of the Forth 2012 language.

\ a comment followed by the shortest quine
source type

\ another shorty, hello world looks like that
." hello world"

\ tell me, what else can we do? ask the system itself!
words \ this will yield all defined words

Download / Install

0.7.3 (Latest release)

Bleeding Edge snapshot

Build from Tarball

wget https://www.complang.tuwien.ac.at/forth/gforth/Snapshots/current/gforth.tar.xz
tar xvfJ gforth.tar.xz
cd gforth-*
./install-deps.sh
./configure
make
sudo make install

Build from Git repository

git clone https://git.savannah.gnu.org/git/gforth/
cd gforth
./install-deps.sh
./autogen.sh
./configure
make
sudo make install

See INSTALL.md for further details

Debian

  1. If you don't have https transport for apt installed, do that first, since I'll redirect you to https in any case:
    sudo apt install apt-transport-https wget
  2. Make yourself root:
    sudo -s
  3. Obtain the key:
    wget -O /usr/share/keyrings/net2o-archive-keyring.gpg https://net2o.de/net2o-archive-keyring.gpg
  4. Create a one-line file for the repo: Set version to either oldstable/stable/testing/unstable, whatever fits your Debian:
    version=testing
    cat >/etc/apt/sources.list.d/net2o.list <<EOF
    deb [signed-by=/usr/share/keyrings/net2o-archive-keyring.gpg] https://net2o.de/debian $version main
    EOF
  5. And then fetch the repository and install
    apt update
    apt install gforth-minos2
  6. Leave root
    exit

OpenSuSE

  1. Add repository:zypper addrepo https://download.opensuse.org/repositories/home:forthy/openSUSE_Tumbleweed/home:forthy.repo
  2. Refresh:zypper refresh
  3. Install:zypper install gforth

Flatpak

  1. Add remote:
    flatpak remote-add --if-not-exists net2o https://flathub.net2o.net/repo/net2o.flatpakrepo
  2. Install:
    flatpak install org.gforth.gforth
  3. Since Flatpaks manage access to external resources, you want the following two aliases, one for terminal applications, the other if you use MINOS2 GUI applications:
    alias gforth="flatpak run --filesystem=$PWD org.gforth.gforth"
    alias gforth-gui="flatpak run --socket=x11 --device=dri --socket=pulseaudio --filesystem=$PWD org.gforth.gforth"

Snap

  1. Install:sudo snap install gforth

Docker / Podman

  1. Run:docker run -it --rm forthy42/gforth
    or
    podman run -it --rm forthy42/gforth
  2. Like Flatpak, you want aliases to run it with the necessary permissions:
    alias gforthdk="docker run -ti --rm forthy42/gforth"
    alias gforth-guidk="docker run -ti -e USER=$USER -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v /dev/dri:/dev/dri -v /usr/share/fonts:/usr/share/fonts -v $XAUTHORITY:/home/gforth/.Xauthority -v ${XDG_RUNTIME_DIR}/pulse:/run/user/1000/pulse --rm forthy42/gforth-gui"
    alias gforth-gui-fontsdk="docker run -ti -e USER=$USER -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v /dev/dri:/dev/dri -v $XAUTHORITY:/home/gforth/.Xauthority -v ${XDG_RUNTIME_DIR}/pulse:/run/user/1000/pulse --rm forthy42/gforth-gui-fonts"

Supported systems

Gforth runs under GNU, BSD, and similar systems, MS Windows and MacOS X and should not be hard to port to other systems supported by GCC. Version 0.7.9_20160714 has been tested successfully on the following platforms:

GNU/Linux

amd64
arm64
armel
armhf
i386
mips
mipsel
powerpc

Android/Linux

Gforth on Android

amd64
arm64
arm
i386
mips

Gforth EC(embedded)

r8c
4stack
misc
8086

Windows

amd64
i386

MacOS

amd64
i386

Contact

gforth@gnu.org

Mailing List

comp.lang.forth

Ancient, yet highly active news group.

Authors

  • Anton Ertl Project initiator, C based primitives, locals, gray, manual, Release manager, GNU maintainer
  • Bernd Paysan Project leader, kernel, cross compiler, non-Unix ports based on GCC, Release manager, GNU maintainer
  • Gerald Wodni SWIG module for C libraries
  • David Kühling Emacs integration
  • Jens Wilke Embedded Control versions (non-gcc), decompiler, cross compiler refinement
  • Neal Crook manual, glossary entries