I need to use C language.
markuster
Posts: 184
Hi,
I want to buy the Propeller but I don't want to buy the C compiler.
I saw that the trial version is 45 days. After 45 days the the code is reduced to 2k.
But I would like to know if there is an other difference with the commercial edition.
Thanks, Mark.
I want to buy the Propeller but I don't want to buy the C compiler.
I saw that the trial version is 45 days. After 45 days the the code is reduced to 2k.
But I would like to know if there is an other difference with the commercial edition.
Thanks, Mark.
Comments
Edit: I just went to pick the link... http://forums.parallax.com/showthread.php?p=795326 but someone posted it alread
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the home of pPropQL: propeller.wikispaces.com/pPropQL
pPropQL020: propeller.wikispaces.com/pPropQL
OMU for the pPropQL/020 propeller.wikispaces.com/OMU
LOL - looks like someone beat me to the post
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Brian
uController.com - home of SpinStudio - the modular Development system for the Propeller
PropNIC - Add ethernet ability to your Propeller! PropJoy - Plug in a joystick and play some games!
SD card Adapter - mass storage for the masses Audio/Video adapter add composite video and sound to your Proto Board
if you want to save money learn SPIN. The programming-language delivered for free with the propeller
SPIN is close to C. If you are a good programmer in C
you will learn SPIN within three days.
If you are no c-programmer yet it will take you 8 weeks to learn some C
and it will take you just 3 weeks to learn a lot about SPIN
best regards
Stefan
Sorry to be so frank. But you either don't know C or you don't know SPIN.
Or both.
SPIN is lightyears away from C, even from stripped down dialects like TinyC or such.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Two semesters of C classes is just the beginning knowing C.
Such a big investment one of many reasons it's hard to let go [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
Sorry to disagree, but I've said several times before that Spin is close to C and I still believe that.
1) The basic units are the hardware storage units (byte, word, long word)
2) The basic operations are the "hardware" operations. Even if you just consider the actual operations supported by the native cog instructions, most of the operators have direct instruction equivalents
3) The control structures are fairly primitive (though very convenient) and easily translated into efficient code
4) Overall the language is well matched to the underlying hardware
What clearly makes the difference is (inclomplete list):
* rich set of types, even richer with ...
* typedefs
* structures, unions
* includes
* type-checking
Sorry, I don't want to start a flame-war. But when I read that C is close or similar to SPIN, I'm going nuts. Completely nuts!
I started C at about 1980. Initially I hated it (that was my Pascal/Modula-time, for an excuse). But as time went by, I liked (I don't love C) it more and more. And clearly prefer it over C++.
I'd pay $$$ for ObjectiveC on the propeller.
Peace!
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
lack of data structures lack of strong data type function signatures lack of function pointers lack of native preprocessor support lack of typedefs extra array looking bit manipulation statements larger number of strange operators lack of ternary conditional operator different arithmetic order of operation rules with binary shift Visual Basic like comments usage of braces for comments Visual Basic like equality comparison the strange idea that =< means less than or equal to the strange idea that => means greater than or equal to tilde ~ meaning somthing other than binary not using "repeat n for" instead of the "for" syntax using repeat instead of while having an "ifnot" statement having a way to reference object functions without manually building data-structure pointers useful idea that whitespace indent is required even by freshmen programmers [noparse]:)[/noparse] using " " to define a byte character using $ for hexadecimal notation allows strange number notations like % for bits, %% for nibbles allows using "_" in numbers much like verilog and last but not least requiring the string statement to declare a string like "hello world"
This is not a criticism of spin, it is just a list of differences (incomplete i'm sure) for someone who might know C and would consider learning spin.Cheers
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
SPIN is the language of the Propeller. Actually it is PASM but the Propeller is a very
able bilingual and Spin is its 2nd equally versed language.
If you were able to speak to a person in his native tongue would you not
prefer to do so than if you had to have to hire a third person to do so for you?
Of course this is predicated upon you being able to learn the native tongue easily.
If you are a versed programmer you should be able to VERY EASILY learn Spin in
a day or so. If you are not an experienced programmer in general then you·might as well
learn Spin and get good at IT as opposed to starting with C anyway.....it would REALLY
behoove you to do so.
If you are already a C programmer then by all means go ahead with a C flavor for the
Propeller....but it is going to take you just as much time to learn·the particular
flavor of C and what you have to do to make it work for the Propeller as it would take
you to learn Spin.....assuming you are able to learn a simple language easily.
This whole language debate thing reminds me of when I took my·wife (Bostonian)
to London.·One day the Porter spoke to her and asked her a question. She looked at me
with bewilderment in her eyes and asked me what was the guy saying. I had not paid
attention to the guy and thought that he may have spoken to her in some foreign accent
that she could not understand.
So I asked him to repeat. To my amazement he was an Englishman who spoke English with
a London accent (not cockney just London English). My Bostonian wife had never been outside
the North and South Eastern region of the USA and thus could not comprehend an Englishman
speaking·perfectly good English with a London accent.
She truly could not understand a word he said. As far as she was concerned he could have
been speaking German. To make her get used to the accent I bough for her Monty Python
VHS tapes, but unfortunately she just did not appreciate the humor or the accent.
This happened many many years ago (too many) and I still till today think about it whenever
any kind of language debate (human or computer) is raised.
Versatility is the name of the game when it comes to programming in general and with
microcontrollers in particular. BE VERSATILE......LEARN MORE ...... EXPOSE YOURSELF to more
than your "native tongue"........SPIN is a pleasure to learn and use (I love it) and besides being
FREE it is also the language of the Propeller. If you want to use the Propeller most efficiently
you really ought to program it in Spin and/or PASM....
Regards
Sam
·
SPIN OTOH is a one of kind interpretive language tied to a single controller.
That said, I wouldn't try learning C on a micro. I'd get a copy of Turbo C and train on that for at least a month to get the basics of the language down. Then pick up a book on embedded C programming(check Amazon).
Hmmm ... why not? As soon as you have a serial connection working, you have won! Brings back that warm console-feeling.
Obviously, there are many ways to look at the SPIN/C/$Language-controversy.
For an hobbyist (unexperienced, or almost unexperienced with other µC): SPIN
For an experienced with a bunch of µC on his background and with C-experience: Try SPIN for a week or so, then decide by yourself
For an professional who needs to make his things done and who has a pile of tested and profen libraries: C
But however you decide, have a look at the Asm. Especially for an experienced one, this is a completely freshening way to do things. Very interesting and worth the time spent learning.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
The things Spin lacks that C "has" (hi jazzed!) are also largely lacking in dialects of C which are targeted at platforms like the Propeller. The things that are just plain different mostly have a 1:1 correspondence with something else in C.
The thing I like least about C, its stream of character syntax which makes C obfuscation contests possible, is there because C was designed to not only run on a PDP-11 but to compile on one too. Now that that limitation no longer exists we still have to put up with the curly bracket syntax which makes every conditional and control block structure end with the same character, so that unless you indent very carefully it is almost impossible to tell which of these --> }}}}} is the one that terminates the third level FOR loop.
I would further say that if you want to learn C, learn it on something like the Prop or Arduino, not on the PC because if you learn it in an environment with an advanced IDE, debugger, and all kinds of fancy helpful tools, you will be lost when you try to use it on a more limited platform. C became popular because it is so close to (and therefore nearly as powerful as) assembly language, but if your C dialect hides all the assembly level ugliness from you then you aren't really learning C, you're learning Javascript with exceptions.
If you seriously want to use the Prop, you should learn Spin and pasm no matter what, because there are things you can do in Spin and pasm you simply cannot do in any of the available C dialects. C that compiles to the LMM is going to be much more wasteful of Hub RAM than Spin and slower than pasm; C that compiles to pasm is going to be much more memory wasteful than actual pasm, which is a big deal in 512-word cogland, and C that compiles to byte code with an interpreter is Spin with different syntax and probably less functionality, since the Spin interpreter is very finely tuned to do as much as possible while fitting in a cog.
Incidentally, it is worth mentioning that the Spin interpreter does a bit more optimization than some people might realize. You're taught in the tutorial to use the postfix operator to set a bit like this:
myvar~
But this is a lot more readable, and generates exactly the same object code:
myvar := true
Spin object code is probably closer to FORTH than anything else and I wonder if anyone has tried using the Spin interpreter that way.
If your a professional or experienced programmer you should be able to pick up almost any "normal" block structured language from ALGOL upwards with out a sweat.
If you are a beginner and have settled on a Prop then for gods sake save yourself a lot of pain and use Spin. That combination is one of the most straightforward programming systems to get into ever. Embedded or not.
If you really have a bucket of C code already that you want to run on the Prop, shell out for the ImageCraft compiler or try Catalina. Be aware, that bucket of code may not fit in the limited space of the Prop and will not have the speed of say an AVR compilation.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Post Edited (heater) : 7/3/2009 7:38:56 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com - my site my 6.250MHz custom Crystals for running Propellers at 100MHz
Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
localroger: "so that unless you indent very carefully it is almost impossible to tell which of these --> }}}}} is the one that terminates the third level FOR loop."
I might say for Spin:
"so that unless you indent very carefully it is almost impossible to tell which block is the one that a particular statement belongs in"
That is, when a statement accidentally get shifted out of place I have a hell of a time figuring out, again, in which block it originally belonged.
Try cut and pasting some code snippets from this forum into the Spin tool and you'll see what I mean. Drives me nuts[noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Big quote snipped ....
{{{{{{{ BTW, Syntax highlighting is a wonderful thing [noparse]:)[/noparse] }}}}}}}}
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
Post Edited (jazzed) : 7/3/2009 9:07:37 PM GMT
That said, how 'bout the difference between this:
}}}}}}
and this...
wend
end if
next
loop while c = 3
end if
The end of that FOR loop is a bit more obvious in Visual Basic.
Damn, did I really say that? I fixed that sentence twice and it is still gibberish. Now I can't fix it again as it's been quoted and quoted. Oh, and now I've quoted it again....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
From someone who only likes assembler and sometimes C, learn Spin. It saves quite a bit of effort, it is compact, high level, and its speed can be increased using one of the few alternative interpreters around or write those time critical pieces in asm. The propeller is multi-core so think in parallel. Going back to monocres will be... hard!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the home of pPropQL: propeller.wikispaces.com/pPropQL
pPropQL020: propeller.wikispaces.com/pPropQL
OMU for the pPropQL/020 propeller.wikispaces.com/OMU
@localroger, Regarding debug code, I've fallen into a really bad habit lately much like using #if 0 ... #endif. Spin lets you combine comments and abusing that has become very attractive (the problem comes from using it too much). Just for amusement, consider this (no it's not spin, but you can do the same to temporarily block out code):
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
I like the repeat (blah loop)
Much more flexible...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
To be fair, I haven't tried any of the C compilers for the Propeller yet, but the software/library support for Spin is so good, I can't see trying a C compiler just to get some code portability, since I'll lose a lot of functionality from the contributions of the majority of users using Spin. I really just like the simplicity of the whole system... I can make it do pretty much anything I want, and I can write the code to do it very quickly. My biggest problem is the lack of native floating point (if even in the language). When I write code using the floating point libraries, it ends up looking REALLY ugly because of all the two argument functions (i.e. x*y*z is fMath.FMul(fMath.FMul(x,y),z)).
DogP
I like those discussions. Because they make it easier to judge one's knowledge.
I have the feeling, that at least 50% of those voting against C and pulling out this & that argument have no long-time experience with C. They even can't distinguish between IDE / OS-related libraries and the bare bone modern C language by itself with all its standard libraries. Read a book of P.J.Plauger ("The C standard library" and others) to get things straight and to understand what the language is. And don't be blinded by the fuzz and mess MS introduced. I personally no longer touch that Smile. Done it too long.
But a nice C99 with an allmost complete set of libs is a charm to work with.
Oh, and should still be there somebody wanting to learn C and have a perfect (well almost, no ASCII table at the end) book on his shelf: "C in a nutshell" by Peter Prinz & Tony Crawford from O'Reilly. Damned good book!
Nick
PS: Don't forget: I once hated C!
And I earned my living with: Basic, Pascal, Modula, C, C++, ObjectiveC, Java, NewtonScrip, PL/SQL (oh my GOOOOOOD! that made my cry) and a few Assemblers.
Played around with 6502, 6809, 808X, SC/MP, 68000, PIC, AVR, Oberon, Eiffel, Occam, PL/1, my own languages, Fortran, SPIN ... WTH!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Post Edited (Nick Mueller) : 7/3/2009 10:26:46 PM GMT
snprintf
RTFM!
You can gamble, but you don't have to.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
But quite a few of the embedded compilers I've used still allow floating pt even if the system doesn't have FP hardware, just using software routines. While yes... you definitely need to evaluate whether or not you should be using floating point, I don't think my code readability should suffer greatly because of it.
DogP
·
A program written in Standard C under MSC would not compile under Borland or under Watcom or under
GCC or under ............
·
Even a program written in MSC 4 would not compile under MSC 6 without a lot of changes and rewriting.
·
The myth that C is standard for different Microcontrollers is even more of a joke.
·
Each controller has registers and memory maps and and and and and that make it impossible to compile a program
written for one microcontroller to run on another without TONS of changes and customization and fiddling etc.
·
·
All the arguments of the advantages of portability are only applicable for COMPUTERS that are on the same level
of computability...... ie you may (perhaps) be able to port a standard C program written for a PC to the Mac or
a System 360 or a PDP 11.............HOWEVER........your program has to pretty much be a SIMPLE one that is
not doing much OS interaction or Graphics or Sound or Mouse or Keyboard or or or .................
·
The moment you start to write a program in C that does anything important with the hardware is the moment
you have kissed the STANDARD aspect goodbye......................
People who mention that SPIN lacks things like Structures are TOTALLY missing the point of what a
microcontroller is used for..................microcontrollers are not meant to be a replacement for a Computer
like the PC or Mac...................unless you·want to wind the clock back 40 years and remain content
to use the propeller as a supped up 6806 or Z80....................
·
The Propeller's power is in being a POWERFUL MULTITASKING, Parallel Processing MICRCONTROLLER................
not an Intel Duo replacement..............
·
·
Sam