Spin or PropBasic
VonSzarvas
Posts: 3,522
Hi Proppers !
I completed a project work with SX/B some time ago, and really enjoyed the Parallax experience! Now I am happy to have been "assigned" a new project, and I am seriously thinking about the Propeller.
I have already purchased the Customizing book (very nice), and also the usb proto board, propplug, etc. So I am set to experiment and learn!
The first chapters of the book lead me to a big question though! Language choice ! .... As I am starting from scratch, which to choose!
From what I have read I would start by saying that I feel fine about learning/using Spin (it seems really logical to me).
However, it seems (to me) that Spin is interpreted by the Propeller, whereas PropBasic is compiled to PASM - which would then not need interpreting nor reserved stack workspace/longs. And therefore PropBasic will execute faster (much "faster"?) than the same program in Spin. And also (perhaps) require less ram - so I could fit in a program with more commands using PropBasic than I could with Spin ?
I also like the idea (as with SX/B) that I can see the created PASM, and therefore have the chance to further "tweak" - should I be so bold.
So I think I already sold myself onto starting with PropBasic...
Does this seem like a reasonable decision ? If not, why should I choose Spin instead of PropBasic ? What am I missing ??
Thank you!
Max.
I completed a project work with SX/B some time ago, and really enjoyed the Parallax experience! Now I am happy to have been "assigned" a new project, and I am seriously thinking about the Propeller.
I have already purchased the Customizing book (very nice), and also the usb proto board, propplug, etc. So I am set to experiment and learn!
The first chapters of the book lead me to a big question though! Language choice ! .... As I am starting from scratch, which to choose!
From what I have read I would start by saying that I feel fine about learning/using Spin (it seems really logical to me).
However, it seems (to me) that Spin is interpreted by the Propeller, whereas PropBasic is compiled to PASM - which would then not need interpreting nor reserved stack workspace/longs. And therefore PropBasic will execute faster (much "faster"?) than the same program in Spin. And also (perhaps) require less ram - so I could fit in a program with more commands using PropBasic than I could with Spin ?
I also like the idea (as with SX/B) that I can see the created PASM, and therefore have the chance to further "tweak" - should I be so bold.
So I think I already sold myself onto starting with PropBasic...
Does this seem like a reasonable decision ? If not, why should I choose Spin instead of PropBasic ? What am I missing ??
Thank you!
Max.
Comments
I looks to me that you have made up your mind.
I first started to work with the propeller in spin.
Basic is easy to use and converting from Basic using the BS2 to PropBasic with the Propeller was an easy transition, the chance to learn PASM was also a great benefit.
Rob
Had Propeller BASIC been around back when I started in '07 I'm pretty sure I'd still be playing with it.
Having starting in Spin, I can tell you that it is rewarding and not nearly as daunting as it looks! [noparse]:)[/noparse]
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Coming soon to a browser near you! PropellerPowered.com
Visit the: PROPELLERPOWERED SIG forum kindly hosted by Savage Circuits.
Maybe that is myth ?
Otherwise, I would like to choose Spin - it seems a really well constructed, brief and logical language (well done the author!), and the Obex is full of great starter blocks !
...Mind - The Obex also has P/ASM objects which can be dropped into PropBasic (as I understand it).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Short answers? Not available at this time since I think you deserve more information than you requested.
How about "Insufficient information received to formulate an adiquate reply" as an opposite tag ??
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Style and grace : Nil point
Not sure what this has to do with Spin and PropBasic comparisons though.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Short answers? Not available at this time since I think you deserve more information than you requested.
Post Edited (jazzed) : 3/10/2010 10:03:48 PM GMT
Bean or one of his testers might be able to present some relevant comparisons.
Spin byte code is typically smaller than PASM-like language output though.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Short answers? Not available at this time since I think you deserve more information than you requested.
The OBEX is one big benefit of using spin. But PropBASIC is easier to get started with (in my opinion).
PropBASIC has alot of commands "built-in" that would require objects in spin (serial, SPI, I2C, etc).
It really does depend on your needs. Since spin is the "official" language, I think you should at least of an understanding of it. Spin is not that hard once you use it a little bit.
As for code size, I'm not sure about that. It's probably pretty close to even. If you put often used PropBASIC commands in a subroutine, PropBASIC is pretty tight code.
PropBASIC does have the 496 instruction limit, but that is per task. And you can use LMM if you run into that limitation. LMM runs about 5 times slower, but is still way faster than spin.
I'd say try out both and see which one meets your needs.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
·
I used SX/B for a while for some small projects. It was a nice program. The SX debugger was also a helpful tool.
The only part about Spin that's not *free* is the investment in learning another language for newer programmers.
Do you have a method for using all the chip's resources today? That is can you write a 32KB PropBasic program like in Spin?
When will you include LMM as part of the PropBasic run-time?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Short answers? Not available at this time since I think you deserve more information than you requested.
LMM is already part of PropBASIC. So yes you CAN make a 32K propBasic program.
To use LMM you just add LMM to the PROGRAM line. Like: PROGRAM Start LMM
Each task can be either native code or LMM too. Just add LMM to the TASK line. Like: TASK MyTask LMM
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
·
--Cheers.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Short answers? Not available at this time since I think you deserve more information than you requested.
humanoido
All VARs are still in COG memory so they are limited to 496. But that's a lot of variables.
Of course HUB vars and DATA are still in HUB memory as always.
LMM is kind of an undocumented feature. We needed to draw the line so the documentation could be finished without a moving target. But it does work with everything I've thrown at it.
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
·
496 VARs in COG memory seems to be a very theoretical value ;o) Who'd have access to these 496 variables?
What size do your HUB memory pointers and jump addresses have? Is it possible to exceed the 32k limit?
Is it possible to write IR detection programs , like IRremote , with PropBasic?
JonnyMac has posted SIRCS code on the PropBASIC thread, page 7:
http://forums.parallax.com/forums/default.aspx?f=25&p=007&m=412552
Regards,
T o n y