FROM THE U.S.A. call 901-313-4312
UK time is now:

Search Results : benchmark » mpe - MicroProcessor Engineering

Downloads

 

Last updated 7 March 2022


VFX Forth downloads
Cross compiler downloads
Forth-related Papers, VFX Forth benchmark code

Syntax colouring files for Forth


UltraEdit:

Mark Corbin has written Forth syntax highlighters for gedit, jEdit, UltraEdit and Kate. They should be part of their respective packages; if not, they are available from:

Forth-Related Papers


Book: Programming Forth

Book: ProgramForth.pdf.

VFX Forth

    • Integer benchmark code: benchmrk.fth.
    • Floating point benchmark code: mm.fth.
    • VFX Forth Code Generator – a paper from EuroForth 1998 about the objectives of the VFX Forth code generator. PDF File: VFXgen.pdf.
    • Inside the VFX Forth Code Generator – presented at EuroForth 2000. This is a brief description of the VFX code generator, its objectives and implementation at that time. Note that the email address and website URL have changed since the paper was written in 2000. PDF File: InsideVFX.PDF.
    • VFX Forth for ARM Linux – a paper from EuroForth 2014 about porting VFX from x86 to ARM and the impact on the code base. PDF File: VfxArmLinux.pdf.
    • SQLite3 interface by Rafael Gonzalez Fuentetaja with a manual. This is derived from Nick Nelson’s interface to MySQL described in his EuroForth paper “The Nearly Invisible database or ForthQL” at the the 22nd EuroForth conference.
      ZIP File: ForthQL interface.

Forth200x Draft proposals and discussion


Forth 200x draft documents and proposals can be found at the Forth200x web site. This section contains draft proposals that have not yet been submitted to the Forth 200x process.

Special words in Forth

  • PDF file: Special words.
    Stephen’s attempt to explain compilation under Forth 2012 to himself and to
    others.

Internationalisation

Updated July 2018

  • PDF file: i18n.propose.v9.pdf. This is the draft Forth 2012 proposal for internationalisation. Text macro substitution is now a part of the Forth 200x document.
  • Forth source code: i18n.v9.fth. This is a sample implementation of the Forth 2012 internationalisation proposal for VFX Forth.

Octets and memory access

  • Text file: octets.txt.
    Greg Bailey’s discussion and proposal for handling octets.
  • Text file: memory-20160809.txt. One of the current memory access proposals; favoured by MPE.
    It will probably become a standard library.
  • Text file: memory-paysan-20160808.txt. The other current memory access proposals.
    It will probably become a standard library.

Cross Compilation

The text in these proposals was authored by Elizabeth Rather of Forth Inc. These proposals are the result of discussions between staff of MPE and FI in front of whiteboards (and beers).

Modern Forth and Extreme Forth

Originally written by Stephen Pelc for Dr Dobbs Journal in 2008, these articles are slightly updated and published here in PDF format:

Requests for Comment or Quotation


These are for projects we think would be useful, are too busy or too mean to do ourselves, or are outside our current skill set e.g. too theoretical or academic.

FLint is a tool to provide type and stack checking to existing code rather as Lint does for C sources. Download the draft specification flintspec.pdf

C to Forth Compiler: This is a complete C to Forth compiler with sources. It is an MPE research project which we believe will grow better as a Forth community project. The project is dual-licensed. Non-commercial use is free of charge. For commercial use you must buy a commercial license.

V1.20 has been tested on Windows XP and Windows 7/64. The documentation has been overhauled. Sample build scripts for Windows are provided.

Forth 7 Cross Compilers

 

VFX Forth logo
Performance through simplicity

Last update: 9 April 2020
licence
downloads
shop and support

All compilers have PowerNet, file system and USB.

ARM/Cortex includes Sockpuppet interface to C.

more

ARM/Cortex has hardware floating point support for Cortex-M4F, Cortex-M7 and ARM.

Segger J-Link integration for ARM/Cortex

More ….

Interactive Compilation, Debug and Test

MPE Forth 7 cross compilers are tools with a wide range of features designed to emphasise rapid production of embedded systems. They are available in Windows, Linux and Mac OS X versions. They all feature fast compilation, interactive debug and test even for single chip targets, and on-line source management. Forth 7 compilers have the features described below.

  • Only one download for full version with source
  • Available for Windows, Mac OS X and Linux x86/x86_64
  • VFX code generator
  • USB virtual serial port (CDC) and memory stick (MSC) drivers
  • FAT file system (FAT-12/16/32)
  • PowerView embedded GUI
  • PowerNet TCP/IP stack

 

 xcomps8b

Features

System Requirements

Windows 7/8/10, Linux or Mac OS X. The Windows compilers will probably work under XP SP3 and Vista, but we cannot guarantee this.

Documentation

  • Forth 7 manual
  • CPU/Target-specific manual
  • AIDE Cross compiler shell manual
  • On-line help files
  • Forth ANS Specification

The full Forth 7 cross compiler manual is available for download from here. CPU and target manuals are available on request.

Support Services

  • Technical support via forum, email and telephone
  • Support level depends on the subscription level.

 

licence
downloads
shop and support

On this page:
Versions
Cross compiler features
Target features
Target CPU list

Forth 7 Cross Compiler

For the release notes, see here.

Compilers are available in four subscription levels, Basic, Standard, Professional, and Ultimate. Basic compilers may not be used commercially but are free of charge.

For MSP430 and ARM Cortex targets a lightweight Lite kernel for direct compilation to Flash is also supplied. The Forth Lite kernel may be incompatible with the normal ROM PowerForth kernel. See the Lite compiler page for more details.

All
VFX code generator Y
All target code in source form Y
Full-featured standalone PowerForth target Y
Small standalone Lite target ARM/Cortex and MSP430
Umbilical target Y
Multi-tasking Y
Cross reference tools Y
Unlimited code size Y
State machine compiler Y
Floating point math Y
Bank-switched targets Y
PID loops Y
Target source Y
Compiler source Y
32 bit targets
PowerFiler Unix-like file system Y
PID loops Y
FAT 12/16/32 file system, SD/MMC Y
USB driver, core and classes Y
PowerView embedded GUI Y
PowerNet TCP/IP stack Y

Compiler Features

AIDE


AIDE is currently only available for Windows. The AIDE front end integrates a number of useful tools as standard:

  • ForthEd2 multi-file editor
    compiler can LOCATE to ForthEd2 or external editor.
  • PowerTerm teminal emulator for serial communications
    includes multiple independently addressable console windows for debugging multitasked applications.
  • Tool Capture window
    Displays compiler progress and results.
  • Text macro system for build management
    Eases multiple product versions and moving code.
  • Image converter
    Bitmap to LCD panel format conversions
  • Users can add additional tools at any time using the tool configuration system.

 

AIDE is entirely written in Forth and full source code is delivered.
AIDE compiler

Fast Compilation


The cross compilers are native VFX Forth applications that use a fast symbol search system for optimum performance and features. For large applications, we regularly find that the compiler can generate 500kb/second or more of binary. In the main, compilation speed is limited by disk performance.

Standalone Forth


Forth was designed as an interactive language, which is one reason why Forth permits embedded systems to be constructed and debugged very rapidly. Many designers like to retain that facility on their targets, so MPE compilers permit you to do this. The standalone target contains a complete Forth compiler and interpreter which can be used for debugging, and can also be used for communications, runtime configuration scripts, remote monitoring and even for accepting software updates in the field.

Umbilical Forth


Where memory is at a premium, use the Umbilical Forth option. The normal Forth interactivity is retained, but is provided by the cross compiler, so avoiding the need for the full Forth compiler and interpreter on the target. This reduces the memory requirements of a fully interactive Forth to about 2k bytes for 8 and 16 bit CPUs. In this mode all the host tools are available as if on the target, making Umbilical Forth ideal for single chip target development.

VFX Code Generator


Compilers for suitable target CPUs use MPE’s VFX optimising code generator, which provides excellent code quality and code density. The VFX technology eliminates redundant memory moves caused by stack manipulations, and merges many common Forth operations. As well as Forth-specific techniques, VFX code generators include standard compiler techniques common in other languages. Inlining of procedures below a user definable size is also supported.

