Shop OBEX P1 Docs P2 Docs Learn Events
High-level overview of Prop I/II programming environments please — Parallax Forums

High-level overview of Prop I/II programming environments please

agsags Posts: 386
edited 2013-04-01 12:49 in Propeller 1
I've looked at the stickies, and the first few tutorials (thinking the basics would be in the beginning not the advanced content). I still am not following what the new direction is (or maybe additional direction).

Is the Propeller Tool being deprecated, in favor of Prop gcc?
Will the SPIN interpreter still be embedded in Prop II ROM and loaded in cog RAM to execute SPIN bytecode?
Is gcc for both Prop I & II? Is it capable of producing SPIN byte code (optionally?) just as the Propeller Tool does, but from C source?
Or is SPIN itself no longer being supported on Prop II at all?
It looks like Prop gcc will require a kernel running in each cog. Is that just for startup or will this work like the current Prop I running SPIN bytecode, except it will be different byte code produced by Prop gcc?

Without understanding these basics the more advanced discussions are beyond me.

This was all started because I am looking for a way to open/edit (not execute) SPIN (including PASM too) source files on a Mac, and the Propeller Tool doesn't support Mac (is that correct?). I started downloading BST (Brad's Spin Tool) for Mac and saw some comments about support being reduced and pointers to gcc for Propeller instead. Is there something simple that I could use to edit SPIN/PASM with correct indentation (like an Eclipse plug-in)?

If these are answered in another post I'd appreciate a pointer there.

Thanks.
«1

