Spin and C
hacktorious
Posts: 72
I've read some posts pertaining to Spin vs. C. However, I'm not certain I see much of an advantage of using Spin. I currently already know C and use it to program Arduio.
Is it really worth learning Spin just for the Propeller? I guess a good question would be, what can I do with Spin that I cannot do with C?
C seems to be much more of a standard than Spin as well, which is another major factor.
I do know Python and Ruby, and spin seems somewhat similar.
Any thoughts?
Is it really worth learning Spin just for the Propeller? I guess a good question would be, what can I do with Spin that I cannot do with C?
C seems to be much more of a standard than Spin as well, which is another major factor.
I do know Python and Ruby, and spin seems somewhat similar.
Any thoughts?
Comments
Not so easy to answer... Search the forum or google spin vs C, and you'll see it has been brought up a lot.
IMHO, use C and while you're at it, try SPIN anyway You don't have to master all of SPIN to do common tasks and there are tons of example code.
There seem to be a lot of Spin vs C threads that if you read through them, most questions should be answered.
I'm not picking on you, your PEK questions were specific to a problem you were having and good posts that would be hard to search for but it seems like every week or so we go through the this vs. that questions that could be searched for.
You can use all the code in the OBEX which is no small thing.
If you know C what's it to learning Spin? Drop the brackets and semicolon and remember to use "=<" not "<=".
I used C a lot before using the Propeller. I was soon glad to be rid of the brackets and semicolons.
Ken Gracey recently mentioned all their commercial uses of the Prop use Spin and PASM. C is to keep the educational sector happy.
Learning a new language will make you better programmer. If you start throwing up uncontrollably while writing a program ... well at least you'll know better next time.
1) I believe Spin still produces smaller code than the C compiler for the same functionality.
2) When you need speed the PASM assembly language is an integral part of Spin. It's so much easier to use that the C/asm combination and the PASM syntax is nicer.
3) There is the OBEX repository of ready made objects every thing from serial communications to VGA graphics to sound synthesis etc.
4) The Prop Tool is about the simplest quickest programming environment ever. Or use BST or now SimpleIDE.
If you know C you owe it to yourself to spends a few evenings studying the Propeller manual and Spin and PASM. What you don't get from these discussions is the sheer elegance of the whole system from the Prop hardware architecture, the instruction set, the assembler language the Spin language the integration of the whole all the way to the Propeller Tool. It's a great lesson in design. Worthy of a little study even if you end up not using it.
Is it possible to access multiple cogs with C? I've not found much good info on this. Thanks.
In propeller-gcc anytime you use cogstart or cognew, you're getting access to multiple cogs.
The cogstart function is used to start a C function running in a COG.
At this time cogstart can only be used with CMM/LMM modes.
The cognew function is used to start a PASM, GAS, or COGC program.
Thanks. I'm reading through the links you have in your signature. This looks like great stuff, however, I feel the C stuff is lacking in documentation compared to spin.
Propeller C is still new.
It is in it's Beta stage after all.
Parallax seems to be gung ho on C. The ActivityBot only has lessons in C.
It will be interesting to see which becomes more commonly used Spin or C.
I like C but I like Spin more.
I have links to Spin (and PASM) tutorials in post #3 of my index (see signature).
No. Propeller-GCC version 1 is released. There are on-going updates getting ready for P2.
SimpleIDE is in production and will have more refinements.
Parallax has full tutorials for Propeller-C. More will be added as time goes on.
Parallax has invested effort in Propeller-C because their largest market requires it.
Apparently I haven't been keeping up with this aspect of the Propeller.
Thanks for the correction.
I'm sure I'll take the plunge into learning Propeller-GCC but I've just grown very fond of Spin.
I do have several projects which would benefit from being able to use larger programs. I purchased one of Parallax's Propeller Memory Cards in preparation of experimenting with C.