Is the Fignition Forth ANS compatible

88 views
Skip to first unread message

Juergen Pintaske

unread,
Dec 27, 2014, 4:44:29 PM12/27/14
to fign...@googlegroups.com
Sorry if this has been answered before.
Is this Forth Code ANS compatible?

IF NOT, WHAT ARE THE EXCEPTIONS?
VIDEO anyway, but the rest?

We have started an Educational Project called MMT for MiniMultiTool,

defining
4 Input Bits, 4 Output Bits, 2 Analog Inputs, 1 PWM output to simulate a D/A, Frequency OUT
Controlling 4 RC Servos
ALL based on 4 bits - one nibble, for now running on MSP430G2553, 20 pin Dual in Line package
For details see www.forth-ev,de look under MMT

Could this project run as well under Fignition?
If YES, I would immediately buy one to check it out.
MMT now runs under 4e4th, MPE 430 LITE, probably eForth.

Mark Wills

unread,
Dec 27, 2014, 5:31:02 PM12/27/14
to fign...@googlegroups.com

Hi. It's FIG based, hence the name: FIGnition.

It also has some unique features such as built in floating point etc.

Mark

--
You received this message because you are subscribed to the Google Groups "FIGnition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fignition+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Julian Skidmore

unread,
Dec 28, 2014, 10:35:51 AM12/28/14
to fign...@googlegroups.com
Hello Juergen,

>> Sorry if this has been answered before.
>> Is this Forth Code ANS compatible?
>>
>> IF NOT, WHAT ARE THE EXCEPTIONS?
>> VIDEO anyway, but the rest?

As Mark says, FIGnition is really built upon FIG-Forth, rather than
ANS Forth (which is built upon Forth-79 / Forth-83). It borrows some
ideas from Jupiter-Ace Forth. There are some superficial differences
and some deeper differences.

* FIGnition Forth uses words such as << and >> for shifting values.
* FIGnition Forth number entry uses '.' for decimal/scientific
notation numbers (not for double-length numbers); to denote double
numbers you end a number with 'd'. You can directly enter hexadecimal
numbers by prefixing them with '$'.
* FIGnition Forth's leave word merely sets i to i', it doesn't abort
the do loop.
* FIGnition Forth uses neg instead of negate.
* FIGnition Forth doesn't have ?terminal . It uses inkey and key (like
a Jupiter Ace) instead.
* FIGnition Forth doesn't have words to support the abstraction of
cell sizes, for example, the word cell doesn't exist.
* Logical 'true' on FIGnition Forth is -1, instead of 1.
* FIGnition Forth doesn't use tick ' to find words and return an
execution token. Instead it uses the word 'find' to find words and
returns the link address.
* FIGnition Forth dictionary linkage is simpler than most Forths, and
consists of a link cell, then a flags byte, then the name as a string,
then the code itself.
* FIGnition Forth is a hybrid byte-code/execution address version of
Forth. It uses x, to compile execution tokens.
* FIGnition Forth is written in lower-case.
* 2! and d@ are d! and d@ on FIGnition Forth 1.0 and later.
* FIGnition Forth strings are 'C' style zero-terminated strings, not
length-byte, text strings.
* J is R on FIGnition Forth.
* I and I' are not stored on the return stack (they are machine registers).
* There is no case / of / endcase built into FIGnition Forth.
* There is no direct task support in FIGnition Forth, though
user-interrupts are supported.
* i@, i!, ic@, ic! and >port> are used to access internal I/O addresses.

This makes it sound like FIGnition Forth is very different to ANS
Forth. Nevertheless, for many embedded applications, conversion to
FIGnition Forth will be fairly straight-forward.

>> We have started an Educational Project called MMT for MiniMultiTool,
>>
>> defining
>> 4 Input Bits, 4 Output Bits, 2 Analog Inputs, 1 PWM output to simulate a
>> D/A, Frequency OUT
>> Controlling 4 RC Servos
>> ALL based on 4 bits - one nibble, for now running on MSP430G2553, 20 pin
>> Dual in Line package
>> For details see www.forth-ev,de look under MMT

I've just had a look at MMT and it looks nice :-)

FIGnition is really a stand-alone computer rather than a controller.
This means that user-code can be written on the machine itself and
goes straight into its external RAM rather than being programmed into
its internal Flash.

This explains much about the reasons for why FIGnition Forth is
different to ANS Forth. FIGnition is really trying to be a self-hosted
80s home computer (like a Jupiter-Ace) rather than an embedded
controller and has similar limitations in terms of the language and
its capabilities. For example, it's geared to writing simple UDG or
bitmapped games and the entire OS and firmware fits into 16Kb of
Flash, which limits the number of words it can support.

The two main problems with supporting MMT on FIGnition is the lack of
available I/O and the lack of real-time behaviour owing to the video
display. It's theoretically possible to disable the keyboard and video
to gain up to 12 I/O ports (including proper serial I/O and at least
one or two PWMs), but then FIGnition would becoming more like an
Arduino.