Comments

  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-21 16:32
    PropGCC will be supported on both the Propeller 1 and the Propeller 2. Spin will be supported on both chips as well.

    The Propeller 2 does not have a Spin bytecode interpreter in ROM. It just has a simple COG loader that reads a COG image from a SPI flash chip and starts it. That COG image will likely be a second-stage loader that loads the user program which could be either C/C++ or Spin or anything else.

    PropGCC supports a variety of runtime environments. One just compiles code to run directly on a COG with pretty much no runtime overhead. This is called COG mode. LMM mode executes Propeller instructions from hub memory using Bill Henning's Large Memory Model idea. XMM is like LMM exept that it executes code from external memory like SPI flash, SRAM, or SDRAM. CMM mode is like LMM mode except that it uses compressed versions of Propeller instructions to allow more code to fit into hub memory. PropGCC does not have a mode that produces Spin bytecodes. They are not a good match for C semantics.
  • agsags Posts: 386
    edited 2013-03-21 18:41
    Thank you for the reply.

    If Spin is supported on Prop2, but there is no Spin bytecode interpreter in ROM, is it up to the user (or the programming tool) to "find" one, load it into cog memory, or does PropGCC now compile Spin to native cog code?

    Will the current Propeller Tool (or something like it) still be provided by Parallax for Prop2 - or is PropGCC the only environment provided (or sanctioned, or supported - not sure of the relationship) by Parallax?
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-21 18:59
    ags wrote: »
    Thank you for the reply.

    If Spin is supported on Prop2, but there is no Spin bytecode interpreter in ROM, is it up to the user (or the programming tool) to "find" one, load it into cog memory, or does PropGCC now compile Spin to native cog code?
    I'm not creating the Spin compiler but I imagine that every Propeller 2 Spin .binary file will probably include a copy of the Spin bytecode interpreter. It's only 2048 bytes so it won't increase the size of the binaries very much. Loading the bytecode interpreter along with the prrogram also has the advantage that new versions of the Spin compiler can make use of inew mproved Spin bytecode interpreters.
    Will the current Propeller Tool (or something like it) still be provided by Parallax for Prop2 - or is PropGCC the only environment provided (or sanctioned, or supported - not sure of the relationship) by Parallax?
    Parallax will have to answer this but I seem to remember someone saying that they intend to continue supporting the Propeller Tool under Windows and will also probably provide a cross-platform IDE that will run on Windows, Linux, and the Mac. There will definitely be Spin support on P2!
  • agsags Posts: 386
    edited 2013-03-22 11:14
    So for today, on MacOS, is the recommendation for Prop1 programming to use the BST, or PropGCC? It sounds like PropGCC is the way forward, but has there been any attempt to provide a use model that will be similar/familiar to those programming in SPIN and PASM using the PropellerTool?
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-03-22 11:21
    ags,

    Try SimpleIDE, I use it on my Mac all the time for Spin and PropGCC coding. It's still being developed but this release has been very stable for me.

    Here's a link to some documentation.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-22 11:21
    ags wrote: »
    So for today, on MacOS, is the recommendation for Prop1 programming to use the BST, or PropGCC? It sounds like PropGCC is the way forward, but has there been any attempt to provide a use model that will be similar/familiar to those programming in SPIN and PASM using the PropellerTool?
    BST or SimpleIDE with PropGCC are both good ways to program the Propeller 1 if you want to use an IDE. If you're willing to use the command line tools, Roy has made a Spin compiler that is 100% compatible with the Propeller Tool that will run on Mac OS X as well as Windows and Linux.
  • agsags Posts: 386
    edited 2013-03-28 15:28
    I can't believe I'm about to say this, but despite years of C/C++ programming, I seem to have become accustomed to using SPIN. Is there a SPIN compiler that can be used (today) integrated into SimpleIDE (running on Mac) to create and load SPIN bytecode to a Prop1? This would also be useful for modifying legacy SPIN code - although the spin2cpp utility is a path there. Have there been any cases where the resulting C program behaved differently than the original? When I say "SPIN compiler" I also mean the ability to write PASM code for direct execution in a cog, with support for loading that for execution as is available today.

    I expect that I'll move into the modern age and adopt C (again) soon. Just not now, in the middle of a project.
  • jazzedjazzed Posts: 11,803
    edited 2013-03-28 16:19
    ags wrote: »
    Is there a SPIN compiler that can be used (today) integrated into SimpleIDE (running on Mac) to create and load SPIN bytecode to a Prop1?


    SimpleIDE version 0-8-5 (link provided by Mindrobots above) can compile SPIN programs using BSTC. It does not work like Propeller Tool though because SimpleIDE uses projects. Open a SPIN file with SimpleIDE File->Open menu and press the blue COG on the toolbar. That will create a SPIN project from the file you have open. Look at page 10 of the pdf link below to learn more about the buttons.

    You can follow the SimpleIDE pdf document (a little out of date) for more detailed information on using SimpleIDE: https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxwcm9wZWxsZXJnY2N8Z3g6NGU1NDU0NDQ5NmZjMjg2Nw

    There has been talk of a SPIN only version of SimpleIDE which behaves more like the Propeller Tool. Work could start on that before summer, but an actual plan is still to be determined.
  • agsags Posts: 386
    edited 2013-03-29 08:10
    OK, I'll give SimpleIDE a shot. I've read the documentation and the project-based model (compared to Propeller Tool's file-based model) is not a problem.

    I have to ask - and please, this is really just a question, let's not let it become a flame war - why build another IDE rather than using Eclipse? Is there some barrier to creating a PropGCC plugin?
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-29 08:20
    ags wrote: »
    OK, I'll give SimpleIDE a shot. I've read the documentation and the project-based model (compared to Propeller Tool's file-based model) is not a problem.

    I have to ask - and please, this is really just a question, let's not let it become a flame war - why build another IDE rather than using Eclipse? Is there some barrier to creating a PropGCC plugin?
    SimpleIDE is supposed to be easy for beginners like the Arduino IDE. Parallax had a plan to produce an Eclipse plug-in for professional users at one point. I'm not sure of the status of that project.
  • agsags Posts: 386
    edited 2013-03-29 08:26
    Oh - I have never used the Arduino IDE, but use Eclipse all the time. To me, it is simple... and ubiquitous. I was wondering if there were any technical obstacles behind the decision. I have Eclipse everywhere, and would love to see a plugin. (not knocking SimpleIDE in any way. I am just starting to play with it now and I have to give credit to the author(s))
  • jazzedjazzed Posts: 11,803
    edited 2013-03-29 08:27
    ags wrote: »
    I have to ask - and please, this is really just a question, let's not let it become a flame war - why build another IDE rather than using Eclipse? Is there some barrier to creating a PropGCC plugin?

    I recommended Eclipse for the IDE. SimpleIDE was written as a demo of how some things could work with Propeller-GCC and the loader. Parallax started the Eclipse plug-in, but it became a resource sink. I've begged them privately to put in on line for some team to finish.

    Interesting to me that requiring users install Java has recently become a (bigger) issue because of security concerns. Has Oracle responded with a solution?
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-29 08:41
    ags wrote: »
    Oh - I have never used the Arduino IDE, but use Eclipse all the time. To me, it is simple... and ubiquitous. I was wondering if there were any technical obstacles behind the decision. I have Eclipse everywhere, and would love to see a plugin. (not knocking SimpleIDE in any way. I am just starting to play with it now and I have to give credit to the author(s))
    As far as I know there is nothing blocking the creation of an Eclipse plug-in. In fact, if you'd like to work one one, I'm sure there are others here who would help out.
  • potatoheadpotatohead Posts: 10,261
    edited 2013-03-29 08:56
    I have Eclipse now too. Turns out some of the software I work with professionally uses Eclipse to manage business logic rule configuration. (read, a little programming and a lot of XML)

    For a taste of what can be done, take a look at this: http://wudsn.com/ And that effort is all done. The various assemblers have the syntax highlighting done, hooks to build things are there, and emulation is linked in so that everything flows.

    That's an Eclipse environment all setup to do assembly language programming on 8 bit computers. Atari, Apple, etc... One of my hobby projects aligns with this right now. I was setup and running in a day. IMHO, Eclipse is a little "busy", but a video or two gets people right to the good stuff, at which point they very likely ignore the rest, until they get there or need it. I bumped into this thing a few months ago, and happened to have Eclipse on hand. Honestly, I had avoided Eclipse prior. Didn't need it, didn't think I wanted it. Heard various things here and there. The reality was nearly all positive.

    I would easily second a release of what was done so far when it makes sense.

    @Steve, nothing intended toward SimpleIDE. I like it a lot. Just wanted to post my Eclipse impressions on topic.
  • agsags Posts: 386
    edited 2013-03-29 22:22
    So I've installed SimpleIDE and taken it for a trial spin (no pun intended) using bstc (included with the SimpleIDE/PropGCC distribution) to edit/compile SPIN code. I loaded and built a known good file and it worked, but then I purposefully created some errors and found that it took a long time (15+ seconds) for bstc (I presume) to return after clicking the "build" toolbar button, and when it did, all I received was a cryptic error message. The line containing the error was not highlighted in the editor panel. Is this expected behavior of SimpleIDE when compiling with bstc, or is this a bad install and/or pilot error?
  • jazzedjazzed Posts: 11,803
    edited 2013-03-30 07:57
    ags wrote: »
    The line containing the error was not highlighted in the editor panel. Is this expected behavior of SimpleIDE when compiling with bstc, or is this a bad install and/or pilot error?

    The only error information you will get from the 0-8-x IDE is what is shown in the Build Status tab.
  • KC_RobKC_Rob Posts: 465
    edited 2013-03-30 09:20
    ags wrote: »
    I can't believe I'm about to say this, but despite years of C/C++ programming, I seem to have become accustomed to using SPIN.
    Nothing especially shameful or odd about that. I find myself somewhat in the same boat. Spin ain't so bad. In fact, it's served the Propeller quite well (eg, the wealth of code on the Object Exchange). The mere availability of a C/C++ compiler (GCC) isn't going to attract en masse users who previously shunned the Propeller. Nor is Spin going away anytime soon.
  • jazzedjazzed Posts: 11,803
    edited 2013-03-30 09:28
    KC_Rob wrote: »
    Nothing especially shameful or odd about that. I find myself somewhat in the same boat. Spin ain't so bad. In fact, it's served the Propeller quite well (eg, the wealth of code on the Object Exchange). The mere availability of a C/C++ compiler (GCC) isn't going to attract en masse users who previously shunned the Propeller. Nor is Spin going away anytime soon.

    While there is truth in this comment, there is more to it for Parallax. You can ask them to explain it. No one would believe me.
  • KC_RobKC_Rob Posts: 465
    edited 2013-03-30 09:48
    jazzed wrote: »
    While there is truth in this comment, there is more to it for Parallax. You can ask them to explain it. No one would believe me.
    Please do tell. :smile:
  • jazzedjazzed Posts: 11,803
    edited 2013-03-30 10:23
    KC_Rob wrote: »
    Please do tell. :smile:

    I'll just summarize: all the active members of this forum using SPIN can not make up for customers lost by not having a Parallax C solution.
  • KC_RobKC_Rob Posts: 465
    edited 2013-03-30 11:07
    jazzed wrote: »
    I'll just summarize: all the active members of this forum using SPIN can not make up for customers lost by not having a Parallax C solution.
    Maybe. But from what I've seen and heard, that (not having a C solution) is only one of several knocks - fair or not - made on the Propeller, and perhaps not even the biggest. So again, a C (GCC) solution alone will not cause these once lost potential users now to flock en masse to the Propeller.

    Clearly it's a good idea to have a C (as well as others) solution available for the Propeller. I just wouldn't put too much stock in its making everything new and better from a marketing standpoint.
  • jazzedjazzed Posts: 11,803
    edited 2013-03-30 11:22
    As I said: You can ask Parallax to explain it.
  • KC_RobKC_Rob Posts: 465
    edited 2013-03-30 11:45
    jazzed wrote: »
    As I said: You can ask Parallax to explain it.
    I know you're just passing the info, as you understand it, along. Maybe someone from Parallax will read this and offer additional explanation. Or not.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 11:49
    KC_Rob wrote: »
    I know you're just passing the info, as you understand it, along. Maybe someone from Parallax will read this and offer additional explanation. Or not.
    I'm not sure what the issue is here. My understanding is that Parallax will support both Spin and C on the Propeller 2. Isn't that sufficient?
  • KC_RobKC_Rob Posts: 465
    edited 2013-03-30 12:04
    David Betz wrote: »
    I'm not sure what the issue is here. My understanding is that Parallax will support both Spin and C on the Propeller 2. Isn't that sufficient?
    I'm not sure there is an "issue" period. As I said I think in my very first comment, Spin probably isn't going away anytime soon, and for good reason.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 12:07
    KC_Rob wrote: »
    I'm not sure there is an "issue" period. As I said I think in my very first comment, Spin probably isn't going away anytime soon, and for good reason.
    I agree that Spin isn't going away. It's Chip's baby and I'm sure he'll extend it to support Propeller 2. He's probably working on that as we speak! :-)
  • agsags Posts: 386
    edited 2013-03-30 12:25
    I value the dialog here. I can see how Marketing may assess differences between current Parallax offerings and what is available for PIC/AVR devices, and decide a significant difference is the language support (which it is). But as has been said, C language support may be necessary, but is not likely sufficient to dramatically change the market landscape for the Prop. I am not an AVR/PIC user, but what I find to be the biggest obstacle for my productivity with the Propeller are the progamming tools (not language - that's entirely different IMO), specifically the debug environment. That may simply be due to what I'm used to with much larger projects (i.e. 10MLOC products and the tool chain available to support such tasks).

    Back to the technical stuff: I think the reason I'm reluctant to move from SPIN is because I've finally figured out how it works - almost down to bare metal. True, I'm not (nor do I intend to become) an expert in the SPIN bytecode interpreter. But I know how the stack works, how memory alignment impacts what is happening, etc. It may not be very different when using C, but I just have to get my head around it and get comfortable with it - particularly the basic operation of the cog kernel.

    As for the existing OBEX of SPIN code, is there currently support for mixed-language projects? I first was thinking of the mechanics of calling a SPIN object from a C function (which does seem feasible - although it will occupy another cog for the SPIN bytecode interpreter) but then realized it could just be "magic" under the IDE covers that runs the spin2cpp (?) translator as needed.

    BTW, in no way am I suggesting I understand Parallax's market, or the uC market in general for that matter. I'm just sharing some thoughts from the perspective of someone who stumbled upon the Propleller accidentally, and is now interested in developing small projects on this platform.
  • potatoheadpotatohead Posts: 10,261
    edited 2013-03-30 12:29
    I want to back Jazzed up on this. Lots of heat on this topic, and there shouldn't be.

    Having SPIN is good. The work being done on C right now will be good too.

    Truth is, many who actually try it Chip's way find it's potent. The problem is the number of people willing to do that is a fraction of the people willing to give a Propeller a try using something they know; namely, C.

    Additionally, P1 capability serves a fraction of the people served by P2 capability. That's becoming obvious now that we have the emulation performing as it does.

    With that comes bigger programs, bigger data, more complexity overall. Where that's true, the barrier to adopting the new technology rises some, and where it's true in addition to a new programming language and or inability to integrate that into existing environments and tool chains, the barrier to adoption rises high. With each barrier raised the fraction of people who won't ever try a Propeller no matter what grows --and it's highly likely that is not linear growth either.

    Because of those dynamics, having C "in the house" as well as a presentation that's aimed differently than we experience here literally mean the difference between success and failure from a business stand point. The size of the investment required to make a chip like this is significant relative to the size of Parallax, and the pay back required to have it all make sense is linked to new technology adopters outside the pool of people who would adopt a Propeller easily.

    We need C. In fact, we need C++ and we need it to be fricking great so that it counters the barrier to entry seen with Propellers operating very differently than pretty much anything else!

    Think of it this way:

    1. It has no interrrupts

    For each differentiator like that, some of us in the family think it's cool and we can very easily articulate why and how that is. But, each statement like that raises a barrier to entry that must be checked with enabling tools and messages to prevent it from harming adoption rates too much, or the technology will not see wider scale adoption outside of niches where those statements make obvious sense.

    Contrary to popular belief here, a statement like that does not make obvious sense to the vast majority of potential technology adopters. Read users who pay for chips and ideally some niches where users pay for a whole lot of chips.

    2. No code protection.

    We dealt with this one. P2 will have what it takes to remove this exception from the table. Had the P1 offered this capability, adoption rates would have been significantly higher IMHO.

    3. Multi-core vs multi-processor or the word "cog".

    Same as #1

    4. Software peripherals.

    To us, we say "sweet!" and we know what that means, particularly if we have been SPIN + PASM users. It rocks, we all know it. Blah, blah, blah... To the rest of the world, they say, "Wut?" and something along the lines of, "Who is going to debug that?" etc.... Wonder why the C effort is so important now? With a solid set of basic library peripherals that just work, programmers can write to them like they do hardware ones and it will work and they will be pleased with that like they would be pleased by changing out chips on a design that fit the requirements better only on a Prop solution they won't change chips they will change libraries.

    And so it goes.

    There is company size, single sourcing and overall perception of viability, stability, etc... People know they can select technology from big companies and be "safe" the TI, Atmel, Motos of the world sell tons and tons of chips.

    Here is a reality check for you! I would wager that selecting a 6502 from the Western Design Center, yes a 6502! for embedding into a consumer grade device is significantly easier than selecting a propeller. And that's an old 8 bit CPU I have in my Apple //e computer from the late 80's! Guess what?

    There is at least two kick *** C compilers for that chip, and there is a reason for that and the reason is they don't want to miss the chance to be selected having to work in assembly or some other thing.

    Folks, we need this. Ken, Chip, Parallax needs this to work. In fact, this community will be significantly impacted if it doesn't work. And given the top notch service, support, care, feeding and pure fun we've all been granted, helping to make it work is the right thing to do. At the least, not beating it down all the time is a great benefit. The team works hard, and making C work for this new technology is not easy either. The highly differentiated Propeller presents lots of challenges that need solutions.

    Those solutions are possible, practical, potent, viable, necessary.
  • KC_RobKC_Rob Posts: 465
    edited 2013-03-30 13:18
    potatohead wrote: »
    Having SPIN is good. The work being done on C right now will be good too.
    Yes, good. Very good even. The answer to all, or even most, marketing hurdles? Probably not.

    Memory, for example, is always the first or nearly the first knock you'll hear made on the Propeller. In this day and age, engineers, even many hobbyists and educators, aren't going to have much patience with a memory constrained controller, even if there are not terribly difficult or expensive ways around that. Just not going to happen. Code protection, very important. Good thing it's being addressed. Ability to implement peripherals in software is a selling point, something that sets the Propeller apart. Sell that, rather than run from it. Embrace and accept that the market is mostly a niche one and likely always will be.

    Fundamentally the problem the Propeller has, not unlike many other micros, is that there is an awful lot of competition out there. So many 8- and 32-bit processors with huge amounts of memory and an ever-growing, already large mix-and-match selection of peripherals. Amazing performance too (100 MIPS 8051s!), with additional multi-core devices becoming available all the time. ARMs everywhere you look. Add to that lower-priced but still extremely flexible and powerful FPGAs (even CPLDs) and DSPs, and the engineer has a withering number of devices to choose from nowadays. So it all comes down to "what does this do for me, that others don't? how much does it cost and how easy is it to use, again compared to my (many) other choices?" Then, of course, there is the issue of Parallax being seen as a credible chip supplier for commercial/industrial products.

    Thus, to my mind ags is spot on when he/she says that "C language support may be necessary, but is not likely sufficient to dramatically change the market landscape for the Prop."
  • potatoheadpotatohead Posts: 10,261
    edited 2013-03-30 13:24
    P2 will have ample memory and multiple models for utilizing it.

    For P1, I agree with you and said as much, though I did not say it directly. IMHO, the EDU market may well benefit from improved P1 C tools. That's significant for Parallax, and given the P2 taking shape, potentially a source of Prop friendly people entering the market. Won't take too many of those to seriously improve technology adoption rates for P2.

    Your other comments about competition are valid, however I must point out share is a relative thing. At Parallax current size, a doubling of the company would only present a very small fraction share change of the market overall. And that difference is what counts, not so much the metrics we see in the trade rags / websites.
Sign In or Register to comment.