Shop OBEX P1 Docs P2 Docs Learn Events
Propeller: SPIN, C, C++, GCC. Future of Spin Tool vs. SimpleIDE? — Parallax Forums

Propeller: SPIN, C, C++, GCC. Future of Spin Tool vs. SimpleIDE?

John KauffmanJohn Kauffman Posts: 653
edited 2014-09-03 00:40 in Learn with BlocklyProp
I'm unsure of differences in languages listed. When should I use C vs C++? Why Spin over C?

I've used Spin Tool and Simple IDE. Seems last few years was examples in SPin Tool and now are in Simple What of above will continue to be supported? (Will Simple IDE evolve to handle SPIN and then Spin Tool die?)
«1

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-08-18 21:11
    The C / C++ compiler was developed because there was growing interest in using C (and C++) with the Propeller. C is a standard language and most of the competition for the Propeller uses C as the programming language. Spin was developed as a "best fit" to the design of the Propeller chip's instruction set and features. It's based on Pascal and Python partly because those are good languages and partly because that's something Chip Gracey had a lot of experience with.

    The Spin Tool is partially written in Intel assembly language and makes use of some 3rd party modules that are not cross-platform. In addition, these modules are not open-source and Parallax is committed to making as much as possible of their new tools open-source. SimpleIDE is open-source and the GCC toolchain is open-source. Currently SimpleIDE uses BSTC as its Spin compiler (and comes with that already). There's a new Spin compiler / assembler that's under development, written in C, that's open-source. It's also being extended so it will generate code for the Propeller II in addition to the Propeller I. It will also have Propeller II-specific extensions to make use of the new features of the Propeller II. The Spin Tool will not be updated for the Propeller II and will eventually become obsolete.
  • Ken GraceyKen Gracey Posts: 7,386
    edited 2013-08-18 22:34
    John, I'll try to provide a brief answer.

    If it's for your students, use SimpleIDE and C (or maybe even PropBASIC if it develops nicely). The C language will be very well-supported by Parallax. We're starting to release tutorials, and many pages are scheduled for release on September 3rd. It will make multicore very easy by turning impressive devices (SD cards, video, etc) into simple libraries.

    C runs very well on Propeller 1 for education, but for industry we're still recommending Spin/ASM due to efficient use of memory and higher control over the chip. This will change for Propeller 2, which can download a C kernel and run much larger programs.

    As much as we love Spin inside Parallax for Propeller 1, we probably wouldn't recommend it at this stage for educational customers. The tools we've developed around C are open-source, multi-platform (Mac, Windows, Linux) and very easy to use.

    You should schedule a call with one of us pretty soon. I'll be offline for several days but would like to catch up, and walk you through exactly what we're doing. So much of it I can't talk about on these forums until it is released.
  • John KauffmanJohn Kauffman Posts: 653
    edited 2013-08-19 04:58
    Thanks. These plus earlier comments by Ken give me confidence about path for porting my syllabi. What is now all in WAM & BeoBot I am re-writing for [WAM/Prop Activity Board] and the [BoeBot/PropBOE] all in C/SimpleIDE. I'll not do anything using SPIN & SPIN Tool (the core of what I was trying to figure out in the thread).
  • LevLev Posts: 182
    edited 2013-08-19 08:21
    I am glad John asked that question. I have been in the same situation, wondering which way to go. I am interested in moving to C (and SimpleIDE) because many kids are familiar with C from their computer programming classes. But, I am also hesitant because for my science club I will need a lot of C libraries for various sensors, and I am not sure to what extent the libraries will be provided by Parallax. Rewriting my class handouts and examples is a ton of work, and I want to be sure I am heading down the right path before I jump in all the way.

    A computer programming teacher and I have been discussing including embedded electronics in her C programming class which adds even more importance to knowing where C support is headed. What I have seen so far looks very good.
  • axeonaxeon Posts: 7
    edited 2013-08-21 11:03
    This sounds great. I always felt that in order to really program for the Prop chip one had to be proficient in Spin and Prop ASM, you had to learn two languages to do serious stuff with the prop. A lot of important things were written in Prop ASM, which is harder to learn. This is just what I felt.

    It's nice to see one language to unify and simplify development.

    Will there be books available soon?

    Will there be something like the obex, but for the new C classes/libraries?

    Thanks,
    TonyA
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2013-08-22 13:47
    axeon wrote: »
    This sounds great. I always felt that in order to really program for the Prop chip one had to be proficient in Spin and Prop ASM, you had to learn two languages to do serious stuff with the prop. A lot of important things were written in Prop ASM, which is harder to learn. This is just what I felt.

    It's nice to see one language to unify and simplify development.

    Will there be books available soon?

    Will there be something like the obex, but for the new C classes/libraries?

    Thanks,
    TonyA

    Hi Tony,

    Right now our focus is on web publication for a number of reasons. One, we can get new material to you much faster. Two, we can update material easily, without having to stock, and charge for, expensive printed inventory that becomes outdated far too quickly! Three, we can put just the content needed at the time in front of the reader, without the intimidation of a 400 page book. (We have had some teachers look at the thickness of our Stamps in Class texts and say "I don't have time to learn all that!" We understand.)

    Our Propeller C Tutorials are arranged into web "books" with a built-in hierarchy. If you go to the first page of any Propeller C Tutorial and click on the "Printer-friendly version" the content of all of the pages in that tutorial will be pulled into a single html file that you can save to your computer or print to PDF or to a printer, whichever you prefer. This works at any place in the book, so you could download single chapters or single pages as well. The text and images are easy to copy-paste from the html content to create classroom materials for use with the hardware. Printed books are also a definite possibility in the future, when we've past this early rapid-growth stage.

    Right now, the Simple Libraries for the Propeller C Tutorials are distributed with SimpleIDE. These are being crafted with the goal of being easy use and understand for those familiar with PBASIC, and those who are new to programming. We are focusing on providing a short path to a successful hands-on experience, with the freedom to dive deeper desired. The Simple Libraries are meant to work together well on the Activity Board, using the CMM memory model with a 64 KB EEPROM.

    Propeller C libraries are welcome on the current OBEX - there is a category for them awaiting community contributions. Going forward, libraries that accumulate here might be intended for a wider variety of audiences, perhaps using the Standard C libraries, different memory models, or support for other specific Propeller development boards (not to mention the Propeller 2...). In the future we'd also love to see some customer-created libraries here that play well with the Simple Libraries; its simpletools, simpletext, and so forth are in place to handle I/O and protocol tasks, making it quicker to put together a library for a specific device.

    As Ken mentioned, we have lots of stuff in the works, which we will start rolling out in September. So stay tuned!
  • John KauffmanJohn Kauffman Posts: 653
    edited 2013-08-22 14:24
    Steph:

    I'm cool with the material on line and the option to get it into a single file for us to print ourselves. Shipping around paper is so last millennium. And I like to add my personal notes prior to the printout which should be possible with an HTML or PDF file. I'd much rather have another component or two in the kits than to have the dead tree.

    Steph, can you say at this point that there will be these three products? If you can't say then Sept is not far away.
    Prop / C kit similar in contents and objectives to WAM around same price of $80?
    Prop / C kit similar in content and objectives to Robotics with the BoeBot around same price of $170?
    Prop / C low-cost board similar to the Homework board around same price of $50?
    These are the BS2 products that my students are required to buy for class and I'd like to stay in the same groove with the new language/architecture.
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2013-08-22 15:12
    Steph:

    I'm cool with the material on line and the option to get it into a single file for us to print ourselves. Shipping around paper is so last millennium. And I like to add my personal notes prior to the printout which should be possible with an HTML or PDF file. I'd much rather have another component or two in the kits than to have the dead tree.

    Steph, can you say at this point that there will be these three products? If you can't say then Sept is not far away.
    Prop / C kit similar in contents and objectives to WAM around same price of $80?
    Prop / C kit similar in content and objectives to Robotics with the BoeBot around same price of $170?
    Prop / C low-cost board similar to the Homework board around same price of $50? - the Activity Board is
    These are the BS2 products that my students are required to buy for class and I'd like to stay in the same groove with the new language/architecture.

    So glad to hear the web tutorial concept will work for you! Once you've saved a "book" as an HTML file, you could open that in MS Word; modification for classroom use with our hardware is well within the spirit of our educational copyright terms :).

    As far as staying "in the same groove" I think that should work out.

    1) The Propeller C Tutorials Start Simple and Simple Circuits cover much the same components as the WAM text, though with less presentation of theory. We'll be adding more theory in another layer of separate reference pages, largely re-purposing concepts from WAM and other Stamps in Class texts, that can be optionally used by educators or hobbyists that want to know "why" but won't be an obstacle set in front of the 'fun stuff' for those that just want to know "how." We are working on sourcing a new component kit; for the time being the WAM Parts Kit has good overlap.

    2) I can't quote a price for the ActivityBot coming out this fall, but it will be a great value. It will have a super-set of the breadboard-able electronic components included with the Boe-Bot, with the addition of a Ping))) sensor, microSD card, high-speed servos, encoder sensors/wheels, and my personal favorite, the O-ring tires. Also, this time we are using a compact box that is shaped to hold the assembled robot (instead shaped to accommodate a book). So, the packaging doesn't go to waste after opening, and your students can store and transport their parts easily. And yes Andy is madly working on tutorials for it behind the scenes. There is just so much one can do with this robot, that we can't delay releasing the hardware until after Andy has written everything he has dreamed up. So, we will have enough content to get you up and running with the basics, and will be rolling out more tutorials, projects, and classroom contest throughout the months to come.

    3) The Propeller Activity Board used in the C tutorials is only $49.99. Combine that with the WAM Parts Kit and you are right at the $80 requested in item #1, with far more processing power and possibilities.

    Signing off the forums now, I need to get to work on those ActivityBot tutorial pages!
  • axeonaxeon Posts: 7
    edited 2013-08-22 20:49
    Hi,

    I see. I think it's great to publish to the web, much more convenient/fast. Looking forward to all of this.

    Thanks for the info,
    TonyA
  • redheadedrodredheadedrod Posts: 78
    edited 2014-09-01 00:14
    As a Computer Science student are you saying since I already know C it would not be to my advantage to learn Spin? I know MANY languages now so learning a new one wouldn't be that hard for me. I did buy a package deal you guys had last year that contained a board with bread board and two books for like $50. I have yet to have time to play with it but just curious. Or am I better off learning Spin and also play with it in C so I would know how to convert Spin programs to C to use them?

    I have some specific projects I am trying to do where I will likely make use of libraries already done so Spin seems like the best choice at the moment.

    Thanks!
    Rodney
  • John KauffmanJohn Kauffman Posts: 653
    edited 2014-09-01 07:01
    Red:
    If you have specific objectives and plan to use available code then absolutely go SPIN. Last I checked there were only a few objects in C on OBEX. When you look at sample code for devices many are only SPIN. The exception is the Learn C tutorial which does have C code for about a dozen devices (along with good explanations of the code).

    You can certainly get any C language questions answered on fora - really smart guys are working in C (and are generous with their help). But if you want off-the-shelf complete and tested solutions then SPIN trumps. Overall, the ecosystem for C is not as well developed as for SPIN. It is catching up and will get there, but not there yet.

    Since you already know C and are facile with languages, pick up SPIN. When C objects become available the world will be your oyster.

    - John
  • PublisonPublison Posts: 12,366
    edited 2014-09-01 07:19
    Last I checked there were only objects in C on OBEX.

    John,

    Did you mean to say "only a few objects in OBEX"? I think I count three.

    Jim
  • jazzedjazzed Posts: 11,803
    edited 2014-09-01 07:48
    The number of C packages in the OBEX is irrelevant.

    The internet is full of C code and examples. The internet is the C OBEX.
    Not only that, but lots of Arduino code (which IS C++) can be used with SimpleIDE.

    OBEX is nothing more than a collection of programs that have reusable spin code: in other words libraries.

    For Propeller C specific libraries:
    The Parallax SimpleIDE C library package is big and growing.
    Martin_H ported a pretty big set of arduino code, and I add to that every now and then with the latest here.
    There are two other propeller community C library projects: SwimDude0614's propware and SRLM's libpropeller.


    --Steve
  • PublisonPublison Posts: 12,366
    edited 2014-09-01 08:29
    jazzed wrote: »
    The number of C packages in the OBEX is irrelevant.

    The internet is full of C code and examples. The internet is the C OBEX.
    Not only that, but lots of Arduino code (which IS C++) can be used with SimpleIDE.

    OBEX is nothing more than a collection of programs that have reusable spin code: in other words libraries.

    For Propeller C specific libraries:
    The Parallax SimpleIDE C library package is big and growing.
    Martin_H ported a pretty big set of arduino code, and I add to that every now and then with the latest here.
    There are two other propeller community C library projects: SwimDude0614's propware and SRLM's libpropeller.


    --Steve

    Steve,

    You are correct. There is a BUNCH of stuff out there already. I just didn't want to confuse the user in Post #11 to thinking there was mostly C code in the OBEX.

    It is primarily SPIN CODE.
  • jazzedjazzed Posts: 11,803
    edited 2014-09-01 09:55
    Publison wrote: »
    Steve,

    You are correct. There is a BUNCH of stuff out there already. I just didn't want to confuse the user in Post #11 to thinking there was mostly C code in the OBEX.

    It is primarily SPIN CODE.


    Ya, I get it. My reply was in context of the thread title and other comments as well.

    BTW, most Spin objects can be used directly in C with spinwrap. SimpleIDE will have this added later. SimpleIDE already supports extracting PASM from spin of course.

    Anyone who knows C, C++, Java, Javascript, PHP, and/or Pascal can easily pick up Spin/PASM programming. Whether they want or need to do that is usually the motivator.

    If Parallax or forum contributors could afford some time porting Spin to other MCUs and PC environments, and getting the word out, then maybe more people would want to use it.
  • John KauffmanJohn Kauffman Posts: 653
    edited 2014-09-01 10:02
    My mistake, and a bad one. I was going to write "2" then go back and check exact number. Now edited to be correct. Thanks for catch.
  • John KauffmanJohn Kauffman Posts: 653
    edited 2014-09-01 11:17
    My note for the poster to consider is that for almost all Parallax components there is a download on the catalog page with samples in PBASIC and SPIN. Few have a download example for C. So getting example code for C will be more difficult than SPIN. Maybe just a few clicks more, maybe adoption from Arduino, maybe as involved as wrapping from the command line. Perhaps my point of the post should be it is harder to *find* ready-to-go solutions in C for most components.

    Maybe my mentioning OBEX reflects that I don't appreciate the purpose of OBEX. It just seemed logical as next place to look since it is often listed in Prop materials as a strength of the platform.

    I'm not being critical, just passing to poster a factor to consider in language selection. I know Parallax is working full speed on several important projects. So it will just take time to get C code examples available for all products on their catalog page. For many components (Ping, PIR, RFID) code is available and explained in Learn C tutorial. I think it is the back-catalog of products that needs C examples.

    (Good news - the new PAM-7Q GPS has C example for download from catalog page.)

    BTW - anyone have tested code in C for the Parallax part 4x4 Matrix Membrane keypad part #27899?
  • jazzedjazzed Posts: 11,803
    edited 2014-09-01 11:53
    My note for the poster to consider is that for almost all Parallax components there is a download on the catalog page with samples in PBASIC and SPIN. Few have a download example for C. So getting example code for C will be more difficult than SPIN.


    Simple Libraries are distributed with SimpleIDE, and are provided on the Parallax Learn learn.parallax.com web pages. So, example C code is easier to get in that case.

    As far as components go, well, that's up to Parallax, and getting the whole company to do something is like trying to push a string unless Ken says: "Hey we're losing sales, and we need to fix it."
  • John KauffmanJohn Kauffman Posts: 653
    edited 2014-09-01 14:03
    Do you a know a way to search a string in all the libraries at once? Right now I am drilling down through each library to look at its functions.

    The needs of my students & I are probably not closely aligned with Ken's quarterly & yearly plans for the company. I have no problem with his priorities of getting Parallax to finish other things & get them out the door. Not having C examples for all devices sold is not losing money for them. I view it more as the future; when Parallax schedules the task of getting Prop C up to being an education platform then publishing C code for all devices will support that goal.
  • jazzedjazzed Posts: 11,803
    edited 2014-09-01 14:14
    Do you a know a way to search a string in all the libraries at once? Right now I am drilling down through each library to look at its functions.


    Use windows explorer to search the learn library.

    I use grep in the CMD window. Nothing compares to the power of grep in getting good results (except for egrep).

    This grep may be useful: http://gnuwin32.sourceforge.net/packages/grep.htm

    I view it more as the future; when Parallax schedules the task of getting Prop C up to being an education platform then publishing C code for all devices will support that goal.


    Most likely I'll never see the day when that goal is achieved for everyone.
  • TorTor Posts: 2,010
    edited 2014-09-01 20:48
    Re. search all libs at once.
    On Unix or Linux, search out a little package called 'id-utils'. It keeps track of all that without having to explicitly use 'grep' all the time.
  • redheadedrodredheadedrod Posts: 78
    edited 2014-09-03 00:40
    Thanks for the insite. I have been proficient with all of those listed ( C, C++, Java, Javascript, PHP, and Pascal ) plus Cobol, BASIC (about 20 different variations), C#, and I am sure others I am missing.

    Sounds like for me I should learn Spin if nothing more than to understand the libraries already in production and be able to either use them directly or port them over if I decide to do a project in C. May also make more sense on why things are done in C the way they are if I know spin.

    Rodney
  • October 2015
    Propeller Tool(SPIN/ASM) - Last Update - 10/08/2012 (Parallax Support Download Page)
    SimpleIDE(C,C++) - (Not on Download Page) Last Update - 12/29/2014 - 1.0 Release Candidate Only - RC2
    OBEX - Few C Examples - Mostly SPIN and ASM.

    Is the Propeller Tool going to be updated? I cannot use BETA or RC code in my projects.
    What compiler is Parallax committed to?
  • ElectrodudeElectrodude Posts: 1,614
    edited 2015-10-13 01:39
    If you need stable, I would go with the Propeller Tool. It's the most mature Propeller compiler and I don't see why it would ever need to be updated. I know of no bugs in it - as far as I know, it works perfectly.

    Parallax can't really pick just one of Propeller Tool and SimpleIDE because they do different languages. SimpleIDE is currently gaining Spin support, but it is still under fairly heavy development.

    If you can't afford to deal with compiler bugs, go with Propeller Tool. I would also personally recommend using Spin over C or C++ on the Propeller - the Propeller is not well suited for C/C++, while Spin was designed specifically for the Propeller.
  • I use the Propeller Tool for my primary development. And yes SPIN rocks. But there are several updates to the Propeller Tool like line numbers and other copy/paste enhancements that can be made. Is Widows 10 Supported? I know... Yes.. I dev on windows.

    I was hoping that Parallax would update some of the functions in the compiler too. Like lock check, bytemove... and the help screens are really bad.

    SPIN is a great language. Simple and lots of examples on OBEX. Let's Grow it... Don't Kill IT!!
  • ElectrodudeElectrodude Posts: 1,614
    edited 2015-10-13 02:51
    digital32 wrote: »
    I use the Propeller Tool for my primary development. And yes SPIN rocks. But there are several updates to the Propeller Tool like line numbers and other copy/paste enhancements that can be made. Is Widows 10 Supported? I know... Yes.. I dev on windows.

    I was hoping that Parallax would update some of the functions in the compiler too. Like lock check, bytemove... and the help screens are really bad.

    SPIN is a great language. Simple and lots of examples on OBEX. Let's Grow it... Don't Kill IT!!

    What's wrong with lock checking and bytemove in Spin? Also, most if not all built-in functions (including lockset and bytemove) are defined in the Spin interpreter in ROM and can't be changed at this point.

    Spin isn't going away any time soon.
  • digital32 wrote: »
    I use the Propeller Tool for my primary development. And yes SPIN rocks. But there are several updates to the Propeller Tool like line numbers and other copy/paste enhancements that can be made. Is Widows 10 Supported? I know... Yes.. I dev on windows.

    I was hoping that Parallax would update some of the functions in the compiler too. Like lock check, bytemove... and the help screens are really bad.

    SPIN is a great language. Simple and lots of examples on OBEX. Let's Grow it... Don't Kill IT!!

    I agree, I started out with the BS2. As soon as I seen the propeller on the market, I had to have it. The tool is easy and fun to use. The Activity Board is a quality product at a great price. But I found SimpleIDE confusing and not user friendly. At my age I'm not interested in learning another language. With eight cores to work with, I'd like to be proficiant in spin, and not complicate a fun hobby.
    "LONG LIVE SPIN"
  • Any Updates on Parallax compiler support direction??
    I updated a lot of my SPIN projects to C and Simple IDE last year but now there is no movement on SimpleIDE development.
    SimpleIDE - Last Updated January of 2017 (Version 1.1)
    Propeller Tool (Spin) - Last Updated October 2012
    Now BlocklyProp is all the rage.

    What compiler and IDE should I use for long term projects with this chip set?
    Anyone got a commercial compiler/IDE they like for (SPIN, PSAM and C/C++)???
  • digital32 wrote:
    Propeller Tool (Spin) - Last Updated October 2012
    That's testament to its completeness, not to any lack of support.

    -Phil
  • SimpleIDE is far from complete. Many of the libraries state "Going to Update this", "Need to fix this"
    Here is the github site: https://github.com/parallaxinc/SimpleIDE
Sign In or Register to comment.