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

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:

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.

Users of threaded code systems should note that applications can be expected to run ten or more time 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.

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.

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.

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.

Linux

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.

Users of the Pro and Mission editions of VFX Forth can extend and rebuild the support libraries.

Local Variables

Windows programming 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 (hwnd, posx 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.

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 and are shipped with the Professional and Mission versions. 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

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 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

VFX Forth is available in four editions, which differ in the level of source code provided:

Evaluation: Free download from this website. The full system with a short nag screen, no timeout, no kernel sources, no turnkey generation and no PowerNet.

Standard: Full system with turnkey application generation, full kernel sources except for the
VFX code generator but no cross compiler or tool source code. No PowerNet. One year of tech support and upgrades.

Professional: Full system with the PowerNet web server, all kernel sources and the MPE Forth
VFX 386+ cross compiler. With this system you can modify and extend the VFX Forth system. Requires a Non-Disclosure Agreement to be signed. One year of tech support and upgrades.

Mission: Full system with all sources and cross compilers for all supported CPUs and operating systems, and full source for all support tools, including the cross compilers, executable file generator, and support DLLs. Requires a Non-Disclosure Agreement to be signed.

Note that educational users can obtain all the VFX Forth editions at a 50% discount.

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

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.

New from mpe – click on title for more information

Southampton, UK – 04 May 2016 – MPE today announced Interactive C support for ARM architecture via SockPuppet. The later a bug is found in the design cycle, the more design costs increase. Interactive debugging and adding test harnesses from the start ensures the code stays close to the initial […]

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 VFX Forth for ARM Linux VFX Forth for DOS There are new library interfaces to libcurl, libiconv, SQLite3 and zlib. Additional notations have been […]

Forth 7 cross compiler and targets Professional version includes PowerNet In detail … Version 7 of the MPE Forth cross compiler produces over 500 kb of binary code per second. There are many detail improvements to the compilers and the target code. The first major item for users of 32 […]

Lite cross compilers Lite compilers are for Windows only; they run well under Wine and other Windows emulators. Lite compilers are free of charge and are for non-commercial use only. If you want to commercialise your project just upgrade to a compatible Stamp, Standard or Professional compiler with more […]

We have considered many schemes for increasing the use of Forth. In the embedded world, the situation has become that you can download free (of charge) versions of many compilers for many programming languages. We feel that we have to do the same to reach new users and promote the […]

I was trying to avoid some work, and stumbled across this post (republished with permission) on one of the LinkedIn discussions. If you are at all interested in software reliability, Les Hatton is someone to respect. I was lost on LinkedIn (not for the first time) and spotted this discussion. […]