The VFX code generator produces code that is between 5 and 15 times faster than traditional Forth direct threaded code, somewhat dependent of course on the CPU architecture. We have not written an interrupt routine in assembler for many years! A separate paper is available that has figures for several benchmarks. The MPE cross compiler benchmark code may also be downloaded (approx 40kb).

VFX compilers also include a disassembler that is very useful for checking code generation efficiency, and for making performance analyses and decisions.

Source Management


The cross compiler provides facilities enabling you to see the source code of any target word at any time, and to find out where it is used in the code. Typing LOCATE <name> will display the source code for that word or put you in an editor at the start of the definition. XREF <name> will give you a list of all the words that use <name> – a cross-reference. XREF-ALL cross references all the words you have defined, whereas XREF-UNUSED produces a list of any words that have been defined but are unused.

If you have to build several versions of a project, use the text macro facilities built into AIDE and the cross compilers. These allow you to change directories, file names and text globally within a project.

When you have a substantial project, you can use the DocGen system to produce code manuals for your project. For safety-critical applications, DocGen/SC can be used to integrate documentation and test code in a form suitable for FDA approval. Contact the MPE office for more details of DocGen/SC.

Integrated Assembler


All compilers include an integrated cross assembler. There is no need to place assembly code in separate files. The assemblers are fast, easy to use, and are fully integrated into the cross compiler. The assemblers support macros, conditional structures, named labels with forward referencing and local labels.

A disassembler within the cross compiler allows you to inspect the generated code.

Library Files With Multi-Pass Reference Resolution


Library files are source files that can be scanned at the end of compilation. If a procedure in a library file satisfies a forward reference, the procedure is compiled and the reference resolved. A group of library files is scanned until no more references can be resolved.

This procedure allows you to minimise the size of your code by only including words if they are actually needed.

User Definable Communications Links And Memory Drivers


For Umbilical Forth development, the compiler needs a communications link to the target. The protocol for this link has been factored in such a way that you can add your own drivers to the compiler.

The compilers provide output of memory   SECTIONs to files or to memory drivers, the most common of which is a Flash or EPROM emulator driver. You can add your own memory drivers if you need to, for example to drive a JTAG programmer or in-circuit emulator. Output file formats are binary, Intel Hex (16 or 32 bit), Motorola S19/28/37 and ELF.

Flexible Target Memory Management


As microcontrollers gain more peripheral blocks and mixes of on-chip memory, efficient applications must make best use of these areas. The compilers allow you to define any number of areas of memory called SECTIONs, which may be for code (CDATA), memory that is initialised at power up (IDATA), or uninitialised memory (UDATA).

$0000 $7FFF CDATA SECTION UE31
$8000 $9FFF IDATA SECTION UE31I
$C000 $DFFF UDATA SECTION UE31U
$F000 $FFFF UDATA SECTION EEPROM

Targets that require more memory than the CPU normally addresses, for example when a 9S12/68HC12 or 8051 needs to access more than 64k bytes of memory, can define banks of memory that are split into pages.

$A000 $BFFF CDATA BANK ROMBANK
  1 PAGES ROMB1
  2 PAGES ROMB2
  …

$E000 $EFFF UDATA BANK RAMBANK
  $100 PAGES RAMB1
  $200 PAGES RAMB2
  …

The flexible and efficient memory definition scheme provides complete control of target memory.

Target Features

Standard Hardware Configurations


Each compiler comes complete with configuration files for one or more commercially available hardware systems such as manufacturers’ evaluation boards or MPE’s own hardware products. Configuration for custom hardware is usually just a matter of redefining the memory map of the processor.

If you want the easiest possible start up route, MPE has a hardware porting service that will configure the compiler for your own hardware and will supply you with a tested configuration file.

Supported ARM and Cortex boards.

Multitasking


The fast and efficient MPE multitasker provides the usual task management facilities, including semaphores, interprocess messaging and event handling.

TIMEBASE time and delay management system


Using a single periodic clock interrupt, you can generate delays, wake/suspend tasks, timeouts and periodic execution very simply, using phrases such as:

  ' <action> <ms> AFTER  \ once after <ms> ms
  ' <action> <ms> EVERY  \ every <ms> ms

 

Timers can be cancelled at any time.

Floating Point


All targets are supported by software floating point packs with full trig support. With the release of the Forth-2012 standard, new packs are available for 32 bit targets. The existing code is still available for both 16 and 32 bit targets.

Some targets, e.g. ARM and Cortex-M4, which have IEEE F.P. support in hardware also contain floating point packs for the floating point instructions. Hardware floating point packs are only provided with the Professional versions of the cross-compiler.

Heap manager


A task-safe heap system for memory management is supplied. The 32 bit implementation is optimised for performance, and the 16 bit implementation is optimised for code size.

PowerView Embedded GUI (32 bit targets)


PowerView provides facilities for displaying menus, buttons, text and images on monochrome or colour screens. Sample drivers are provided for LCD panels.

A set of PC hosted tools are provided (with source code) for converting standard PC images into the format required for your screen.

FAT File System (32 bit targets)


FATfiler is a FAT 12/16/32 file system designed for use with current devices such as SD/MMC cards, CompactFlash cards and USB memory sticks. Such devices can simply be transferred from the embedded system and plugged into a PC. When a device is initialised FATfiler automatically detects the FAT type and configures itself. The ANS Forth file wordset is provided.

You can configure the filing system for disk caching and for the required sector read/write interface. For the common case where SD/MMC cards are being driven from an SPI port, a common SD/MMC interface layer is provided. SPI drivers are provided in many cases in the CPU specific driver code. A driver layer is also provided for testing on VFX Forth for Windows.

Layered USB System v2 (32 bit targets)


Version 2 of the MPE USB driver system has been tested with Windows, Linux and Mac OS X. The example hardware and USB class drivers have been overhauled for use with DMA hardware. An example composite device is provided.

Your embedded system can use a USB virtual serial port. Version 2 of the USB driver code includes a Communications Device Class (CDC) driver for serial emulation over USB. You can even use this as the Forth console. No additional host drivers are required.

Your embedded system can be a memory stick. The USB code has been structured so that the hardware drivers are independent of the USB core layer and the class layer. The Mass Storage Class (MSC, memory stick) driver requires no additional operating system drivers.

Datalogging applications can be written using the FATfiler file system above. When the time comes, just connect it to a PC using a USB connection and copy the files to the PC.

You can also merge the CDC and MSC drivers into a composite device that will provide both a disk and a serial port to any host PC.

PowerFile (32 bit targets)


PowerFile is an embedded file system based around Unix file systems. PowerFile has recently been updated to be smaller and faster. It includes an ANS Forth wordset that controls a complete filing system with sample drivers for serial EEPROM and Compact Flash or IDE drives.

A single configuration file permits nearly all aspects of PowerFile to be configured. The filing system is suitable for use most applications, including data logging and web servering. A simple interface API links it to almost any form of mass storage, whether it be Flash memory, SD/HC, CF, hard-disk, serial Data Flash or EEPROM.

PowerNet TCP/IP stack (32 bit targets)


Professional editions for 32 bit targets only

A Forth implementation of popular IP based network protocols. Includes TCP, UDP, IP, DHCP, SNTP, SMTP, a multi-threaded server architecture with Telnet, FTP and HTTP Web servers. Client-side facilities have not been neglected. See the PowerNet page for more information.

One user desribes the web server performance as “like s**t off a shovel”.

The PowerNet TCP/IP stack and web server has been reworked to reduce memory usage. It runs comfortably on the new generation of single chip ARMs and ColdFires. A full installation with Ethernet, Telnet and web server can be configured in less than 16k bytes of RAM.

Client-side code has not been neglected. Example files show you how to connect to a remote web server, transfer data to and fro, and even to download and program a new firmware image. Example client configuration code shows you how to simplify production configuration.

N.B. The combination of PowerNet, PowerView and FATfiler permits the construction of fully web-enabled controllers that have low memory requirements and low power consumption.

Finite State Machines


