On This Page
This material was written for publication in ACM's monthly SIGPLAN notices, Dec 2000.
Author: Chris Jakeman
FIG UK is the UK chapter of the Forth Interest Group, a not-for-profit organisation promoting the Forth computer language originally developed by Charles Moore for his personal use in 1968. This article reports the current status of Forth, its use in the UK and the role of FIG UK.
For every PC on the planet there are 60-70 processors working in embedded systems to control videos, central heating or windscreen wipers. For example, when Federal Express drivers deliver a package, you sign for it not on paper but on a custom PDA. This is a package-tracking device with bar-code scanner, keyboard, display, comms. ports and about 2 Mb of databases for packages, postal codes, etc.. FedEx have been using this since 1986, enhancing it over several generations of processor. The programming for this product is an example of Forth in action.
Another example of the good match between Forth and controller hardware is the ease with which Forth can be ported to a brand new controller board. Forth runs on over 100 processors (including radiation-hardened ones used in space) and prices for a commercial port are just £500 ($740)1.
Forth takes programming to extremes, dispensing with most of the baggage deemed essential in other languages. The syntax is so simple it can be described in one short sentence, "Forth words are separated by spaces and executed from left to right." Forth practitioners agree that the overriding concern is to "keep it simple".
This ruthless approach brings interesting benefits which are greatest in the area for which Forth was developed - embedded systems.
The key advantages are: factoring, interactive development and Forth's extensible compiler described here in more detail.
Forth enjoyed a wave of popularity in the early days of micro-computers among programmers who found that it was much faster than BASIC. It's portability was the key to some significant use in early applications such as the very first word processor on the IBM PC - EasyWriter. Commercial Forths now sport high-performance native code compilers which retain all of Forth's advantages. The compiler currently delivering the highest performance code (using VFX technology) is a UK product and a match for the very best that C compilers can offer. (see here for benchmarks).
Forth is now an international standard2, initially ANS Forth (1994) and subsequently accepted by ISO.
Open Firmware3 is another international standard which uses Forth to provide the "plug and play" architecture in all PowerPC computers shipped by Apple4, Sun5 and IBM. The real magic is that you can interrupt the boot process, preventing the operating system from booting, at which time you're in Forth and you can use Forth's interactivity to diagnose hardware or other problems. Sun realised they could bring up new systems and peripherals much faster this way.
Forth has kept pace with other developments in computing. Commercial products make good use of Windows for the development platform and deliver the unique "umbilical Forth" remote development.
Smart-cards benefit more than most from Forth. Working in conjunction with Europay International (Europe's largest financial services company) and Forth Inc., UK company MPE Ltd. designed the Open Terminal Architecture, a token (byte-code) technology supporting portable smart-card applications on Point-of-Sale terminals. It was implemented on a dozen or so different types of terminal, is in increasing use in Europe and has recently become an ISO standard .
As a comparison with Java, a very small Forth-based kernel was implemented on an 8051-based smart-card also for Europay. This system benchmarked 10 times faster6 than rival Java-card prototypes, and offered significantly more functionality.
In the Unix world, the GNU free software compiler gcc has made a substantial difference to people writing or using C compilers. The GNU project now boasts the Gforth development system alongside gcc. Gforth is a high-quality collaborative effort conforming to the ISO standard and delivering code of good performance on a variety of platforms.
The UK has a number of companies using Forth to serve the embedded systems market. Embedded applications for clients include ISDN routers, TCP/IP stacks, exposure systems7 for 70% of European newspaper plates and desktop applications include construction software used for planning projects like Hong Kong's Chai Tak airport.
It's used from the serious to the frivolous, from nuclear hot environments and safety-critical systems on London Underground to the UK's largest supplier of fruit machines.
The annual euroFORTH conference is hosted in the UK on alternate years and provides a forum for academics and developers alike. Academic research in this country is currently under way at Bournemouth and Teeside Universities.
As the UK chapter of the Forth Interest Group, we celebrated our 20th anniversary last November and currently support over 100 members with a healthy mix of professionals and amateurs. We draw members from a growing number of other countries and have run several multi-national projects.
FIG was crucial in promoting Forth by disseminating free source long before the Internet and the Open Source movement. FIG UK has continued to support this activity, nowadays taking advantage of the low-cost and wide reach of the Internet. Whilst the main archive of Forth code resides at the International FIG web site, the UK web site has introduced a number of innovations.
These include a regular issue of national and international Forth News, the first Forth magazine to be published and indexed on-line (Forthwrite ISSN 0265-5195), links to UK training providers and the only regular Forth chat session, held monthly, which attracts callers from Europe and beyond.
A valuable non-Internet resource is the lending library for books, magazines and conference proceedings. FIG UK also provides a service matching members with Forth projects and jobs.
Chris Jakeman deserted mechanical engineering for software before the IBM PC made micro-computers respectable.
He is currently editor of FIG UK's Forthwrite magazine and specialises in scheduling software for the process industry.
What is the outlook for Forth in the UK? Forth users are more self-sufficient than users of other languages and the small Forth industry which delivers quality products is sufficient to enable them to keep up-to-date and continue to reap the benefits. However Forth has largely escaped the attention of academics and it is a shame that so few entering the profession are aware of the unique Forth approach.
Nowadays, the biggest obstacle to using Forth is the shortage of programmers with Forth experience. The key activity for FIG UK is therefore educational - finding new ways to present Forth so that potential users can readily get to grips with it and judge its benefits for themselves. Two projects already under way address this issue:
Forth is too different to appeal to the mainstream of programmers and will continue to be so. However those with an open mind will find Forth's distinctive approach not only fascinating but a remarkably productive tool in the ever-expanding world of embedded computers.
1 Porting costs from S.Pelc, MD of MPE Ltd.
2 Forth: ISO Standard ISO/IEC 15145:1977
3 Open Firmware standard IEEE 1275 since 1994
4 Open Firmware used by Apple on Macs since 1995
5 Open Firmware used by Sun from the SPARCStation 1 in 1989
6 Smart card comparison reported by E.Rather, MD of Forth Inc.
7 Exposure systems reported by S.Pelc, MD of MPE Ltd.