Installation and introduction








Installation

VFX Forth

Install the appropriate package for your Linux distribution and follow the on-screen instructions. If a key is required, it is a 12 digit number which you will find

The key must be entered as a 12 digit number with no punctuation.

Directory structure

The main installed directory (folder) structure looks like this:


/usr/bin  - issue binaries
<vfx>
  Doc
    AnsForth.Htm - ANS Forth HTML documentation
    VfxLin.htm   - VFX Forth HTML documentation
  Bin     - development binaries (not all versions)
  Examples - Examples to look at and use
    - has subdirectories
  Lib      - library of tools maintained by MPE
    CIAO  - C Inspired Active Objects OOP package
    FSL   - A port of the Forth Scientific Library
    GENIO - Examples of Generic I/O drivers
    OOP   - A Neon-style OOP package
    Lin32 - Linux specific code
  Sources  - source code if applicable
    - has subdirectories
  Kernel   - source code if applicable
    - has subdirectories
  VFXBase  - source code if applicable
    - has subdirectories
  TOOLS    - useful third party O/S specific tools
           - not present in all versions
  XTRA     - Additional third party O/S specific tools
           - not present in all versions

Executable files

The executables are in the folder <Vfx>\Bin in some versions. The installation system also places the executables in /usr/bin.

The support library, vfxsupp.so, extends the number handler to search for Linux constants that are then treated as if their value had been entered numerically. The search is case sensitive, and yes we have seen constants which differ only in case and return different values. This library avoids having to keep a huge number of constant definitions in the Forth dictionary. The support library is only needed for development, and may not be shipped with applications.

Supported distributions

There is a tarball for self-installation.



Installing from the tarball

The tarball was created with

 tar cvfz ...

Extract the tarball to a suitable directory.

 tar xvfz ...

Step into the new directory and there will be a file InstallMe.Lin32.sh. This is a shell script which you you should run to perform all the donkey work described below.

The executables and shared libraries are in the Bin subdirectory. You should now copy these to the "right" places for your distribution, usually /usr/bin and /usr/lib for 32 bit distributions. The files to copy to /usr/bin are vfxlin and/or vfxlin386. The files to copy to /usr/lib are libmpeparser.so.0 and vfxsupp.so.1.0.1. This last needs a symbolic link as vfxsupp.so.1.

  ln -s vfxsupp.so.1.0.1 vfxsupp.so.1

The shared library libmpeparser.so.0 contains the code to support persistent INI files and and vfxsupp.so.1.0.1 contains a large number of (case-sensitive) constants from Linux header files.

Other flavours of Unix

We can provide ports of VFX Forth for Linux to operating systems such as BSD and Open Solaris. Porting and supporting these versions depends on "ample spare time", consultancy requests, and the number of operating systems we can cram onto the development machines.




Introduction

Getting started

If you do not know Forth, versions supplied on CD contain a PDF version of "Programming Forth" by Stephen Pelc. Users of evaluation versions can obtain the same PDF file from the MPE website.

Books on Forth are available from MPE and others. For more details see:

  http://www.mpeforth.com/books.htm

Do not be afraid to play. Forth is an interactive system designed to help you explore its own programming environment. There is plenty of source code in the Examples and Lib directories, so look at it, edit it, and see what happens!

Set up your editor

VFX Forth for Linux is not supplied with an editor. If you want to set one, use:

  editor-is <editor>

e.g.

  editor-is emacs
  editor-is /bin/vi

SetLocate tells VFX Forth how your editor can be called to go a particular file and line. Use in the form:

  SetLocate  <rest of line>

where the text after SetLocate is used to define how parameters are passed to the editor, e.g. for Emacs, use:

  SetLocate +%l% "%f%"

  EMACS        +%l% "%f%"
               --no-wait +%l% "%f%"
  Kate         --use --line %l% "%f%" &
  UltraEdit    -- "%f%" --lc%l%:1 &

Thanks to Charles Curley for the additional EMACs information. See http://www.charlescurley.com. He also notes that you should add the following to your .emacs file:


 (if (or (string-equal system-type "gnu/linux")
         (string-equal system-type "cygwin"))
     (server-start)
          (message "emacsserver started."))

It is essential to place the quote marks around the %f% macro if your source paths include spaces.

For LOCATE and other source code tools to work, VFX Forth must know where its source code is. The root of the source code directory is saved in the VFXPATH text macro, which is expanded when needed. To see what the current setting is, use:

  ShowMacros

To see how the macro is used, look at the source file list:

  .Sources

To set the macro, use something like

   c" ~/VfxForth/Sources" setMacro VfxPath

For more information on text macros, see the chapter on "Text macro substitution".

Set up the PDF help system

For words for which you do not have the source, but are documented in the manual, you can use HELP <name>, e.g.

  help help

This needs configuration according to which PDF viewer and version you are using. The default incantations are for xpdf.


 s" xpdf %h%.pdf %p% &" HelpCmd$ place
 s" %LOAD_PATH%/../doc/VfxLin" HelpBase$ place
 #17 HelpPage0 !

The first line tells the system how to run a PDF viewer so that it displays the page %p%. The second line defines the PDF file base name, which is used to find the PDF file and its associated index file. The third line defines the page offset from the start of the PDF file to page number 1, i.e. to step over the table of contents and so on.

The configuration information is preserved between sessions in a configuration file, by default ~/.VfxForth.ini.

New features in this version

Changes between versions are documented in reverse chronological order in the file <VFX>/Doc/Release.vfx.txt, which is available from the Help menu in the Windows version. The file contains the changes for all versions.