Finite State Machines (FSMs) are a convenient way of describing state driven systems that are otherwise difficult to program. The MPE FSM implementation allows for multitasked operation and nested state machines.

This package has been used for defining communications protocols in safety critical systems such as lifts (elevators) and train (railroad) control.

PID – Process Control Loops


Initially developed for an MPE client, this implementation of a PID controller with deadband handling is now part of the target code.

Examples


Fuzzy Logic package

Flash memory drivers

Device drivers

Extended precision integers

Unix LSECONDS and date/time conversion

I2C and SPI host and device examples

Embedded Forth benchmark suite

and many more …

Optional Extensions


CANopen implementation

The CAN fieldbus is popular in many industries requiring high reliability. This implementation was developed by a client for railway control systems, and is released as a cross compiler extension. Please contact us directly for more information.

Cross Compiler Target CPUs

 

Forth 7 compilers with VFX code generators


ARM, most Cortex-A (with FP) and Cortex-M0/M1/M3/M4/M7, ARM/StrongARM/XScale, 386/486/Pentium, H8S, H8/300H and H8/Tiny, Coldfire, 9S12/68HC12, MSP430 and 8051.

 

CPU family Comments Order code
Cortex-M0/M1/M3/M4/M7, most Cortex-A and ARM7/9/XScale Cortex-M is the ARM architecture for embedded devices. Cortex devices have higher clock speeds and performance with lower energy needs than the old ARM7 devices. One nice feature of the Cortex is that there is no assembler start-up code – it’s all high-level Forth.

Cortex devices: Freescale Kinetis, NXP LPC11xx/13xx/17xx, Nuvoton NUC1xx, STM32F0xx/1xx/4xx, TI/Luminary Stellaris.

Cortex-A7, including RPi 3/4.

ARM7/9 devices: NXP/Philips, Atmel, Analog Devices, ST, Intel, Sharp, Samsung, Oxford Semi, Crystal.

Note that this compiler only supports ARM devices from ARM7TDMI onwards, and does not include support for 26-bit PC mode, devices without the LDRH/STRH instructions, or big-endian mode. The legacy ARM compiler with this support is still available.
Supported ARM and Cortex boards.
Segger J-Link support.

Upgrades from the ARM compiler to ARM/Cortex are available.

XCARMCTX/71
MSP430 Excellent very low power 16-bit CPU with an instruction set that makes small CPUs fun again. Integrated access to the TI JTAG facilities by USB (including Launchpads). XCMSP430/71
H8S/X, H8/300H and H8/Tiny Good code, good performance and excellent value for money 32-bit CPU with wonderful but sometimes quirky peripherals.
Renesas are being particularly aggressive with the pricing of the H8/Tiny parts, allowing you to use a mature 32 bit CPU for the cost of most suppliers’ 8 bit parts.
Current compilers provide better code generation and support for the Renesas RSK H8/36079 evaluation board for the H8/Tiny series.
XCH8300H/71
Coldfire Great performance for the money.
Target code has been updated for recent devices such as the M522xx devices. The VFX code generator has been further tuned for this family and the results are impressive.
XCCF/71
386/486/Pentium Fabulous code generation from the VFX compiler, benefiting from the VFX Forth developments. XC386/71
68HC12/9S12 High speed upgrade to 68HC11; superb maths performance and excellent peripherals. Probably the best 8-bit CPU currently available. XC68HC12/70
8051/C5xx Suitable for all 8051 derivatives such as Intel, NXP/Philips, Atmel, Cygnal, Siemens, Dallas, Analog Devices etc. XC8051/70

If the CPU family you are looking for is not here, please ask. We have a number of compilers that were developed as custom targets, and have not yet been documented to production standard.

licence
downloads
shop and support

 

Legacy target CPUs


Because embedded projects can have very long lifetimes, we do not abandon compilers that are no longer under active development. Instead, they are kept available (usually with full source code) under our normal subscription terms. The technical support level will depend on whether we can remember anything about this particular target and still have hardware for it. Consultancy is always available.

Legacy compilers

Licensing and Ordering

 

Licence


Go here

Downloads



VFX Forth downloads
Cross compiler downloads
Forth-related Papers, VFX Forth benchmark code

Ordering


VFX Forth is available in four subscription levels, which differ in the facilities, support and number of seats available. All come with source code and cross-compiler to rebuild the system.

  • Basic – Free: Non-Commercial use only. Forum support level 0.
  • Standard – EU19/month: 1 seat with commercial use. Forum support level 1.
  • Professional – EU79/month: 3 seats with commercial use. HTML5 UI with one cloud relay. Forum support level 2.
  • Ultimate – EU169/month: 10 seats with commercial use. Forum support level 3. HTML5 UI with 10 cloud relays.

Note that educational users can obtain all the VFX Forth editions at a 50% discount or for free. Call the office to discuss your requirements.

Shop for commercial subscriptions and support forum.

VFX Forth – Common Features

 

  

VFX Forth logo

Last update: 9 April 2020
licence
downloads
shop and support

Features


Visit our papers page to download  our VFX Flier and benchmark code and results.

Click here for the VFX Forth v5 change history; or here for change notes for earlier versions.

Not all features presented on this page are available for VFX Forth for DOS.

VFX Forth v5


Most of the changes from v4 to v5 will make only small individual improvements, but overall increase reliability and standards conformance. As usual, the code was tested on an application of 1.2 million lines of Forth source, which required only minor changes, nearly all to its myriad string defining words.

The first major change improves standards compliance for parsing words such as string definers. The new arrangement allows these to be defined more clearly and the results are completely compliant with the ANS and Forth-2012 standards.

The second change allows the text interpreter to be changed more easily. In particular, new numeric literals are easy to install into the system. The new technique is called “recognisers” because each section in a chain “recognises” a particular data type.

The chassis is looking good.

VFX Code Generator


MPE’s VFX Forth for Windows has consistently proven itself to be the fastest Windows Forth available by a considerable margin. The benchmarks to prove it are on our web site. The v4 release includes many detailed changes to the code generator making v4 even faster than before with no increase in code size.

The VFX code generator generates native code with optimisation and inlining. Using mainstream compiler techniques the VFX optimiser can merge many Forth words and reduce memory access to a minimum. At its most elementary level the effect of the optimisation is impressive:

: n>char \ n -- char
  dup 9 >
  if 7 + endif
  [char] 0 +
; ok
dis n>char
N>CHAR
( 00463D44 83FB09 )       CMP EBX, 09
( 00463D47 0F8E03000000 ) JLE/NG 00463D50
( 00463D4D 83C307 )       ADD EBX, 07
( 00463D50 83C330 )       ADD EBX, 30
( 00463D53 )              RET
16 bytes ok

However, unlike other Forth code generators, VFX can optimise all data stack traffic to a mimum sequence. VFX Forth includes many standard techniques from compiler theory. The result is code generation that is within 25% of hand-written assembler sequences. A set of benchmarks and further papers on the VFX optimiser are available from our downloads page.

The user has control of the inlining level, so that trade-offs between speed and space can be investigated. The default levels are:

  NO INLINING
  NORMAL INLINING
  AGGRESSIVE INLINING
  ABSURD INLINING

The VFX code generator also tokenises many small definitions that are expanded during compilation, so removing not only the call/return overhead but also permitting the optimiser to operate across the call/return boundaries.

Even with all optimisation options enabled, VFX Forth compiles extremely quickly. Fast compilation speed and ease of testing provide a rapid, interactive, and productive compile-debug-fix cycle. Incremental compilation means that only new code needs to be compiled, leading to even shorter compilation times.

 

A set of application benchmarks follow.

 

******************************************
Core i7 3.4GHz, 8Gb RAM, Windows 7-64, SP1
******************************************

12 May 2012
===========
VFX        VFX Forth for Windows v4.60 [build 3332]
SF3        SwiftForth i386-Win32 3.4.2 11-Feb-2012
iForth	   version 4.0.400, generated December 31, 2010.
SP-Forth   Version 4.20 Build 001 at 21.Jan.2009
W32FS      Win32Forth-STC version: 0.05.01 build: 273
gff        gforth-fast 0.7.0

