A Scripting Language for the SPIN2 - Interpreter? - Thoughts?
Hi,
this is just an idea at this moment. Perhaps you would like to comment?
The basic idea is, that Chip's SPIN2 interpreter is a stack based machine, which interprets a very compact type of bytecode using the fast XBYTE mechanism of P2. I cannot say, that I do fully understand how it works. :-) But I do have the impression, that a Forth interpreter/compiler could be written for this machine. Yes, I know, that not everybody loves Forth, but it's simply rather simpel to write a Forth interpreter/compiler. Much simpler, than writing any other compiler. As it is simple, it can be rather compact. There is one bigger hurdle however: SPIN2 uses a single stack, while Forth needs a second stack. Forth consists of many small procedures, called "words", so it needs a fast way to call subroutines and return from them. SPIN2's calling mechanism is too complicated, I think. I have a vague idea, how to implement the second stack....
This would use a SD-card for a file system.
There should be an interface to call SPIN2-routines from Forth and also to call Forth routines from SPIN2.
It would be nice, if the multitasking of SPIN2 could be used, it's rather Forth-like anyways....
Suggestions, comments?
Christof

Comments
@"Christof Eb."
Forth has intrigued me in the past BUT if I can't grasp something, relatively easily, it's of no use to me. As more of an integrator, I just need stuff to work.
Despite the snobbery in the MCU world, BASIC is still growing.....because it's child's play. In the PLC world, we now have ST (structured text) that is arguably BASIC that has been modified to avoid using the B-word.
I started building industrial controllers using QuickBasic and to be able to make quick modifications without having to reset the entire process was a huge advantage. Everything I do has a BASIC interpreter on the front end. Why waste precious Prop resources on mundane tasks.
Here is an example of a multitasking BASIC on a high-end controller: