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

  • 13 Comments sorted by Date Added Votes
  • 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.
    Jon McPhalen
    Hollywood, CA
    It's Jon or JonnyMac -- please do not call me Jonny.
  • Thanks! However, I don't know how to write such code to make the Spinterpreter interactive.
    Can you provide me with the code, or at least tell me how?
  • 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.
  • If you want a powerful interactive language for the Propeller try Tachyon Forth.
  • Or prop basic.
    Do not taunt Happy Fun Ball! @opengeekorg ---> Be Excellent To One Another SKYPE = acuity_doug
    Parallax colors simplified: https://forums.parallax.com/discussion/123709/commented-graphics-demo-spin<br>
  • potatohead wrote: »
    Or prop basic.
    PropBasic is not interactive the last I knew.

  • Maybe not exactly what you're looking for, but possibly close enough? @mpark 's Sphinx:
    http://forums.parallax.com/discussion/114023/sphinx%C2%97as-seen-at-upew

    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
    --
    WIP Spin drivers for various devices: lsm9ds1 IMU (SPI), Newhaven 4x20 OLED (I2C), Melexis 90621 Thermal imager (I2C), SHT3x Temp/RH (I2C), SSD1306 OLED (I2C), AMS TCS3x7x RGB Color Sensor (I2C), MAX31856 Thermocouple Amp (SPI), BMP280 Baro. Press/Temp (I2C), Trinamic TMC2130 Stepper Driver (SPI)
  • Peter JakackiPeter Jakacki Posts: 7,877
    edited February 27 Vote Up-1Vote Down
    pico wrote: »
    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.
    ...  CR $20 FROM 95 FOR I EMIT NEXT 
     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ok
    ...  PRINT" HELLO WORLD"   HELLO WORLD ok
    ...  CLKFREQ PRINT 80000000 ok
    ...  $12345678 $7F00 !  ok
    ...  $7F00 @ .LONG 1234.5678 ok
    ...  15 PIN@ PRINT 0 ok
    

    Create a new function on the fly and execute it by name.
    ...  : HELLO PRINT" HELLO WORLD"  ; 
    ...  HELLO  HELLO WORLD ok
    ...  3 FOR HELLO NEXT HELLO WORLDHELLO WORLDHELLO WORLD ok
    

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    --->CLICK THE LOGO for more links<---
    Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
    P2 SHORTFORM DATASHEET +++++ TAQOZ documentation
    Brisbane, Australia
  • avsa242 wrote: »
    Maybe not exactly what you're looking for, but possibly close enough? @mpark 's Sphinx:
    http://forums.parallax.com/discussion/114023/sphinx%C2%97as-seen-at-upew

    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 :(

    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • 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.
  • Thanks Dave. I wasn't aware of any editors so I should take a look when I get time :)
    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • David BetzDavid Betz Posts: 12,940
    edited February 27 Vote Up1Vote Down
    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.
  • 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.

    Sounds nice.


    Novel Solutions - http://www.novelsolutionsonline.com/ - Machinery Design • - • Product Development
    "Necessity is the mother of invention." - Author unknown.

Sign In or Register to comment.