Understanding the Parallax Interpreter
microcontrolleruser
Posts: 1,194
When you try to compare PBasic to other languages there's something that doesn't fit.
You have to 'add in' the Parallax interpreter.
On second thought. Who adapted the idea after the PBasic?
Parallax did! Used it again on Propeller.
Yet. Unless I'm mistaken. I have never seen it used by anybody else.
You have to 'add in' the Parallax interpreter.
On second thought. Who adapted the idea after the PBasic?
Parallax did! Used it again on Propeller.
Yet. Unless I'm mistaken. I have never seen it used by anybody else.
Comments
FemtoBasic is an example of a mostly source-level interpreter. Internally, keywords are replaced by single byte codes to simplify parsing, but most of the rest of the source code is kept as-is while being interpreted.
Spin is an example of an interpreter of an idealized instruction set coupled with a compiler for this instruction set. The instruction set is optimized for program size rather than execution speed and many of the operations are specific to the Prop1.
This is a "fundamental concept" in most programming education
Well. How about that! Looks like a lot of languages are interpreted.
See the Wikipedia article here.
https://en.wikipedia.org/wiki/Interpreted_language
As far as micro's I have not seen any others use an interpreter.
The languages can be user friendly like PBasic yet they are still compiled.
With that pesky waiting time while they compile each time you change the program.
Gee.Thank you for pointing out that I lack the refinement to appreciate the interpreter and the Propeller.
'Let it be written. Let it be down'.
Thank you. You've done me a favor.
I'm just down here with the masses that hear 'slow' and that sends them running.
Not all of us are interested in mental exercise' for it's own sake.
Some of us have things to do.
We're interested in getting things done in the most direct manner.
You can consider that passed on to you by a tech higher up.Form him to me to you.
Wish I could remember the vendor name. Digitec or some such?
How can you "get things done in the most direct manner" if you don't understand the concepts involved and the issues that define 'direct'?
My only interest is if an interpreter 'toolkit' for a micro is doable and available.
Right now it looks like it is either too involved and not readily available.
I have not seen 'Interpreter Toolkit' pop up at all over the years.
Thanks.
Better use of the time would be article of 'Tips for Beginner's' for assembler and C.
Sort of apply the Parallax 'simple' method or however they write.
The PICaxe WJEC assembler achieves the same goal as Parallax language yet keeps it as compile.
In that the commands are macros plus a few features to get past the configuration.
Plus they have a smooth program load. I forget how.
I think that is a good middle road. Parallax used that for SX.
Taking on interpreter is to unwieldy for the hobbyist.
In fact the PICaxe assembler is VERY like the Parallax SX.
Stick with other micro controllers for learning assembly since the Prop1 (which is very easy to use) doesn’t appeal to you. Find one that makes sense to you, that you enjoy using and that has tools available that you find comfortable to use at a price that you can afford. The SX is effectively discontinued even though Parallax will sell off stock-on-hand that they don’t need for making Stamps. Parallax doesn’t support PICs ... that’s Microchip’s territory.
'Parallax seems to have very little interest in supporting assembly language as a beginner’s topic '
Looks like PICaxe crew are a bright bunch to me.You say it's a waste of time though.
To be quite honest the PICaxe compiler trounces the Stamp IDE.
For the simple reason PICaxe stuck with it.
Back to the interpreter.
Better to leave that be and just write 'Tips for Beginner's' for assembly and C.
If you are looking around for BASIC on small MCUs there is also BASIC52 and BASCOM51, that support various 8051's.
If you like Pascal, there is Turbo51 - that's compiled.
You can get a breakout board with a Bootloader and modern Flash 8051 (N76E003) for just $1.10, that would allow modest programs to download/run over a common USB-UART bridge.
Also runs on the nRF52832 micro: https://www.espruino.com/MDBT42Q,
the ESP8226, ESP32 and BBC micro:bit.
If you want an "interpreter tool kit" get Jerry Script from Samsung: http://jerryscript.net/
Or people have used Lua on microcontrollers: http://www.eluaproject.net/
Does The Lua work on the Prop1 too?
Try this
https://forums.parallax.com/discussion/164187/fastspin-compiler-for-p2/p1
I have no idea what the memory requirements of Lua are except we can be certain that they are far bigger than the 32K of the Prop 1. It would also be painfully slow.
Hello!
SDS? Themselves actually. That was one of several startups who surfaced about the time IBM started building their systems. It eventually evolved into the computer division of Xerox. Oh and DEC got started about then as well.
Xerox had a few good ideas, and one great one. It didn't go as planned, and yet we run something based on it. (Well some of us do.)
That's how I got started in programming, I also did a fair bit of Assembly on them.
But yes I agree entirely with everything Mike has stated there.
But the Propeller chip has many interactive interpreters, primarily Tachyon Forth:
Straight up from a serial console is about as direct as you can get
or turn that demo into another word that the "interpreter" understands and run it:
Or print that over VGA very directly with "VGA DEMO" etc
But interpreted doesn't have to mean slowwww. I can find out how long 1 million FOR NEXT loops take: That's 600ns per loop overhead which is mighty snappy for an interpreter.
I can't remember how the symbol table was handled, though.
-Phil
YOWF! Sorry about that one, cat at work here.
However by the time of the Apple 2Plus design the method of doing so was considerably better. By the time of the Apple 2E things had improved to the point where I'd type in the classic several hundred line program, save it, and run it, and get no errors, and a splendid output in graphics to match.
By contrast MS BASIC on the PC was a poorly fit kludge, they took the one he wrote for the Altair and shoehorned it in. By the time we got to DOS 3,30 things were considerably better. Eventually we had professional development tools.
I can go on, but all of you do see my points.
Not sure if this was a commonly used method but the one I recall stored each unique symbol in a table along with a pointer to the address following the token. Each re-occurence of that symbol resulted in a pointer to the address location of the previous token that used that symbol, creating a linked list of all the references to that symbol. Once the address of the symbol was resolved the list was used to replace the links with the actual address.