A Development Environment for Forth

I believe that Forth like any other programming language benefits from a well organised project development environment.

This article is a work in progress because although my own forth development environment is mostly finished and does pretty much what I want, it’s going to take a while to describe it here.

Essential

This is a list of all the attributes I consider essential in any development environment, not just forth

> FAST project creation

When I start a new project, I create its directory then run a project builder shell script. The new project directory will then be populated with the sub-directories, templates, shell scripts and files, I typically use in all my projects. The scriopt is finished instantly and I can begin coding.

  • Code Versioning System: set up and running, with the initial project files already committed. I use Fossil for this.
  • Schematic Capture: with a various templates ready for me to begin testing and documenting. Usually I start with a STM32F0 Discovery Board, so that’s my main schematic template. gEDA is what I use.
  • Directories: ready to receive files as I create them, i.e. pdf, flowchart, pics, text, misc
  • A library symlink to my versioned STM32F Mecrisp-Stellaris library so I can pull them in as needed
  • Sphinx Documentation system: (Sphinx is used to create this site) ready to start adding documents.
  • e4thcom Serial Terminal: which automatically opens in the new project directory.
  • Editor: which will open with several files, pre-created and pre-named by the project builder shell script. I use Gvim.
  • Svd2forth files to suit the MCU. These are used to generate Memory Mapped Register words and preloaded before the actual project files.
  • Finally, a MurderDeathKill shell script that will remove every project file, the Fossil repository and finally the project directory itself. This has a “are you sure” confirmation before proceeding. Once a project is underway and I’m happy with it, I may manually delete the MurderDeathKill shell script just to be on the safe side. It’s saved in the Fossil Code Repo anyway if I need it later.

The project builder shell script also refuses to dump all these files into a non-empty directory.

Demo-Project Directory Listing

This is a new demo-project directory listing after running the project builder shell script.
demo-project%
  .
 |-- [-rw-r--r-- 1001]  demo-project.fs
 |-- [-rw-r--r--  34K]  demo-project.memmap.fs
 |-- [-rw-r--r-- 1.1K]  demo-project.preload.fs
 |-- [-rw-r--r--    0]  demo-project.txt
 |-- [-rwxr-xr-x   69]  e4thcom.sh
 |-- [-rwxr-xr-x  135]  edit-all-files-demo-project.sh
 |-- [-rwxr-xr-x   39]  edit-demo-project.preload.sh
 |-- [-rwxr-xr-x   47]  edit-demo-project.sch.sh
 |-- [-rwxr-xr-x   31]  edit-demo-project.sh
 |-- [-rwxr-xr-x   44]  edit-README-demo-project.sh
 |-- [-rwxr-xr-x   28]  edit-template.xml.sh
 |-- [drwxr-xr-x    2]  flowcharts
 |-- [-rw-r--r-- 4.9K]  gafrc
 |-- [drwxr-xr-x   85]  lib
 |-- [-rw-r--r--  34K]  m
 |-- [-rw-r--r-- 1.7K]  Makefile
 |-- [drwxr-xr-x    2]  misc-files
 |-- [-rw-r--r--  860]  mk.template.xsl
 |-- [-rw-r--r-- 1001]  p
 |-- [drwxr-xr-x    2]  pdf
 |-- [drwxr-xr-x    2]  pics
 |-- [-rw-r--r--  123]  README-demo-project.txt
 |-- [-rw-r--r-- 240K]  registers.text
 |-- [-rw-r--r-- 5.5K]  registers.xsl
 |-- [-rwxr-xr-x  112]  rpi-ssh.sh
 |-- [drwxr-xr-x    3]  schematics
 |-- [drwxr-xr-x    2]  sphinx
 |-- [-rw-r--r--  220]  STM32F051K8.txt
 |-- [-rw-r--r-- 574K]  STM32F0xx.svd
 |-- [-rw-r--r-- 851K]  STM32F0xx.svd.uf.svd
 |-- [-rw-r--r-- 4.5K]  svdcutter.xsl
 |-- [-rw-r--r-- 1.2K]  svduf.xsl
 |-- [-rw-r--r-- 1.8K]  template.xml
 |-- [drwxr-xr-x    2]  text
 `-- [-rwxr-xr-x  512]  zMurderDeathKill-demo-project.fossil.sh

 8 directories, 27 files

Project Builder Shell Script

Not quite ready for release yet.

Table Of Contents

Previous topic

Svd2forth-v2

Next topic

Development Tips

This Page