Spin interpreter over serial?

Hey guys,
is there any way to access the Spinterpreter over serial? Kind of like how I can access a Bash prompt over serial on the Raspberry Pi?
I'm learning spin and I want a Spin prompt where I can just play with the language and get instant feedback.

Thanks!

Comments

Spin isn't interactive that way. Thankfully, though, you can knock together a bit of code and run in RAM -- the process is fast since the EEPROM doesn't have to be written. I am reminded how much I enjoy this every time a friend asks me to help them with Arduino code; it's a very slow process to download and run the tiniest programs on that platform.

As JonnyMac posted you cannot make spin interactive that way. What you can do is write and download a simple program that performs a single function and sends the result to PST. Then that single function can be changed to some other function and downloaded.
The Spin compile, download, and execute is so fast that it is almost like having an interactive interpreter.

In science there is no authority. There is only experiment.
Life is unpredictable. Eat dessert first.

Maybe the terminal code could be adapted to work on a serial terminal, instead of TV.
It doesn't look like its been worked on in quite awhile, but the links on the referenced site seem to work still.
I've never tried it myself...I think I was too green back then. Having dug it up, now I want to try it...

Hey guys,
is there any way to access the Spinterpreter over serial? Kind of like how I can access a Bash prompt over serial on the Raspberry Pi?
I'm learning spin and I want a Spin prompt where I can just play with the language and get instant feedback.

Thanks!

"Spin" itself is not designed as an interactive language since the compiler runs on the PC and simply generates Spin byte code (and assembly if included) which is run by the Spin byte code interpreter in ROM on the Propeller. This is not an interactive terminal interface "interpreter", it is a VM that simply reads compiled byte codes and decodes and executes them etc.

If you want interactive you should have a look at my Tachyon, you can even interact with FAT32 files on SD and over the Internet etc.

Here are some simple one line "scripts" which could run from the serial port or even create a new definition with as shown. The ASCII character script takes less than 4ms to execute at 921600 baud but 672us if not limited.

Maybe the terminal code could be adapted to work on a serial terminal, instead of TV.
It doesn't look like its been worked on in quite awhile, but the links on the referenced site seem to work still.
I've never tried it myself...I think I was too green back then. Having dug it up, now I want to try it...

Cheers,
Jesse

I built Michael's Sphinx compiler into my Prop OS. I didn't do a lot of testing but it did compile correctly. Instructions and source is in the link in my signature.
Sorry, but you will need an editor on the prop. I don't know of any

The Sphinx compiler has also been ported to the Spinix OS. There are also 3 different text editors that run under spinix. You can also run Forth under spinix using the pfth Forth interpreter. You can also write simple Bash scripts using the shell that runs in spinix.

However, even if you can get Sphinx running you still don't have an interactive language. You still have to go through an edit/compile/run sequence. I think Tachyon (and pfth) and FemtoBasic are the only real interactive languages. My ebasic works but it isn't really complete enough to do much with.