All with no specifics and no hackery

Test time including overhead (ms)         VFX  iForth     SF3    SPF4   W32FS     gff
DO LOOP                                     4       0       4       0      16       0
+                                           5       0       4       0       0       0
M+                                          4       0       5      15      16       0
*                                           5       0       5       0       0      16
/                                           7       0       3       0      15       0
M*                                          4       0       2       0       0       0
M/                                          4       0       3      16       0      15
/MOD                                        3       0       4       0       0       0
*/                                          4      16       4       0      16      16
ARRAY fill                                  2       0       9       0       0       0
=====================================================================================
Total:                                     42      16      43      31      63      47

Win32 API: SendMessage                      5       0       2       0       0       0
Win32 API: COUNTER                         36       0      20       0       0     218
System I/O: KEY?                            7       0     112     359     359     765
=====================================================================================
Total:                                     48       0     134     359     359     983

Eratosthenes sieve 1899 Primes             43      47      64      47     109     171
Fibonacci recursion ( 35 -> 9227465 )      44     109      43      62      47     234
Hoare's quick sort (reverse order)         38      47      80      47      93     203
Generate random numbers (1024 kb array)    55      62      78      63      78     172
LZ77 Comp. (400 kb Random Data Mem>Mem)    65      78     306      93     109     249
Dhrystone (integer)                        38      32      96      47      78     156
=====================================================================================
Total:                                    283     375     667     359     514    1105
Time (ratio to VFX):                     1.00    1.32    2.36    1.27    1.82    3.90

 

Users of threaded code systems should note that applications can be expected to run ten or more times faster, and that writing CODE definitions is unnecessary in VFX Forth.



GTK+ Cross Platform GUI


We have settled on GTK+ as a suitable cross-platform GUI library. Now that we have VFX Forth for Windows, Mac OS X and Linux, it was time to take the prototype Linux interface more seriously. At the
same time, we were being strongly urged by a client to give him back a graphics interface similar to his dearly beloved Borland BGI system from the old days of DOS. With a bit of effort, we found that it is possible to have portable graphics with a cross platform GUI.

GTK + Cross Platform GUI

The four pictures are from Windows, Mac OS X, x86 Linux and ARM Linux. All four were produced by compiling the same source code with no changes. The library interface file contains a small amount of conditional compilation for library file names, but that’s all that changes between operating systems.

The GUI is designed using the Glade GUI designer, which produces an XML description of the GUI. The XML description is loaded into the program by the Builder. The example code below shows a callback (an action needed when an event happens) and the code that produces the display.

2 0 CCBproc: on_about1_activate	\ *widget *user -- ; -- entry
\ *G Callback to run the About dialog.
  2drop  MainAbout runDlg drop
;

The code above produces a callback in the form needed by applications such as GTK that use a C calling convention. The name of the callback was also defined to Glade. A callback in the Builder associates the Glade name with a Forth callback name. In  this case, when the “Help -> About” button is clicked, the About  dialog is run.

: showGraphics3	\ --
\ *G Test word to read a Glade Builder XML file and run the
\ ** GUI it describes.
  initGTK  +gtimer			\ start GTK and timer

  z" gdemo3bld.ui" loadBuilderXML	\ load GTK builder design
  0= abort" Can't load builder file"
  z" window1" builderObject to window1	\ get handles
  z" drawingarea1" builderObject to DrawingArea1
  z" aboutdialog1" builderObject to MainAbout
  freeBuilder

  window1 gtk_widget_show_all		\ show design
  DrawingArea1 win2 initGWin		\ initialise graphics area
  win2 enable-graphics  win2 onto  dirty
  black cleardevice			\ drawing commands
  white  50 circle
  green  200 100 line
  red 30 30 at  70 30 filled rectangle
  80 70 at  100 40 blue filled ellipse
;

 

Operating system API and shared libraries


VFX Forth can make operating system API calls, as well as functions in DLLs and shared libraries. The function interface allows API calls to be defined by cut and paste from other language reference manuals.

Windows

EXTERN: int PASCAL CreateDialogIndirectParam( HINSTANCE, void *,HWND, WNDPROC, LPARAM );
EXTERN: int PASCAL SetWindowText( HANDLE, LPSTR );
EXTERN: HANDLE PASCAL GetDlgItem( HANDLE, int );

Mac OS X

Extern: char * ttyname( int fd );
Extern: int fstat( int fildes, void * buf );
Extern: int copyfile(
  const char * from, const char * to, void * state, int flags
);

Linux

Extern: int ioperm( unsigned long from, unsigned long num, int turn_on );
Extern: int iopl( int level );
Extern: void * mmap(
  void * start, size_t length, int prot, int flags, int fd, off_t offset
);

 

Operating System Constants


VFX Forth incorporates a support library that provides development-time access to thousands of operating system constants. Because the library is only used at development time, there is no impact on the size
of the application. At compile time these constants are treated  as literals and are fully optimised. The Windows version has over 28,000 named Windows constants. Source is provided to rebuild
the library

 

Local Variables


Interfacing to the operating system regularly requires the use of temporary buffers and variables. VFX Forth incorporates MPE’s extended local variable syntax as well as the default ANS syntax. Of course these are fully optimised by the VFX code generator. The following example is taken from a RichEdit
handler:

: DoContextMenu { hwnd posx posy | hmenu pt[ POINT ] -- }
  ...
;

