Practical and Theoretical Aspects of
Forth Software Development

Peter J. Knaggs


Due to the number of requests I have had regarding my Ph.D. thesis, I have made it available for download.

All files are avaliable in both PostScript (.ps) and Adobe Portable Document Format (.pdf). [Get Acrobat Reader] The thesis has been splint into its individual chapters to assist in downloading the relivent parts of the document. The full document is also available if you want to download the full document (all 1 Meg of it). All documents have been re-processed to print on both American and European (A4) paper. It should be noted that as a consequence of this reformatting, the page numbering is not consistant between the two versions.

Where relivent the individual chapter contains its own "references" section, while the full verion contains a full Bibliography.


The thesis is available in full [PDF (900K)] or as individual chapters. Simply select the chapter/appendix title to download the file.
  1. Overview [PDF (151K)]
    1. Introduction
    2. Equipment
    3. Forth
    4. The Novix NC4000 Forth Engine
    5. The Harris RTX-2000 Forth Engine
    6. Networks
    7. Mixed Languages Interface
    8. Formal Methods
      1. Formal Forth
      2. Type Algebra
      3. The Event Calculus

  2. Using IBM's NetBios [PDF (209K)]
    1. Introduction
    2. Functions
      1. Naming
      2. Sessions
      3. Datagrams
      4. Broadcasting
      5. House keeping
    3. Invoking NetBios Functions
    4. Multi-Tasking
    5. Examples
      1. Block Transfer
      2. Net-Chat
    6. Problems
      1. PolyForth
      2. Interrupts
      3. Porting
    7. Comparison with C interface
    8. Interface Code
      1. Error Handler
      2. Network Control Block
      3. Assembler Interface
      4. Low-Level interface
      5. General Support
      6. Naming Support
      7. Session Support
      8. Datagram Support
      9. Broadcast Support
    9. The "Net-Chat" Application
      1. Memory Buffers
      2. Listening
      3. Sending
      4. Initialisation
      5. Close Down

  3. Mixed Languages interface [PDF (87K)]
    1. Principles
    2. Argument Passing
    3. Programming
    4. The C Heap
    5. Organisation
    6. Generalisation

  4. Formal Forth [PDF (134K)]
    1. Introduction
    2. The Forth Toolbox
    3. The Basic Model
    4. Word Definitions
    5. Immediate Words
    6. Storage Units
    7. Stacks
    8. Code Definitions
    9. Wordlists
    10. Defining words
      1. High-Level words
      2. Immediate words
      3. Code words
    11. Dictionary Searching

  5. Stack Optimisation [PDF (174K)]
    1. Introduction
    2. Code Generation
    3. Inline Compilation
    4. Peep-Hole Optimisation
      1. Conditionals
    5. Registers
    6. Optimisation using a Stack image
      1. Argument Passing
      2. Conditional execution
      3. Looping structures

  6. The Cell Type [PDF (147K)]
    1. Introduction
    2. Stack Types
    3. Notation
    4. Rules
      1. Composition Rules
      2. Reduction Rules
      3. Wildcard Rules
    5. Simple Examples
    6. Multiple Signatures
    7. Pass by reference
    8. Control Structures
    9. Casting
    10. Strong vs Weak Typing
      1. Strong Typing
      2. Weak Typing

  7. A Forth Type Checker [PDF (166K)]
    1. Invocation
    2. Stack Notation
    3. Commands
      1. Classes
      2. Type Command
      3. Stack Command
      4. Assume Command
      5. Assert Command
      6. Syntax Command
    4. Variable Stack Items
      1. Or - |
      2. Alternative descriptions - +
    5. Flow Control
    6. Defining words
      1. Pre-defined
      2. User-defined
    7. Vocabularies
    8. Error Log
      1. Error report
      2. Verbose reports
      3. Statistics
      4. Statistics flag
    9. Problems

  8. The Event Calculus [PDF (270K)]
    1. Introduction
    2. State Machines
    3. The Formal Model
    4. An Algebra of machine behaviours
    5. Labelled Transitions
    6. Simple Examples
      1. The specification of mutual exclusion (without fairness)
      2. Asynchronous Events
      3. Value passing
      4. Mutual Exclusion with fairness
    7. A GCD algorithm, modelling parameter passing and procedure call
    8. Variables and Scopes
    9. Time
    10. The Dynamic model
    11. Combining the Event Calculus with Z schema calculus
    12. A Distributed seat booking system

  9. Conclusions and Recommendations [PDF (117K)]
    1. Introduction
    2. Networks
    3. Mixed Languages Interface
    4. Formal Forth
    5. Stack Optimisation
    6. Type Algebra
    7. Forth Type Checker
    8. The Event Calculus
    9. Future Directions
      1. Type Algebra
      2. Formal Forth
      3. Event Calculus
  1. Communicating Novix NC4016s [PDF (172K)]
    1. Introduction
    2. Programming
      1. cmForth
      2. SCForth
      3. PolyForth
      4. FATWIN
    3. Single Boards
    4. Host Services
    5. Parallel Boards
      1. First Method
      2. Second Method
      3. Comparison
    6. Communicating Systems
      1. Hardware Restrictions
      2. Communication
    7. Code
      1. Multiple Boards "Boot" code
      2. First attempt at providing Host Services
      3. Revised Boot and Host code

  2. Forth++ and the MACH1 [PDF (167K)]
    1. The MACH1
    2. The MACH2
    3. Forth++
      1. Memory Organisation
      2. Multi-Tasking and Windows
      3. Argument Records
    4. The Multi-Processor Forth Interpreter
      1. The Users View
      2. Implementation Notes
    5. Code Optimisation
    6. Graphics

  3. Mixed Languages Interface: Source Code [PDF (160K)]
    1. Loader
    2. Making the loader
    3. Overlay initialisation
    4. Context Switching
    5. Stack access
    6. User code
    7. Making the C Overlay

  4. Published Papers
    1. The Forth++ C interface
    2. Forth++ and the MACH1 RTX-2000 board
    3. The Cell Type
    4. Formal Forth
    5. Type inference in stack based languages
    6. The Event Calculus: Formal Specification of Real Time Systems by means of Diagrams and Z Schemas

[ Peter's Home page | Forth Research page ]
C makes you think that C is the world's greatest language.
Forth makes you think that you're the world's greatest programmer.