Ficl Release Notes


 

Version 3.01

  • Major contribs by Larry Hastings (larry@hastings.org):
    • FILE wordset (fileaccess.c)
    • ficlEvaluate wrapper for ficlExec
    • ficlInitSystemEx makes it possible to bind selectable properties to VMs at create time
    • Python version of softcore builder ficl/softwords/softcore.py
  • SWIG wrapper for Ficl contributed by Ye Xiaofeng. SWIG is a software development tool that connects programs written in C, C++, and Objective-C with a variety of high-level programming languages - now including Ficl. SWIG writes the wrapper code so you don't have to.
  • Environment contains ficl-version (double)
  • ?number handles trailing decimal point per DOUBLE wordset spec
  • Fixed broken .env (thanks to Leonid Rosin for spotting this goof)
  • Fixed broken floating point words that depended on evaluation order of stack pops.
  • env-constant
  • env-2constant
  • dictHashSummary is now commented out unless FICL_WANT_FLOAT (thanks to Leonid Rosin again)
  • Thanks to David McNab for pointing out that .( should be IMMEDIATE. Now it is.

Version 3.00a

  • Fixed broken oo.fr by commenting out vcall stuff using FICL_WANT_VCALL. Vcall is still broken.

Version 3.00

  • Added pSys parameter to most ficlXXXX functions for multiple system support. Affected functions:
    • dictLookupLoc renamed to ficlLookupLoc after addition of pSys param
    • ficlInitSystem returns a FICL_SYSTEM*
    • ficlTermSystem
    • ficlNewVM
    • ficlLookup
    • ficlGetDict
    • ficlGetEnv
    • ficlSetEnv
    • ficlSetEnvD
    • ficlGetLoc
    • ficlBuild
  • Fixed off-by-one bug in ficlParsePrefix
  • Ficl parse-steps now work correctly - mods to interpret()
  • Made tools.c:isAFiclWord more selective
  • Tweaked makefiles and code to make gcc happy under linux
  • Vetted all instances of LVALUEtoCELL to make sure they're working on CELL sized operands (for 64 bit compatibility)

Version 2.06

  • Debugger changes:
    • New debugger command "x" to execute the rest of the command line as ficl
    • New debugger command "l" lists the source of the innermost word being debugged
    • If you attempt to debug a primitive, it gets executed rather than doing nothing
    • R.S displays the stack contents symbolically
    • Debugger now operates correctly under ficlwin, although ficlwin's key handling leaves a lot to be desired.
    • SEE listing enhanced for use with the debugger
  • Added Guy Carver's changes to oo.fr for VTABLE support
  • float.c words f> and >f to move floats to and from the param stack, analogous to >r and r>
  • LOOKUP - Surrogate precompiled parse step for ficlParseWord (this step is hard coded in INTERPRET)
  • License text at top of source files changed from LGPL to BSD by request
  • Win32 console version now handles exceptions more gracefully rather than crashing - uses win32 structured exception handling.
  • Fixed BASE bug from 2.05 (was returning the value rather than the address)
  • Fixed ALLOT bug - feeds address units to dictCheck, which expects Cells. Changed dictCheck to expect AU.
  • Float stack display word renamed to f.s from .f to be consistent with r.s and .s

Version 2.05

General

  • HTML documentation extensively revised
  • Incorporated Alpha (64 bit) patches from the freeBSD team.
  • Split SEARCH and SEARCH EXT words from words.c to search.c
  • 2LOCALS defined in Johns Hopkins local syntax now lose the first '2:' in their names.
  • Simple step debugger (see tools.c)
  • The text interpreter is now extensible - this is accomplished through the use of ficlAddParseStep(). FICL_MAX_PARSE_STEPS limits the number of parse steps (default: 8). You can write a precompiled parse step (see ficlParseNumber) and append it to the chain, or you can write one in ficl and use ADD-PARSE-STEP to append it. Default parse steps are initialized in ficlInitSystem. You can list the parse steps with parse-order ( -- ).
  • There is now a FICL_SYSTEM structure. This is a transitional release - version 3.0 will alter several API prototypes to take this as a parameter, allowing multiple systems per process (and therefore multiple dictionaries). For those who use ficl under a virtual memory O/S like Linux or Win NT, you can just create multiple ficl processes (not threads) instead and save youself the wait.
  • Fixes for improved command line operation in testmain.c (Larry Hastings)
  • Numerous extensions to OO facility, including a new allot methods, ability to catch method invocations (thanks to Daniel Sobral again)
  • Incorporated Alpha (64 bit) patches contributed by Daniel Sobral and the freeBSD team Ficl is now 64 bit friendly! UNS32 is now FICL_UNS.
  • Split SEARCH and SEARCH EXT words from words.c to search.c
  • ABORT" now complies with the ANS (-2 THROWs)
  • Floating point support contributed by Guy Carver (Enable FICL_WANT_FLOAT in sysdep.h).
  • Win32 vtable model for objects (Guy Carver)
  • Win32 dll load/call suport (Larry Hastings)
  • Prefix support (Larry Hastings) (prefix.c prefix.fr FICL_EXTENDED_PREFIX) makes it easy to extend the parser to recignize prefixes like 0x and act on them. Use show-prefixes to see what's defined.
  • Cleaned up initialization sequence so that it's all in ficlInitSystem, and so that a VM can be created successfully before the dictionary is created

Bug fixes

  • ABORT" now works correctly (I promise!)
  • REFILL works better
  • ALLOT's use of dictCheck corrected (finally)

New words

  • 2r@ 2r> 2>r (CORE EXT)
  • 2VARIABLE (DOUBLE)
  • ORDER now lists wordlists by name
  • .S now displays all stack entries on one line, like a stack comment
  • wid-get-name   given a wid, returns the address and count of its name. If no name, count is 0
  • wid-set-name  set optional wid name pointer to the \0 terminated string address specified.
  • ficl-named-wordlist creates a ficl-wordlist and names it. This is now used in vocabulary and ficl-vocabulary 
  • last-word  returns the xt of the word being defined or most recently defined.
  • q@ and q! operate on quadbyte quantities for 64 bit friendliness

New OO stuff

  • ALLOT (class method)
  • ALLOT-ARRAY (class method)
  • METHOD define method names globally
  • MY=> early bind a method call to "this" class
  • MY=[ ] early bind a string of method calls to "this" class and obj members
  • C-> late bind method invocation with CATCH
  • Metaclass method resume-class and instance word suspend-class create mutually referring classes. Example in string.fr
  • Early binding words are now in the instance-vars wordlist, not visible unless defining a class.
  • Support for refs to classes with VTABLE methods (contributed by Guy Carver). Guy writes:

    My next favorite change is a set of VCALL words that allow me to call C++ class virtual methods from my forth classes. This is accomplished by interfacing with the VTABLE of the class. The class instance currently must be created on the C++ side. C++ places methods in the VTABLE in order of declaration in the header file. To use this in FICL one only needs to ensure that the VCALL: declerations occur in the same order. I use this quite a bit to interface with the C++ classes. When I need access to a method I make sure it is virtual (Even if it ultimately will not be). I use Visual C++ 6.0 and have not tested this under any other compiler but I believe VTABLE implementation is standard.

    Here is an example of how to use VCALL:

    C++ class declaration
    class myclass
    {
    public:
      myclass();
      virtual ~myclass();
      virtual void Test( int iParam1 );
      virtual int Test( int iParam1, char cParam2 );
      virtual float Test();
    };
    
    ficl class declaration
    object subclass myfclass hasvtable   \ hasvtable adds 4 to the offset to
                                       \  accommodate for the VTABLE pointer.
    0 VCALL: Destructor()      \ VCALL: ( ParamCount -- )
    1 VCALL: Test(int)         \ Test takes 1 int parameter.
    2 VCALLR: iTest(int,char)  \ iTest takes 2 parameters and returns an int.  
    0 VCALLF: fTest()          \ fTest takes no parameters and returns a float.
    end-class
    
    MyCAddress                 \ Primitive to return a pointer to a "myclass" instance.
    myfclass -> ref dude       \ This makes the MyCAddress pointer a myfclass
                              \  instance with the name "dude".
    1234 dude -> Test(int)     \ Calls the virtual method Test.
    1234 1 dude -> iTest(int,char) .  \ Calls iTest and emits the returned int.
    dude -> fTest() f.         \ Calls fTest and emits the returned float.
    

Version 2.04

ficlwin

  • Catches exceptions thrown by VM in ficlThread (0 @ for example) rather than passing them off to the OS. 

ficl bugs vanquished

  • Fixed leading delimiter bugs in s" ." .( and ( (reported by Reuben Thomas)
  • Makefile tabs restored (thanks to Michael Somos)
  • ABORT" now throws -2 per the DPANS (thanks to Daniel Sobral for sharp eyes again) 
  • ficlExec does not print the prompt string unless (source-id == 0)
  • Various fixes contributed by the FreeBSD team.

ficl enhancements

  • Words.c: modified ficlCatch to use vmExecute and vmInnerLoop (request of Daniel Sobral) Added vmPop and vmPush functions (by request of Lars Krueger ) in vm.c These are shortcuts to the param stack. (Use LVALUEtoCELL to get things into CELL form) 
  • Added function vmGetStringEx with a flag to specify whether or not to skip lead delimiters
  • Added non-std word: number?
  • Added CORE EXT word AGAIN (by request of Reuben Thomas) 
  • Added double cell local (2local) support
  • Augmented Johns Hopkins local syntax so that locals whose names begin with char 2 are treated as 2locals (OK - it's goofy, but handy for OOP)
  • C-string class revised and enhanced - now dynamically sized
  • C-hashstring class derived from c-string computes hashcode too.

Version 2.03

This is the first version of Ficl that includes contributed code. Thanks especially to Daniel Sobral, Michael Gauland for contributions and bug finding. 

New words 

  • clock              (FICL)
  • clocks/sec         (FICL)
  • dnegate            (DOUBLE)
  • ms                 (FACILITY EXT - replaces MSEC ficlWin only)
  • throw              (EXCEPTION)
  • catch              (EXCEPTION)
  • allocate           (MEMORY)
  • free               (MEMORY)
  • resize             (MEMORY)
  • within             (CORE EXT)
  • alloc              (class method)
  • alloc-array        (class method)
  • free               (class method)
Bugs Fixed 
  • Bug fix in isNumber(): used to treat chars between 'Z' and 'a' as valid in base 10... (harmless, but weird)
  • ficlExec pushes the ip and interprets at the right times so that nested calls to ficlExec behave the way you'd expect them to.
  • evaluate respects count parameter, and also passes exceptional return conditions back out to the calling instance of ficlExec.
  • VM_QUIT now clears the locals dictionary in ficlExec.
Ficlwin Enhancements 
  • File Menu: recent file list and Open now load files.
  • Text ouput function is now faster through use of string caching. Cache flushes at the end of each line and each time ficlExec returns.
  • Edit/paste now behaves more reasonably for text. File/open loads the specified file.
  • Registry entries specify dictionary and stack sizes, default window placement, and whether or not to create a splitter for multiple VMs. See HKEY_CURRENT_USER/Software/CodeLab/ficlwin/Settings
Ficl Enhancements 
  • This version includes changes to make it 64 bit friendly. This unfortunately meant that I had to tweak some core data types and structures. I've tried to make this transparent to 32 bit code, but a couple of things got renamed. INT64 is now DPINT. UNS64 is now DPUNS. FICL_INT and FICL_UNS are synonyms for INT32 and UNS32 in 32 bit versions, but a are obsolescent. Please use the new data types instead. Typed stack operations on INT32 and UNS32 have been renamed because they operate on CELL scalar types, which are 64 bits wide on 64 bit systems. Added BITS_PER_CELL, which has legal values of 32 or 64. Default is 32.
  • ficl.c: Added ficlExecXT() - executes an xt completely before returning, passing back any exception codes generated in the process. Normal exit code is VM_INNEREXIT.
  • ficl.c: Added ficlExecC() to operate on counted strings as opposed to zero terminated ones.
  • ficlExec pushes ip and executes interpret at the right times so that nested calls to ficlExec behave the way you'd expect them to.
  • ficlSetStackSize() allows specification of stack size at run-time (affects subsequent invocations of ficlNewVM()).
  • vm.c: vmThrow() checks for (pVM->pState != NULL) before longjmping it. vmCreate nulls this pointer initially. 
  • EXCEPTION wordset contributed by Daniel Sobral of FreeBSD
  • MEMORY-ALLOC wordset contributed by Daniel Sobral, too. Added class methods alloc and alloc-array in softwords/oo.fr to allocate objects from the heap.
  • Control structure match check upgraded (thanks to Daniel Sobral for this suggestion). Control structure mismatches are now errors, not warnings, since the check accepts all syntactally legal constructs.
  • Added vmInnerLoop() to vm.h. This function/macro factors the inner  interpreter out of ficlExec so it can be used in other places. Function/macro behavior is conditioned on INLINE_INNER_LOOP in sysdep.h. Default: 1 unless _DEBUG is set. In part, this is because VC++ 5 goes apoplectic when trying to compile it as a function. See 

  • comments in vm.c
  • EVALUATE respects the count parameter, and also passes exceptional return conditions back out to the calling instance of ficlExec.
  • VM_QUIT clears locals dictionary in ficlExec()
  • Added Michael Gauland's ficlLongMul and ficlLongDiv and support routines to math64.c and .h. These routines are coded in C, and are compiled only if PORTABLE_LONGMULDIV == 1 (default is 0).
  • Added definition of ficlRealloc to sysdep.c (needed for memory allocation wordset). If your target OS supports realloc(), you'll probably want to redefine ficlRealloc in those terms. The default version does ficlFree followed by ficlMalloc.
  • testmain.c: Changed gets() in testmain to fgets() to appease the security gods.
  • testmain: msec renamed to ms in line with the ANS
  • softcore.pl now removes comments & spaces at the start and end of lines. As a result: sizeof (softWords) == 7663 bytes (used to be 20000)  and consumes 11384 bytes of dictionary when compiled
  • Deleted license paste-o in readme.txt (oops).

Version 2.02

New words  Bugs Fixed 
  • forget now adjusts the dictionary pointer to remove the name of the word being forgotten (name chars come before the word header in ficl's dictionary)
  • :noname used to push the colon control marker and its execution token in the wrong order
  • source-id now behaves correctly when loading a file.
  • refill returns zero at EOF (Win32 load). Win32 load command continues to be misnamed. Really ought to be called included, but does not exactly conform to that spec either (because included expects a string signature on the stack, while Ficl's load expects a filename upon invocation). The "real" LOAD is a BLOCK word.
Enhancements (IMHO) 
  • dictUnsmudge no longer links anonymous definitions into the dictionary
  • oop is no longer the default compile wordlist at startup, nor is it in the search order. Execute also oop definitions to use Ficl OOP.
  • Revised oo.fr extensively to make more use of early binding
  • Added meta - a constant that pushes the address of metaclass. See oo.fr for examples of use.
  • Added classes: c-ptr  c-bytePtr  c-2bytePtr  c-cellPtr These classes model pointers to non-object data, but each knows the size of its referent.

Version 2.01

  • Bug fix: (local) used to leave a value on the stack between the first and last locals declared. This value is now stored in a static.
  • Added new local syntax with parameter re-ordering. See description below. (No longer compiled in version 2.02, in favor of the Johns Hopkins syntax)

Version 2.0

  • New ANS Forth words: TOOLS and part of TOOLS EXT, SEARCH and SEARCH EXT, LOCALS and LOCALS EXT word sets, additional words from CORE EXT, DOUBLE, and STRING. (See the function ficlCompileCore in words.c for an alphabetical list by word set).
  • Simple USER variable support - a user variable is a virtual machine instance variable. User variables behave as VARIABLEs in all other respects.
  • Object oriented syntax extensions (see below)
  • Optional stack underflow and overflow checking in many CORE words (enabled when FICL_ROBUST >= 2)
  • Various bug fixes