This declares three named inputs (hwndposx and posy), a local variable (hmenu) and a local array
(pt[) of size POINT.

The following example is taken from and environment string handler. Var$ and Dest$ are named inputs and temp$[ is a local buffer.

: GetEnvVar	\ var$ dest$ --
\ *G Extract the environment variable *\i{var$} and place its
\ ** string value at *\i{dest$}. Both strings are counted strings, e.g.
\ *E  c" COMSPEC=" root-buff GetEnvVar
\ **  root-buff count type
  { var$ dest$ | temp$[ #256 ] -- }
  ...
;

 

Help systems


The help system allows you to type HELP name from the console to access the correct page of the PDF manual.  You can select which PDF viewer to use.

Just type LOCATE <name> and the source code for <name> is there on the screen for viewing or editing.

Source Management


The cross reference tool allows you to find out and display where words are used, and also to find out which words are unused for final code reduction. XREF <name> will tell you where the word is used, and XREF-UNUSED will tell you which words in your application have not been used.

Robust Exception Handling


VFX Forth uses the ANS Forth CATCH and  THROW mechanism for nested exception handling, but also integrates this with the operating system’s exception mechanism so that all exceptions can be handled by VFX Forth applications, and all information is available to the user for post-mortem analysis or error recovery.

INI file system


IniParser is a configuration file system that is source compatible between Linux, Mac OS X and Windows. The generated files are compatible with Window INI files. INI files can be generated and used by your applications. IniParser is the basis of the VFX Forth configuration system.

Examples and Libraries


VFX Forth comes with a wide range of application examples. Common to all versions are:

  • Floating point (3 types)
  • Serial communications
  • Socket-based communications
  • JACK Audio interface
  • Multi-tasking
  • State machines
  • Web server
  • Email sender
  • Internationalisation
  • File system interface
  • Binary overlays
  • benchmarks
  • … and much more

 

PowerNet


The PowerNet Echo, Telnet and Web servers have been ported to VFX Forth. These are multi-threaded servers. The Web server supports CGI and ASP, with Forth being used as the scripting language. SOAP, XML and Web Services are provided for direct interchange of information between VFX Forth and and any web service enabled product such as Excel and Project. The PowerNet shipped with VFX Forth is an enhancement of the code in the embedded verion, so see the PowerNet page for more details of PowerNet

PowerNet can be embedded inside your applications to provide fully Web enabled systems.

DocGen Documentation and Help Generator


Built into VFX Forth, the DocGen system can produce documentation for code while it is being compiled. DocGen processes formal comments in your source code, extracts them, and formats them into word processor files in HTML, PDF, TEX, Markdown or user definable formats. Now your source code can include an up-to-date manual for your project! The VFX Forth manual is itself built this way. The following example is part of the source code for selector chains.

: exec-chain? \ i*x n addr -- j*x true | n FALSE
\ *G Run through a given chain using TOS as a selector. If a match is
\ ** made execute the relevant code block and return TRUE otherwise
\ ** the initial selector and a FALSE flag is returned.
  ...
;

The result is the automatic generation of the glossary entry for this word in the manual. DocGen allows multiple files and sections, table of contents, titlepage generation, several levels of headings, special
facilities for examples, and a choice of public or internal release documentation.

Note that DocGen can work with any Forth source code files, not just those for VFX Forth for Windows, making it ideal for use with MPE’s Forth cross compilers.

A special version of DocGen has been developed for safety critical applications. DocGen/SC generates documentation to the US Food and Drug Administration requirements. For a client’s application, DocGen/SC generates over 1500 pages of documentation in PDF format from the project source code in under two minutes!

Internationalisation


The file Lib/International.fth permits full internationalisation of applications according to the ANS
draft standard for internationalisation.

You can define text messages to be internationalised. A simple set of hooks allow you to export text for translation and later reloading at run time.

The supplied code is based on techniques used in a major Forth application running all over the world.

Rapid Development


Conventional programming requires you to use an editor, language compiler, resource compiler, and finally a linker before even a small change can be tested. With VFX Forth, you just make your change using your favourite editor and recompile directly into executable form in seconds. You can drop code from your
editor directly into the VFX Forth console for immediate testing of any definition, or you can just type it at the keyboard.

VFX Forth includes all the tools you need to create bound turnkey applications.

System Resources Give You Full Control


VFX Forth for Windows provides a complete set of system resources and development tools to give you maximum control over your application. These include:

  • Turnkey application generator
  • Dynamic heap management
  • x86 assembler
  • x86 disassembler
  • Binary overlays

VFX Forth includes all tools required to compile, test and create bound versions of your applications for distribution.

Compatible with other MPE Products


The VFX Forth kernel is source-code compatible with MPE’s Forth 7 cross compilers, and compatibility for earlier versions of VFX Forth for Windows and other MPE Forths has been made simple.

Ordering


Go

  • Basic: Non-commercial use only. Free of charge.
  • Standard: Commercial use for one seat. Forum support.
  • Professional: Commercial use for up to three seats. Professional support with guaranteed response time.
  • Ultimate: Commercial use for up to ten seats. Ultimate support with guaranteed response time.
  • licence
    downloads
    support

    Support Services


    MPE has been supporting professional Forth users since 1981. We offer the following services:

    Advanced Technical Support

    • Ad-hoc on-site support
    • Forth Programming Courses
    • Custom Application Design
    • Programming Services

     

    Courses, Consultancy


    MPE can provide start up courses or consultancy using VFX Forth for Windows. The MPE course “Programming Windows with VFX Forth” is for VFX Forth, “Embedded Software for Hardware Engineers” covers cross compiling, and “Architectural Introduction to Forth” is a Forth conversion course. Contact MPE to find out more.

    Go to the pricelist page.

    Ordering


    Go here

    VFX Forth for ARM Linux

     

      VFX Forth logo

    Last update: 9 April 2020
    licence
    downloads
    shop and support

    Features


     

    The VFX Forth for Linux family consists of 32-bit x86 and 32-bit ARM versions built from the same code tree as the Windows and Mac OS/X versions; please refer to the Common features page for a more detailed description of aspects common to all versions, e.g. code generation.

    The current release is v5.1. This release includes code generation changes, an improved shared library interface, the GTK+ cross-platform GUI code, a port of Bernd Pasan’s Minos and Theseus GUI designer, and Hanno Schwalm’s fJACK audio interface.

    Free downloads of the x86 version of VFX Forth for Linux are available from the Southampton server. Login as “public” with a blank password. Select the VfxLinEval directory. Please read the file ReadMe.Linux.txt before you install the system. The 32 bit VFX Forth for Linux version is available in rpm and deb packages for 32 bit and 64 bit x86 Linux variants, and as a tarball. VFX Forth for Linux also works on FreeBSD with the Linux compatibility layer installed.

    The paid-for releases include more features and a version for embedded use on 386 and 486 class CPUs, such as those in the Ebox range of low-cost industrial/network PCs.

    The ARM version works on all 32 bit distributions that support the EABI – that’s most everything these days, including the Raspberry Pi and the Beaglebone Black.

    Read the latest release notes. Release notes for all earlier versions of VFX Forth can be found here.

    For the licence terms, see the licence.

    A customer said:
    “Besides the amazing optimizing compiler, I love the DocGen documentation system. The easy C interfacing and Genio driver architecture have also been key for my project. And finally, I can even generate turnkey apps customized for my eBox 2300SX.”

     

    GTK+ Cross Platform GUI


    We have settled on GTK+ as a suitable cross-platform GUI library. Now that we have VFX Forth for Windows, Mac OS X and Linux, it was time to take the original Linux interface more seriously. Now the GTK+ interface is cross platform, so it’s one of the common features.

    GTK + Cross Platform GUI

    The four pictures are from Windows, Mac OS X, x86 Linux and ARM Linux. All four were produced by compiling the same source code with no changes. The library interface file contains a small amount of conditional compilation for library file names, but that’s all that changes between operating systems.

     

    Minos and Theseus


    Minos is an OOP-based GUI display system and widget library written by Bernd Paysan, ported to VFX Forth and released under an LGPL license. It is dependent only on the presence of the X-Windows libraries and the OpenGL libraries for graphics displays. As a consequence, it uses little RAM and can be used on low-powered systems.

    Theseus is the GUI designer component, also by Bernd Paysan and released under LGPL. The screenshot below shows it in use constructing a prototype GUI front-end for VFX Forth.

    LGPL exemptions and technical support contracts for Minos and Theseus are available separately. Minos and Theseus are supplied with all editions of VFX Forth for Linux.

    Theseus screenshot
    Theseus
     

    Examples and Libraries


    VFX Forth comes with a wide range of application examples.

    Libraries include multitasking, floating point, serial and socket-based communications, benchmarks, BNF parsers, binary overlays, full file system support, and more than a dozen application-oriented examples to get you off to a flying start.

    VFX Forth for ARM Linux includes a direct GPIO access example for the Raspberry Pi with a bit toggle rate of about 10 MHz using the generic GPIO functions, and somewhat faster using functions dedicated to the peripheral pin. Root privilege is required. This example can easily be modified for other ARM Linux platforms. It is particularly useful for writing simple peripheral drivers in user space, e.g. I2C master – no kernel driver required.

     

    System Requirements


    • x86: Any version of x86 Linux with 32-bit libraries, e.g. any Red Hat or Debian distribution or derivative. An x87 compatible maths co-processor is required for floating-point maths.
    • ARM Any version of ARM Linux with EABI support and 32-bit libraries, e.g. any Red Hat or Debian distribution or derivative. A VFP floating point unit is required for floating-point maths.

     

    Compatible with other MPE Products


    The VFX Forth kernel is source-code compatible with MPE’s Forth cross compilers, and compatibility for other versions of VFX Forth for Windows or Mac OS X has been made simple.

     

    Ordering


    licence
    downloads
    shop and support


     

    Support Services


    MPE has been supporting professional Forth users since 1981. We offer the following services:

    Standard Support

    Fax and email hotline technical support on the use of VFX Forth. Within 3 months of purchase any updates are provided free of charge.

    Extended Technical support

    • All upgrades as they are released from development, usually four times per year
    • Direct access to the development team
    • Involvement in the development cycle
    • Annual fee
    • Forth Programming Courses
    • Custom Application Design
    • Programming Services

    Go to the pricelist page.

    licence
    downloads
    shop and support

    VFX Forth for Linux

     

    VFX Forth logo

    NEW! 64 bit version available

    Last update: 7 March 2022
    licence
    downloads
    shop and support

    Features


    The VFX Forth for Linux family consists of a 64 bit version for x86_64 and 32-bit x86 and 32-bit ARM versions built from the same code tree as the Windows and Mac OS/X versions; please refer to the Common features page for a more detailed description of aspects common to all versions, e.g. code generation. VFX Forth for Linux also works on FreeBSD with the Linux compatibility layer installed.

    The current release is v5.1. This release includes code generation changes, an improved shared library interface, the GTK+ cross-platform GUI code, a port of Bernd Paysan’s Minos and Theseus GUI designer, and Hanno Schwalm’s fJACK audio interface.

    Read the latest 64 bit release notes or 32 bit release notes. Release notes for all earlier versions of VFX Forth can be found here.

    The ARM version works on all 32 bit distributions that support the EABI – that’s most everything these days, including the Raspberry Pi and the Beaglebone Black.

    A customer said:
    “Besides the amazing optimizing compiler, I love the DocGen documentation system. The easy C interfacing and Genio driver architecture have also been key for my project. And finally, I can even generate turnkey apps customized for my eBox 2300SX.”

    GTK+ Cross Platform GUI


    We have settled on GTK+ as a suitable cross-platform GUI library. Now that we have VFX Forth for Windows, Mac OS X and Linux, it was time to take the original Linux interface more seriously. Now the GTK+ interface is cross platform, so it’s one of the common features.The four pictures are from Windows, Mac OS X, x86 Linux and ARM Linux. All four were produced by compiling the same source code with no changes. The library interface file contains a small amount of conditional compilation for library file names, but that’s all that changes between operating systems.

    GTK + Cross Platform GUI

    Minos and Theseus


    Minos is an OOP-based GUI display system and widget library written by Bernd Paysan, ported to VFX Forth and released under an LGPL license. It is dependent only on the presence of the X-Windows libraries and the OpenGL libraries for graphics displays. As a consequence, it uses little RAM and can be used on low-powered systems.

    Theseus is the GUI designer component, also by Bernd Paysan and released under LGPL. The screenshot below shows it in use constructing a prototype GUI front-end for VFX Forth.

    LGPL exemptions and technical support contracts for Minos and Theseus are available separately. Minos and Theseus are supplied with all editions of VFX Forth for Linux.

    Theseus screenshot Theseus

    Examples and Libraries


    VFX Forth comes with a wide range of application examples.

    Libraries include multitasking, floating point, serial and socket-based communications, benchmarks, BNF parsers, binary overlays, full file system support, and more than a dozen application-oriented examples to get you off to a flying start.

    VFX Forth for ARM Linux includes a direct GPIO access example for the Raspberry Pi with a bit toggle rate of about 10 MHz using the generic GPIO functions, and somewhat faster using functions dedicated to the peripheral pin. Root privilege is required. This example can easily be modified for other ARM Linux platforms. It is particularly useful for writing simple peripheral drivers in user space, e.g. I2C master – no kernel driver required.

    System Requirements


    • x86_64/AMD64: Any 64 bit Linux with 64 bit libraries; all 64 bit distros that we know about
    • x86: Any version of x86 Linux with 32-bit libraries, e.g. any Red Hat or Debian distribution or derivative. An x87 compatible maths co-processor is required for floating-point maths.
    • ARM Any version of ARM Linux with EABI support and 32-bit libraries, e.g. any Red Hat or Debian distribution or derivative. A VFP floating point unit is required for floating-point maths.

    Compatible with other MPE Products


    The VFX Forth kernel is source-code compatible with MPE’s Forth cross compilers, and compatibility for other versions of VFX Forth for Windows or Mac OS X has been made simple.

    Ordering


    licence
    downloads
    shop and support

    Support Services


    MPE has been supporting professional Forth users since 1981. We offer the following services:

    Standard Support

    Fax and email hotline technical support on the use of VFX Forth. Within 3 months of purchase any updates are provided free of charge.

    Extended Technical Support

    • All upgrades as they are released from development, usually four times per year
    • Direct access to the development team
    • Involvement in the development cycle
    • Annual fee

    Advanced Technical Support

    • Forth Programming Courses
    • Custom Application Design
    • Programming Services

    Go to the pricelist page.

    licence
    downloads
    shop and support

    VFX Forth for Mac OS X

     

    VFX Forth logo

    Last update: 7 March 2022
    licence
    downloads
    shop and support

    Features


    VFX Forth for Mac OS X


    VFX Forth for Mac OS X has 64 bit and 32 bit x86 versions built from the same code tree as the Windows and Linux versions; please refer to the common features version for a detailed description of aspects common to all versions, e.g. code generation. Requires Mac OS X 10.6 (Snow Leopard) or later. VFX Forth 32 does not work on Mac OS X 10.15 Catalina onwards, but VFX Forth 64 works fine on OS X 10.15 onwards.

    Because of the number of clients porting code from other platforms and Forth systems, we are paying more attention to compatibility harnesses, especially for shared library accesss.

    Read the latest 64 bit release notes or 32 bit release notes. Release notes for all earlier versions of VFX Forth can be found here.

    For the licence terms, see the licence.

    Customers say:
    “Besides the amazing optimizing compiler, I love the DocGen documentation system. The easy C interfacing and Genio driver architecture have also been key for my project.”

    “I had written a demo to utilize various math functions found in libraries, mainly to master the library interface in xxx, where I had to write code to handle floating point arguments and return values. I was astonished at the ease of doing this in VfxForth …”

    Transformation engine Transformation Engine by Bruno Degazio
    Read the Paper about the Tranformation engine

    NEW! Carbon MacForth on VFX


    Ward McFarland at Megawolf has ported Carbon MacForth to VFX Forth 32. Carbon MacForth is included in the VFX Forth for Mac distribution. MacForth is a mature Macintosh Forth development environment. MacForth on VFX provides the same working environment as previous versions on MacForth – tightly integrated multi-window source code editor, simple project management tools, and more. A few small syntax changes from prior versions are needed. A client porting a large CAD package to MacForth on VFX from the PowerPC version reports that only minimal changes are required.

    Carbon Macforth on VFX

     Carbon Macforth screenshot

    NEW! Cocoa interface


    Written by Roelf Toxopeus of BMB con, the Cocoa interface provides access to the features of the Mac’s Cocoa interface. A multitude of example programs help you to learn this complex and fascinating interface. The Cocoa interface is included in the VFX Forth for Mac distribution.

    Cocoa screenshot

    GTK+ Cross Platform GUI


    It’s cross platform, so it’s one of the common features.

    GTK + Cross Platform GUI

    Examples and Libraries


    VFX Forth comes with a wide range of application examples.

    Libraries include multitasking, floating point, serial and socket-based communications, benchmarks, BNF parsers, binary overlays, full file system support, and more than a dozen application-oriented examples to get you off to a flying start.

    System Requirements


    • Intel OS X 10.6 or later.
    • Incompatible with OS X 10.15.

    licence
    downloads
    shop and support

    VFX Forth for Windows

     

    VFX Forth logo

    Last update: 7 March 2022
    licence
    downloads
    shop and support

    Features


    Visit our papers page to download our VFX Flier and benchmark code and results.

    Click here for the VFX Forth v4 change history; or here for change notes for earlier versions.

    Get the free download of the evaluation version of VFX Forth. No time out!

    For the licence terms, see the licence.

    CCS Candy Application CCS Candy application

    Studio Development Environment


    The Developer Studio IDE is provided as full source code, and includes features such as the dictionary browser which allows you to find, decompile, and locate the source code of any word in your application, or even in the VFX Forth kernel. The Studio IDE provides user definable hooks to any text editor for editing or source location. You can add your own extensions to the Studio IDE for improved productivity.

    • Browser
    • Debug Console
    • Breakpoints
    • State Monitor
    • Calculator
    • DLL scanner
    • ASCII chart
    • RC file stripper
    • Win 32 API help
    • State save/restore

    Click here for more details.

    Console and Breakpoint Manager Console and Breakpoint Manager

    DFX debugger


    Provided with the Studio IDE is the DFX debugger, featuring single stepping, tracing, instruction logging and watchpoints at the assembler or Forth source code levels. Like the rest of the Studio IDE, DFX is provided as source code.

    • Breakpoints
    • Register display
    • Assembler view
    • Instruction trace
    • Stack displays
    • High level view
    • LOCATE and XREF hooks
    • Memory views
    • State save/restore
    • Debug Forth Interpreter in a separate thread
    • “Narrow down” mode for rapid fault location

    Click here for more details.

    Resource File Compiler


    VFX Forth includes a resource file compiler that permits the use of standard resource files. Unlike other applications, these files are compiled directly as part of the normal compilation process, and can be edited by hand or by a resource editor. VFX Forth supports all the standard Windows controls. The following code is taken from the VFX Forth front end.

    #define IDW_FORTHWINDOW $3801
    IDW_FORTHWINDOW WINDOW 0, 0, 100, 100
    BEGIN
      Caption     "Forth Console"
      Style       WS_CHILD | WS_VISIBLE
                  | WS_CAPTION | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX
      ExStyle     WS_EX_MDICHILD
      ClassStyle  CS_HREDRAW | CS_VREDRAW
      Icon        IDI_APPLICATION
      Cursor      IDC_ARROW
      Brush       WHITE_BRUSH
      Menu        NULL
      WndProc     ForthWindowProc
    END
    

    The Breakpoint Manager illustrated above was created with the resource compiler

    GUIgen


    GUIgen is a way of simplifying construction of GUI interfaces in a “Forth-like” manner. It has been used for several years to build production user interfaces. A number of features have emerged which are generally and genuinely useful. These are (in no particular order):

    • Window classes, windows, dialog boxes and controls are each defined in a similar way.
    • The difference between “modal” and “modeless” dialog boxes is largely hidden.
    • All Windows controls are “automatically” subclassed which allows you to add control-specific message handlers simply without dealing with subclassing in Windows.
    • New window controls can be defined extremely easily.
    • Controls can be “placed within” dialog boxes as is usual but in addition they can be placed within normal windows and within other controls.
    • Each window, dialog box and control has its own private data area.
    • Words which are designed to be executed inside a WndProc procedure can be tested at the keyboard.

    The following code is for a dialog box and is taken from one of the example files.

    DialogBox:  TextDlg
        50 10 110 50 Position&Size
        Modal
        Caption "Enter Name"
    
        WS_VISIBLE  Style
        WS_CAPTION WS_POPUP or Style+
        WS_BORDER Style+
    
        8 100 0 Font "MS Sans Serif"
    
         5 5 100 12 IDC_EditBox z" Hello"   EditBox
        10 25 40 15 IDC_OK      z" &OK"     PushButton
        60 25 40 15 IDC_CANCEL  z" &Cancel" PushButton
    
        WM_INITDIALOG   does TB-DoInit
        WM_COMMAND      does TB-DoCommand
    
    end-dialog
    

    GUIgen is documented in a separate manual, which is currently over 160 pages.

    Guigen - simple dialog box Simple dialog box

    Guigen - grid control in a window Grid control in a window

    GTK+ Cross Platform GUI


    It’s cross platform, so it’s one of the common features.

    GTK + Cross Platform GUI

    Windows API Access


    VFX Forth can access all the standard Windows API calls, as well as functions in any other DLLs. The function interface allows API calls to be defined by cut and paste from other language reference manuals, for example:

    EXTERN: int PASCAL CreateDialogIndirectParam( HINSTANCE, void *,HWND, WNDPROC, LPARAM );
    EXTERN: int PASCAL SetWindowText( HANDLE, LPSTR );
    EXTERN: HANDLE PASCAL GetDlgItem( HANDLE, int );

    Windows Constants


    VFX Forth incorporates a support DLL that provides development-time access to over 28,000 named Windows constants without impacting the size of the application. Windows constants such as GENERIC_READ are treated as literals and are fully optimised.

    Examples and Libraries


    VFX Forth comes with a wide range of application examples including versions of the classic examples from Charles Petzold’s book “Programming Windows”. Examples and libraries include:

    • ForthEd2 MDI editor
    • Studio IDE source code
    • DFX debugger source code
    • FCOM – ActiveX/Com interface
    • FTP interface
    • Web server
    • Email sender
    • DLL generation
    • DDE
    • … and much more

    Examples common to VFX Forth, regardless of operating system, include this list

    Powerful Testing and Debugging Aids


    VFX Forth includes extensive programming aids, including the ability to run your application in one or more windows while you monitor its functions using a separate State Monitor window and the Studio debugger.

    Tools such as the Dictionary Browser and online help make programming a breeze. The Dictionary Browser lets you call up any of the hundreds of functions supplied with VFX Forth or added in your application, and either decompile it or dump its memory area. On-line help documents all standard VFX Forth words using HTML help. You can modify these and produce your own help files, which can be added to the Studio IDE.

    Compatible with Windows 7, 8, 10


    VFX Forth for Windows is a 32-bit Forth implementation for 32 and 64 bit versions of Windows. VFX Forth supports access to all third-party 32 bit DLLs.

    System Requirements:

    • Any version of Windows 7, 8, 10.

    How many generations?


    We have had to abandon support for Windows 95/98 and Windows 2000. We no longer have PCs or Virtual Machines with these systems. We can just about cope with three generations of the operating system – anything more is impossible to guarantee.

    A number of our clients have made similar decisions. Defining Windows 7 as the lowest supported system seems to be a common decision. We do not do anything deliberate to break operation on Windows XP or Vista, but if a new feature will not work on XP or Vista, that’s just too bad.

    licence
    downloads
    shop and support

    Courses, Consultancy


    MPE can provide start up courses or consultancy using VFX Forth for Windows. The MPE course “Programming Windows with VFX Forth” is for VFX Forth, “Embedded Software for Hardware Engineers” covers cross compiling, and “Architectural Introduction to Forth” is a Forth conversion course. Contact MPE to find out more.

    Go to the pricelist page

    licence
    downloads
    shop and support

    About Forth

     

    Last updated: 21 January 2020

    The Forth Language

    MPE Provides Forth systems with modern tools for high quality software production. MPE’s Forth systems provide industrial strength environments for real time software and hardware development. Ian Thain has this to say about Forth.

    Forth’s USP is speed of development coupled with industrial strength. My code has always had a reputation for two things: A good HMI and rock-like stability, and I have no hesitation in saying that my use of Forth has been the most significant contributory factor to both those qualities. Its extensibility means that I know I can make the code do whatever the customer needs, and if Forth is written and documented cleanly in the classical manner it’s inherently strong anyway. Leaving aside the bugs which we can all write at the end of a long and tiring day, you actually have to write very bad Forth before it falls over.

    What is Forth?


    Forth is a Modular Language

    Forth’s modularity enables programs to be written and tested in terms of many small procedures and modules with the minimum loss in efficiency. Forth actively encourages code re-use, which in turn leads to low application size.

    Forth is an Interactive Language

    Forth’s text interpreter executes a procedure as its name is entered. The text interpreter allows parameters to be passed to any procedure so that each and every procedure can be extensively tested, both in isolation and as part of a larger module. Systems tested in such a ‘bottom up’ process are found to be more reliable (data from a NASA presentation), which leads to Forth being preferred for high reliability applications by some NASA teams.

    Forth is Compiled

    MPE Forth systems compile extremely quickly. Fast compilation speed and ease of testing provide a rapid, interactive, and productive compile-debug-fix cycle. Incremental compilation means that only new code needs to be compiled, leading to even shorter compilation times. This rapid compilation includes full code optimisation, with our VFX compiler techology producing code as fast as that from C compilers – and there are benchmarks.

    Forth is a Multitasking Language

    Multitasking is provided as standard with VFX Forth for Windows, Linux and DOS, MPE’s Forth development systems for embedded targets. The multitaskers include message passing, synchronisation, semaphores and event handling for reaction to external events, as well as full timer management services.

    Forth is a Hardware Testing Tool

    The production of an embedded system involves more than just the development of the software; hardware also has to be developed and tested. Forth is ideal for debugging hardware because of the easy way many small test procedures can be written. These procedures are used to inspect hardware and rapidly ‘home-in’ on a problem.

    Forth is Easy to Use

    Forth involves simple concepts applied uniformly. It does not require a user to be a computer scientist. Hence Forth is often used by electronic engineers, physicists and mechanical engineers, as well as by software engineers.

    What is Forth used for?


    MPE’s Forth systems are used for applications ranging from Windows applications which plan the construction of major civil engineering projects to door controllers in access control systems. A few current Forth applications follow.

    Forth makes good tea and coffee

    It is now possible for vending machines to brew tea and coffee with fresh milk, and to produce a cup of tea acceptable to professional tea tasters. The first trick is to prevent milk seeping into pipes and then going off overnight after the machine has been switched off. The next trick is prevent sedimentation in the boiler/heater mechanisms – it ruins the taste of tea! The final trick is to control the flow of water/steam through the coffee grounds or tea leaves, as these need a “wetting period” during which they swell before releasing flavour to the liquid. All controlled by an MPE system.

    Forth disarms bombs

    According to figures from Bosnia and Kosovo, between 10% and 20% of modern air-dropped munitions (bombs) fail to explode. Disarming these is a high priority. MPE was involved in a new technology portable machine for making munitions safe. The system electronics consist of two MPE ARM Development Kits using the Forth Cross Compiler and a control PC running VFX Forth for Windows. The three units are linked by a custom network implementation. The whole system was developed in four months by the clients and an MPE consultancy team.

    MPE Forth plans airports

    Construction Computer Software (CCS) in Cape Town produce the MARS and CANDY applications which are a standard all over the world. The CCS software is an example of a large-scale Windows application written in VFX Forth for Windows. The current (1Q2017) version consists of over 1,200,000 lines of Forth source code.

    CCS software was used to plan the Chai Tak airport in Hong Kong. The CCS web site is at http://www.ccssa.com

    MPE Forth runs commercial laundries

    Micross Electronics (tel: +44 (0)1989 768080) http://www.microssautomation.com/index.php use an MPE Forth for Windows at the heart of their commercial laundry control systems, and MPE’s Forth cross compilers for custom PLCs performing real time control. These systems are installed in many countries, and you may have slept in sheets washed by the Micross Tracknet control systems.

    Forth virtual machine runs payment terminals

    Europay International’s Open Terminal Architecture (OTA) uses a virtual machine (VM) architecture to deliver payment terminal applications directly to payment terminals regardless of their hardware or CPU. The OTA VM has been installed on a range of CPUs and is now being deployed. The OTA project involved up to 30 programmers working in several locations on two continents. OTA is described at http://www.europay.com

    The OTA VM is a derivative of the VM designed by MPE for the SENDIT Esprit project. The VM uses a two-stack architecture derived from Forth, and extended to be language neutral so that code can be compiled from languages other than Forth. We have Forth and C compilers for these VMs, and are available to produce tailored derivatives for your applications.

    Forth runs games

    A mobile phone manufacturer introduced a new games engine derived from the SENDIT project. This uses a Forth-based virtual machine to reduce the size of games in the phone, and to permit more functionality to be provided in the phone without increasing memory size. The previous 400 kb of ROM used for games was reduced to less than 40 kb.

    ISO/ANS Forth


    The ISO/ANS Forth standard is used by all MPE products developed since 1995. ISO/ANS Forth (sometimes informally known as Forth 94) has had a productive impact on Forth since its release in 1994. Both programmer and application portability have been good, and the Forth community has produced much good software that we have been able to port with few problems.

    Forth 200x


    In order to avoid the costs and delays of the ANS standards process, the Forth standard is being developed under the Forth200x process, and formal standardisation will be achieved by fast-tracking the Forth200x standard through a standards body. See www.forth200x.org for more details. See
    also www.forth-standard.org

    Snapshots of the rolling draft are formally released from time to time and the Forth 2012 standard has been released.

     

    Dec 082015
     

    VFX Forth version 4.7

    VFX Forth features common to all versions

    VFX Forth for Windows

    VFX Forth for Mac OS X

    VFX Forth for x86 Linux

    NEW!VFX Forth for ARM Linux

    VFX Forth for DOS

    NEW!There are new library interfaces to libcurl, libiconv, SQLite3 and zlib. Additional notations have been added to the shared library interface to ease porting of code from other Forth systems.

    See our benchmarks.

    See the release notes.

     


    VFX Forth for Windows

    Download the latest free trial version.

    GTK+ GUI and graphics

    fJACK Audio interface

    Customer comments
    “VfxForth is the most fully featured FORTH I’ve ever worked with. This will be a fun project with lots of tools to work with.”

    “I know a lot of compilers are free but speaking freely, this is one of the best darn things I’ve spent money on.”

    “GUIgen is the best and most useful bit of code I’ve seen in a very long time.” More about GUIgen

    “I just wanted to write and congratulate you on your VFX Forth. What a wonderful system you folks have developed! I recently downloaded the evaluation version of VFX and rewrote a Computational Fluid Dynamics simulation that I had originally written for xxxxx. What a difference! Under xxxxx, a single run of the simulation takes over an hour on my computer. Under VFX, the same simulation completes in less than 4 minutes.”

    “I am actually VERY impressed with VFX Forth for Windows’s code generation … you have a fantastic product.”

    More …

     


    VFX Forth for Mac OS X

    Carbon MacForth on VFX

    Cocoa interface

    GTK+ GUI and graphics

    VFX Forth for Mac OS X is built from the same code base as VFX Forth for Linux, and includes the same VFX code generator and other tools. There is direct support for Mach-O executable file generation and there is access to all functions in shared libraries such as libSystem or frameworks such as Carbon and Cocoa. See the release notes.

    A customer said:
    “Besides the amazing optimizing compiler, I love the DocGen documentation system. The easy C interfacing and Genio driver architecture have also been key for my project.

    More …

     


    VFX Forth for x86 Linux

    GTK+ GUI and graphics

    fJACK Audio interface

    VFX Forth for Linux is built from the same code base as VFX Forth for Windows, and includes the same VFX code generator and other tools. There is direct support for ELF executable file generation and access to all functions in shared libraries such as libc is available. See the release notes.

    Customer comments
    “I am in awe of how fast VFX Linux Forth is. My experience is in the distant past with … and more recently G… so I am not used to the optimized code produced by VFX. Very nice!”

    ” … impressed by the features of the VFX, and the fact that you have a *REAL* manual.”

    Free downloads of the evaluation version are available from the Southampton server. Login as “public” with a blank password. The 32 bit VFX Forth for Linux version is available in rpm and deb packages for 32 bit and 64 bit Linux variants, and a tarball. VFX Forth for Linux is suitable for all x86 32 and 64 bit Linux distributions.

    The paid-for versions (Standard, Developer and Mission editions) include kernels for the 386/486 class CPUs used by many embedded x86 systems. VFX Forth for Linux runs very well on lightweight systems such as the Ebox2300 or 3300 family with 300MHz or 1GHz CPUs.

    More …

     


    NEW!VFX Forth for ARM Linux

    It’s just the same as the x86 Linux, except that the assembler, disassembler and VFX code generator target the ARM. It works fine on all versions of ARM Linux that use the EABI interface (that’s nearly all of them these days), including those for the Raspberry Pi and the Beaglebone Black. Includes a direct GPIO access example for the Raspberry Pi with a bit toggle rate of about 10 MHz using the generic GPIO functions, and somewhat faster using functions dedicated to the peripheral pin.

    More …

     


    VFX Forth for DOS

    VFX Forth for DOS is built from the same source tree as VFX Forth for Windows, and includes the same VFX code generator, graphics and other tools. VFX Forth for DOS is mainly used for embedded applications. The PowerNet TCP/IP stack is available. For more details see our PowerNet page.

    The version 4 releases are available with the same pricing as VFX Forth for Windows. Contact us for further details.

    See the release notes.

    Customer comment:
    “I continue to be astonished at the quantum leap the VFX software suite has taken from ProForth. It’s been difficult to make the right choices during the conversion, without over-indulging, like a kid in the sweet shop not wanting to miss anything that could be potentially delicious.”

    More …

     


    Boards and Hardware


    MPE LPC2468 PowerBoard

    Designed to supply a computing core for industrial applications, this PowerBoard provides all the standard “computer stuff” so that you can concentrate on the I/O handling. Stackable and robust.