If what you're really looking for is a controller that runs an ANS
version of Forth (why is ANS a requirement?) then perhaps AmForth
would be a better match IMO.

Another possibility, looking at it the other way would be to port the
FIGnition VM to the MSP430 (and running Forth code only from internal
Flash) and then, according to the application you want to run,
downloading the correct set of words to support the application. Since
the FIGnition VM uses a combination of byte codes and proper
addresses, you would gain better Forth code density than would be the
case with AmForth.

-Best regards from Julz

>> Could this project run as well under Fignition?
>> If YES, I would immediately buy one to check it out.
>> MMT now runs under 4e4th, MPE 430 LITE, probably eForth.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "FIGnition" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to fignition+...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "FIGnition" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fignition+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


--

The DIY 8-bit computer from nichemachines™

Juergen Pintaske

unread,
Dec 31, 2014, 3:21:33 AM12/31/14
to fign...@googlegroups.com
Hi Julz,

thanks for the answers. We are coming from a different direction: How to learn and use the Forth to control something and make sounds. Extensions possible and encouraged.
For us the Launchpad is like a development station, the application then moved to a separate MSP430.
I wonder if suchy an approach was possible to develop and then program an external Atmel.
 
My post here was to see how this might work with Fignition. I assumed schools or users might want to do more than video and programming. It seems I was wrong. So sorry for the posting.

On the other hand I was interested in finding out how comparable your Forth  implementation is to current commercial Forths - or if with some words defining your functionality as an ANS functionality you would be compatible - slower, but compatible.

We have been working hard (especially Dirk and Michael) last year (in our spare time) to get the 4e4th IDE running on eForth and MPE430 LITE. Have the same IDE so people can move and try out.
Forth is fragmented enough - as people often write their own Compilers rather than doing example applications.

I just wonder how people migrate from your environment to other Forths, as they run out of steam or IO on Fignition.
This was one of the intentions of an ANS definition. To make portability easier.

Or I was even thinking of using a Fignition as an intelligent Video IO for our purposes. MSP430 controlling a Fignition ( or 2 to get 3D).

We are trying to make publications available so beginners can see the broader picture, see the links 
Early Years  

goo.gl/y2Zlud

and  Chuck,s Programming a Problem Oriented Language goo.gl/SVRdyF

As you probably know, you can download the classic " Starting Forth by Leo Brodie " from www.exemark.com for print, and read offline rather than the same on the FORTH INC website.

All the Best for 2015 to the Fignition Group

Julian Skidmore

unread,
Dec 31, 2014, 7:19:27 AM12/31/14
to FIGnition

Hi guys,

Thanks for the reply, I can see you've put a lot of effort into the ide and of course forth is cut out for control applications.

You're free to hi-jack the FIGnition firmware; say by taking the OS part of the 0.9.7 firmware on git hub and integrating amforth.

https://github.com/Snial/FIGnition

http://amforth.sourceforge.net

Then you could get an ANS forth compatible controller with a video display; 8kb/32kb of ram for data workspace and 0.5Mb of flash storage, and finally about 10 or so free I/O pins. That could do things most cheap controllers don't.

Forth is a naturally fragmented community because the compiler / interpreter is simple enough for one person to develop/modify/retarget and scalable down to a few KB (if you ignore ans compatibility). Mark Willis's turbo forth for example is a fantastic TI-99/4a forth. Toddy forth for the ZX81 is lots of fun. Jupiter-ace forth is still the benchmark for a forth based standalone computer.

The wider programming community is really no different, with new languages or new combinations of frameworks/languages being spawned all the time. With every new one, you find that it will do what its creators wanted, that its enthusiasts will claim it does everything & its users will find sufficient issues to decide embark on a new language/framework. This happens because modern languages and IDEs are too complex to be fully understood, so it's easier to cobble together something new. And every new language/framework adds n-1 interfaces that need to be written for other languages. This sets the scene for the same process to be repeated again.

More coming soon...

-cheers Julz

David Buckley

unread,
Dec 31, 2014, 12:04:39 PM12/31/14
to fign...@googlegroups.com
Juergen
I am one Fignition owner who definitely wants to do more than video programming and if the Fignition had a proper method of loading programs and getting data in and out I would be a power user.
If it did it would be an ideal robot brain since the dictionary can be forgotten and loaded on the fly by a running program - at least it could with the OS on my Fignition. Going into the Kitchen - forget the Living Room words and load the Kitchen words. No having to compile on the PC and download. It would make the Arduino look silly (which it already is).
I don't really care that it doesn't have spare pins, standard serial in and serial out would be fine, it could then talk to another chip and get it to wiggle pins and read sensors. I could also transfer data and programs from a smart phone.
My latest small robot has about 15K of Basic, equivalent to about 45K of Arduino-C, and over a hundred robot commands assembled into interpreted robot programs in an external EEPROM.
 
I live in hope
David
Reply all
Reply to author
Forward
0 new messages