Google

PFE - The Portable Forth Environment


Welcome Forth User

The Portable Forth Environment (PFE) is based on the ANSI Standard for Forth. The PFE has been created by Dirk-Uwe Zoller and had been maintained up to the 0.9.x versions (1993-1995). Tektronix has adopted the PFE package in 1998 and made a number of extensions, in particular the PFE is now fully multi-threaded, so that a number of Forth Interpreters can run in the same address space. Due these changes the PFE is mostly incompatible on the C-source level with Dirk-Uwe Zoller's implementation somewhere from the 0.20.x versions on. The Forth-level is not affected though.

Another addition is the dynamic loading mechanism that allows the inclusion of extended functionality into the running Portable Forth Environment. These extension modules are written in the C language to obtain maximum speed as far as the processor's capabilities can be exploited by modern compiler technology.

The Forth Interpreter of the PFE is itself fully written in C, so it is very easy to port to new platforms, especially embedded processors. Forth-sources can be easily rewritten in C using the implementations of PFE so that time-critical sections can run at full processor speed. Even more, any external C-object functionality can be made available to the outer Forth Interpreter merily by providing a WordSet export-table that is loaded by the PFE.

The loading mechanisms does allow more than one wordset-table to be compiled into a single module-object which is then loaded at once. The PFE does itself consist of a number of such basic wordsets which often bear names as proposed by the ANSI Forth standard. Some of the PFE wordsets do not necessarily need to be initially compiled into the base-pfe object due to configure-time options. In most cases, the raw PFE does now not preload all the words as documented here, in particular the Floating wordset extensions are not used on many embedded platforms.

Most of the following documentation is generated automatically from the source files which contain a wordset export-table, the complete generated list of words and symbols can be found on seperated pages, being

and there's a Complete List of Available Wordsets as being automatically generated.

The Wordsets

  • The wordsets as proposed by the Ansi Standard on Forth are
    CORE contains the very basic words needed for forth operation
    BLOCK contains the words to handle the classic-style block-files of forth.
    FILE contains the words to handle the modern-style stream-files in forth.
    STRING contains words to affect string space in the dictionary.
    DOUBLE contains the words for double-cell arithmetics.
    FLOATING contains the words for floating-type arithmetics.
    SEARCH-ORDER contains the words to affect vocabularies and the search order as used to find words in the context wordlists.
    LOCALS extension to provide local-variables that are temporarily allocated on the return-stack for each word, much like the C-auto variables.
    EXCEPTION extension to provide exception semantics in forth.
    MEMORY words to interface to operating system's heap memory management.
    FACILITY some extra words to affect the system.
    TOOLS some extra words to affect compilation.

  • The additional wordsets provided by the Portable Forth Environment are
    FORTH-83 commonly known words as they had been available in the Forth-83 standard.
    FORTH-83-L&P commonly known words as they had been available in many implementations of the Forth-83 standard, especially the Laxen&Perry implementation.
    PFE-MISC more words as being commonly known in the forth world.
    PFE-DEBUG the internal debugger and decompiler for PFE.
    PFE-SHELL interface to the surrounding OS so that the PFE can partially replace the OS shell.
    PFE-SIG interface to the surrounding OS POSIX-signal system that can catch traps.
    PFE-SYSTEM interface to the surrounding OS lib- and env- system.
    PFE-TERM the interface words to control the attached terminal of the PFE.
    PFE-SMART additional words that need to be compiled into the base PFE to get them working smart.
    EDIT the internal block-editor of PFE, usually compiled as an external module.

Usage Information

The PFE can be compiled as a binary that accepts a set of options. See the unx-manpage (pfe(1)) for details on the matter.

Starting it from a shell should prompt you with the forth's outer interpreter that you can talk to .

The ANS Forth defines a set of ambiguous conditions amongst ANS Forth compatible implementations which must be documented. (requirements)

In any case, you should read some documentation that encompasses the ANSI Forth Standard, e.g.
the Draft Proposal for ANSI Forth (dpans).

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

The complete License should come with the distribution archive (COPYING.LIB) or look for the latest version at the FSF website. The HTML-version of the LGPL-License can also be obtained from OpenSource.org.

As with all free software, there are no warranties for use cases that the copyright holders have not given an explicit liability. The distributor of the program should give you more information about support options to pay for.

The program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.