Shop OBEX P1 Docs P2 Docs Learn Events
P2 and C — Parallax Forums

P2 and C

SystemSystem Posts: 45
edited 2020-06-26 16:17 in Propeller 2
This discussion was created from comments split from: Propeller 2 Objects: a process to involve community and share code.
«1

Comments

  • No C supported, are you sure?
  • No C supported, are you sure?

    C is of interest to Parallax and many Propeller 2 customers. With our current in-house team sitting at 16 people plus the community, we have to ensure that what we offer is done correctly, rather than supporting many languages which all lack documentation and inhibit traction being developed with any one of them. Initially, we're focusing on Spin2/PASM2 and MicroPython.

    This can change in time as we progress, of course. We'll recognize, feature, and answer calls about the C compiler tools to the best of our abilities, which are quite limited. With time, we can also figure out the best way to work with the providers of the C tools to bring these efforts forward for a self-sustaining model. But this development process isn't one we can fund at this time; we're just trying to get to the starting point, which requires completion of our contract with ON and a production order ($). Trying to do it all, right now, is a recipe for disaster.

    I am confident that any of you who could peek more closely into Parallax would come to similar conclusions on your own. Yet please put your comments here, call me and tell me how to go about things anytime (916) 625-3010 or send a message kgracey@parallax.com.

    Ken Gracey
  • Roy ElthamRoy Eltham Posts: 3,000
    edited 2020-06-25 20:42
    Why not C/C++????

    BlocklyProp is built on it, and you have piles of C/C++ tutorials on learn.parallax.com. Don't you want all that to run on P2 also?

    Also, several of those things already exist in FlexC right now.

    I mean this feels REALLY backwards to me. C/C++ should be a first class citizen and supported. Even more than Spin2/PASM2. I'm just completely baffled.
  • VonSzarvasVonSzarvas Posts: 3,450
    edited 2020-06-26 16:17
    I think Ken explained that Roy, a couple posts up.
  • With our current in-house team sitting at 16 people
    I think it is amazing what Parallax has achieved with 16 people. I have played with C and C# for decades and now I am slowly learning Spin2/PASM2 which I hope the veterans will accept.
  • VonSzarvas,
    I saw that and I don't agree and think they need to re-evaluate things.
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2020-06-26 00:38
    Roy Eltham wrote: »
    Why not C/C++????

    BlocklyProp is built on it, and you have piles of C/C++ tutorials on learn.parallax.com. Don't you want all that to run on P2 also?

    Also, several of those things already exist in FlexC right now.

    I mean this feels REALLY backwards to me. C/C++ should be a first class citizen and supported. Even more than Spin2/PASM2. I'm just completely baffled.

    Chip is piloting a loaded 747 with just enough fuel to safely land at the nearest airport -- burning some vapors but floating in at a 10-to-1 glide path. Aboard the jet is the Parallax team, our educational customers, the P2 community, Parallax and whatever else exists (like those 2,900 P2 chips). When the 747 lands, it can refuel and go to new places. Asking Parallax to point the 747 at a different airport will be one which is further away than the nearest one, which would be a certain cause for trouble. Specifically, the plane could crash and all of the humans, the chips, the potential.....scattered! But if we land, we can pick up more passengers, cargo, fuel, and invest our retained earnings.

    C/C++ is among the many first-class citizens who didn't get on the first flight. But they're still alive and can board the plane in the future, after the current fuel is used up. Even better, it's possible these first-class citizens might even take flight sooner than we think! Maybe we'll come up with a solution to get behind FlexC and other tools, more than just featuring them on our site.

    We're in more agreement than you can imagine. But we (at least within Parallax) can't rally around every single effort right now. In time, we can widen our scope. Stick with us.

    Ken Gracey



  • Roy Eltham wrote: »
    Why not C/C++????

    BlocklyProp is built on it, and you have piles of C/C++ tutorials on learn.parallax.com. Don't you want all that to run on P2 also?

    Would like to address the question about BlocklyProp.

    The reason the P2 exists -- aside from all of your contributions, the creativeness of Chip, and because of P1 success -- is because we have worked to develop an educational market with Arduino, BASIC Stamp, and P1 (mostly in BlocklyProp). This market is responsible for revenue generation. And in the last year or two, Python (MicroPython) has been endorsed (by those who make standards) as the language of choice for education. Educators often care about language first, then tutorials, hardware, etc. Since March 1st, I have personally trained 400+ educators on simple Python programming (using the micro:bit, on a cyber:bot). Part of the rationale behind that effort is the plan to support MicroPython on the P2 as our educational language. We've been creating customers for the P2.

    Part of Parallax thinks like a business and gives customers exactly what they want today (our educational business); part of it is so creative it designs things for customers we don't even know yet and looks much further forward (Chip and P2 community). No matter what commercial success may/may not come from P2 applications, we must be able to use it for educational purposes.

    With Python being the text-based language for education, a block-based programming environment would likely generate Python code. I do not foresee expanding BlocklyProp for P2 at the moment. Our customers who use BlocklyProp haven't exhausted the limits of that tool yet (but I agree it would be a fun get-running-and-demo way to use the P2 out of the box!).

    Ken Gracey
  • AribaAriba Posts: 2,690
    Ken Gracey wrote: »
    ... If you're using fastspin, we may find a way to make Spin2 objects run there as well (and vice-versa), but not at this moment.
    ...

    I do not quite understand this sentence.

    Eric has invested a lot of time to make Fastspin compatible to Spin2. Normally you can simply load the code from PNUT or PropTool into flexGUI and it works. I write all my objects so that they work with both platforms.

    And most importantly, you can use the same Spin2 objects with flexC, without any translation, you just embed them. No idea what C programmers miss.

    I hope next Wednesday it will be clearer to everyone how good this flexGUI system is.

    Andy
  • Ariba wrote: »
    Ken Gracey wrote: »
    ... If you're using fastspin, we may find a way to make Spin2 objects run there as well (and vice-versa), but not at this moment.
    ...

    I do not quite understand this sentence.

    Eric has invested a lot of time to make Fastspin compatible to Spin2. Normally you can simply load the code from PNUT or PropTool into flexGUI and it works. I write all my objects so that they work with both platforms.

    And most importantly, you can use the same Spin2 objects with flexC, without any translation, you just embed them. No idea what C programmers miss.

    I hope next Wednesday it will be clearer to everyone how good this flexGUI system is.

    Andy

    I wasn't aware that the same code would run under FlexGUI and Prop Tool, but this is fantastic. Same for the integration so Spin2 into FlexC. That's why we're running the Early Adopter meetings; whatever isn't clear at this time shall be.

    If you'd like to submit your Spin2 objects we'd be happy to host them for download.

    Ken Gracey
  • RaymanRayman Posts: 14,646
    edited 2020-06-26 13:00
    @"Ken Gracey" Fastspin also makes it easier to migrate your existing P1 code to P2 code... Then, you can go one step further and make it compatible with the new Prop Tool...
  • Ken Gracey wrote: »
    We also haven't spoken about what languages we'll officially support, so I'll tell you now: Spin2/PASM2 and MicroPython for P2.
    Ugh. No C again even though you have at least two viable C compilers that are ready to go.

  • David Betz wrote: »
    Ken Gracey wrote: »
    We also haven't spoken about what languages we'll officially support, so I'll tell you now: Spin2/PASM2 and MicroPython for P2.
    Ugh. No C again even though you have at least two viable C compilers that are ready to go.

    Let's be constructive since negativity gets us nowhere.

    What does it mean for Parallax to support C, in your view? I have a vision of what it means and maybe I'm wrong. Is it this:

    - being able to answer the incoming tech requests
    - having direct control over the programming environment so customer input is quickly incorporated
    - supporting (testing, revising) C libraries
    - parallel code support along with Spin2 and MicroPython (some examples in all three languages?)

    Please tell me exactly what you'd envision as a customer, maybe a perspective other than the insider you are.

    Ken Gracey
  • Ken Gracey wrote: »
    David Betz wrote: »
    Ken Gracey wrote: »
    We also haven't spoken about what languages we'll officially support, so I'll tell you now: Spin2/PASM2 and MicroPython for P2.
    Ugh. No C again even though you have at least two viable C compilers that are ready to go.

    Let's be constructive since negativity gets us nowhere.

    What does it mean for Parallax to support C, in your view? I have a vision of what it means and maybe I'm wrong. Is it this:

    - being able to answer the incoming tech requests
    - having direct control over the programming environment so customer input is quickly incorporated
    - supporting (testing, revising) C libraries
    - parallel code support along with Spin2 and MicroPython (some examples in all three languages?)

    Please tell me exactly what you'd envision as a customer, maybe a perspective other than the insider you are.

    Ken Gracey
    Your description sounds about right. I assume you already have the ability to support C libraries and answer questions about C since your current SimpleIDE educational materials already use C. In fact, it seems like there would be more work required to move over to Spin again since Parallax seems to have concentrated on C and MicroPython recently. Maybe a better choice would be to support C and MicroPython at launch and leave Spin2 for later.

  • Ken GraceyKen Gracey Posts: 7,392
    edited 2020-06-26 13:36
    David Betz wrote: »
    Ken Gracey wrote: »
    David Betz wrote: »
    Ken Gracey wrote: »
    We also haven't spoken about what languages we'll officially support, so I'll tell you now: Spin2/PASM2 and MicroPython for P2.
    Ugh. No C again even though you have at least two viable C compilers that are ready to go.

    Let's be constructive since negativity gets us nowhere.

    What does it mean for Parallax to support C, in your view? I have a vision of what it means and maybe I'm wrong. Is it this:

    - being able to answer the incoming tech requests
    - having direct control over the programming environment so customer input is quickly incorporated
    - supporting (testing, revising) C libraries
    - parallel code support along with Spin2 and MicroPython (some examples in all three languages?)

    Please tell me exactly what you'd envision as a customer, maybe a perspective other than the insider you are.

    Ken Gracey
    Your description sounds about right. I assume you already have the ability to support C libraries and answer questions about C since your current SimpleIDE educational materials already use C. In fact, it seems like there would be more work required to move over to Spin again since Parallax seems to have concentrated on C and MicroPython recently. Maybe a better choice would be to support C and MicroPython at launch and leave Spin2 for later.

    Not really. We have one internal C programmer, and that's Andy. However, Andy's primary role is in educational content development. As I mentioned above, that's what keeps the Parallax aircraft flying. At some stage we will turn his attention to MicroPython and the P2. SimpleIDE is not being revised since we don't understand the source code behind the tool. To shift his attention means we don't pursue MicroPython for education. With MicroPython we have a tremendous advantage of being able to rely on the open-source Mu editor.

    Leaving Spin2 for later doesn't achieve anything. Not only is it the primary goal from Chip, most of our P1 production projects used Spin.

    We're resource-constrained and can only do so much without losing our bearing, personal health and economic viability. If there's a way to get this done by reshuffling what we can, and bringing the community into the support mix, we're all in. Can FlexGUI become a for-sale and supported product from Eric with more visibility from Parallax? Maybe he focuses on libraries and the IDE, and you focus on support?

    Ken Gracey
  • The P2 has so many new features no one language would be adequate, except for a language like SPIN that natively fits the P2 chip. On the flip side, having mirrored key words or syntax (thinking printf ) would say to a new user "not another language" but its a little like C and "I can do this" Sorta, kinda C-SPIN merge thing. Purist are probably cringing right now.
  • David BetzDavid Betz Posts: 14,516
    edited 2020-06-26 14:25
    (deleted)
  • Ken Gracey wrote: »
    David Betz wrote: »
    Ken Gracey wrote: »
    David Betz wrote: »
    Ken Gracey wrote: »
    We also haven't spoken about what languages we'll officially support, so I'll tell you now: Spin2/PASM2 and MicroPython for P2.
    Ugh. No C again even though you have at least two viable C compilers that are ready to go.

    Let's be constructive since negativity gets us nowhere.

    What does it mean for Parallax to support C, in your view? I have a vision of what it means and maybe I'm wrong. Is it this:

    - being able to answer the incoming tech requests
    - having direct control over the programming environment so customer input is quickly incorporated
    - supporting (testing, revising) C libraries
    - parallel code support along with Spin2 and MicroPython (some examples in all three languages?)

    Please tell me exactly what you'd envision as a customer, maybe a perspective other than the insider you are.

    Ken Gracey
    Your description sounds about right. I assume you already have the ability to support C libraries and answer questions about C since your current SimpleIDE educational materials already use C. In fact, it seems like there would be more work required to move over to Spin again since Parallax seems to have concentrated on C and MicroPython recently. Maybe a better choice would be to support C and MicroPython at launch and leave Spin2 for later.

    Not really. We have one internal C programmer, and that's Andy. However, Andy's primary role is in educational content development. As I mentioned above, that's what keeps the Parallax aircraft flying. At some stage we will turn his attention to MicroPython and the P2. SimpleIDE is not being revised since we don't understand the source code behind the tool. To shift his attention means we don't pursue MicroPython for education. With MicroPython we have a tremendous advantage of being able to rely on the open-source Mu editor.

    Leaving Spin2 for later doesn't achieve anything. Not only is it the primary goal from Chip, most of our P1 production projects used Spin.

    We're resource-constrained and can only do so much without losing our bearing, personal health and economic viability. If there's a way to get this done by reshuffling what we can, and bringing the community into the support mix, we're all in. Can FlexGUI become a for-sale and supported product from Eric with more visibility from Parallax? Maybe he focuses on libraries and the IDE, and you focus on support?

    Ken Gracey
    Okay, understood. Yes, I would like to help with C support on the P2 and would be happy to work with Eric on his toolchain.

  • Guys, let's be clear: Parallax is not going to support C officially, and there's no point in browbeating Ken about it. I'm sure he wishes he had the resources to do all of C, Spin2, MicroPython, Forth, etc., but Parallax is a small company. Maybe if the P2 takes off then things will change; I certainly hope so.

    In the meantime let's do what we can as a community to support C on the P2. That means agreeing on standards (like what goes in propeller2.h), some common library functions, and helping out with documentation and code. I could certainly use help on fastspin, and I'm sure Ross would appreciate input for Catalina. We have a fantastic community here that can do a lot together.
  • PropGuy2 wrote: »
    The P2 has so many new features no one language would be adequate, except for a language like SPIN that natively fits the P2 chip. On the flip side, having mirrored key words or syntax (thinking printf ) would say to a new user "not another language" but its a little like C and "I can do this" Sorta, kinda C-SPIN merge thing. Purist are probably cringing right now.

    OK, not to start a language war but I do want to correct something here: there's nothing special about Spin2 with regards to the P2 hardware. Don't get me wrong, Spin2 is a nice language and Chip has done a good job designing it. But the unique features of Spin2 (e.g. multiple return values, the SEND := mechanism) are not hardware specific, and the hardware specific features (various built-in functions and inline assembly) are easily added to other languages. As proof I offer the BASIC and C dialects in fastspin. There's nothing you can do in Spin2 that you can't do in those languages. If you think I'm wrong, please provide a counter-example.
  • David BetzDavid Betz Posts: 14,516
    edited 2020-06-26 15:41
    ersmith wrote: »
    Guys, let's be clear: Parallax is not going to support C officially, and there's no point in browbeating Ken about it. I'm sure he wishes he had the resources to do all of C, Spin2, MicroPython, Forth, etc., but Parallax is a small company. Maybe if the P2 takes off then things will change; I certainly hope so.

    In the meantime let's do what we can as a community to support C on the P2. That means agreeing on standards (like what goes in propeller2.h), some common library functions, and helping out with documentation and code. I could certainly use help on fastspin, and I'm sure Ross would appreciate input for Catalina. We have a fantastic community here that can do a lot together.
    Yes, that certainly seems to be true. It will be interesting to see if community support for C is enough to get people outside the current Parallax community interested in the P2. Maybe that doesn't matter though. Maybe there is already enough support among existing Parallax customers to support the P2. I guess the thing that disappoints me most is that this thread seems to indicate that Parallax has no interest in C libraries. In any case, there is no call encouraging people to write them.

  • ersmith wrote: »
    Guys, let's be clear: Parallax is not going to support C officially, and there's no point in browbeating Ken about it. I'm sure he wishes he had the resources to do all of C, Spin2, MicroPython, Forth, etc., but Parallax is a small company. Maybe if the P2 takes off then things will change; I certainly hope so.

    In the meantime let's do what we can as a community to support C on the P2. That means agreeing on standards (like what goes in propeller2.h), some common library functions, and helping out with documentation and code. I could certainly use help on fastspin, and I'm sure Ross would appreciate input for Catalina. We have a fantastic community here that can do a lot together.

    That's the spirit -- one which Eric has always demonstrated! We can get behind this effort, make it visible and help it grow.

    Ken Gracey
  • AribaAriba Posts: 2,690
    David Betz wrote: »
    ... I guess the thing that disappoints me most is that this thread seems to indicate that Parallax has no interest in C libraries. In any case, there is no call encouraging people to write them.
    With flexC you don't need special C libraries. Just use the Spin2 objects. They also work with C and BASIC. I think this is a huge advantage over what we had for the P1.

    Andy
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2020-06-26 16:18
    Ariba wrote: »
    David Betz wrote: »
    ... I guess the thing that disappoints me most is that this thread seems to indicate that Parallax has no interest in C libraries. In any case, there is no call encouraging people to write them.
    With flexC you don't need special C libraries. Just use the Spin2 objects. They also work with C and BASIC. I think this is a huge advantage over what we had for the P1.

    Andy

    This lends lots of power and cross-code usefulness (or whatever you'd call it). I'm hoping Eric can demo some of these features next Wednesday.

    Also, let's start new threads for C - the purpose of this thread was to establish a process to submit (and for us to post) Spin2 objects.
    ModEdit: Thread split!

    Ken Gracey
  • Ariba wrote: »
    David Betz wrote: »
    ... I guess the thing that disappoints me most is that this thread seems to indicate that Parallax has no interest in C libraries. In any case, there is no call encouraging people to write them.
    With flexC you don't need special C libraries. Just use the Spin2 objects. They also work with C and BASIC. I think this is a huge advantage over what we had for the P1.

    Andy
    So I guess you're saying any "library" code has to be written in Spin2 and not in C. Yes, you can call Spin2 code from C but what if you want to develop your library in C because that's the language you're most comfortable with? I guess you could argue that Spin2 programmers could still use your library since you can call C from Spin2 but I doubt Parallax will be much interested in including the C library in their collection since it would only be usable from fastspin and not from Chip's Spin2 compiler.

  • AribaAriba Posts: 2,690
    For me it makes most sense to write libraries in Spin2, but I don't think Parallax has anything against C libraries in Obex.
  • Christof Eb.Christof Eb. Posts: 1,197
    edited 2020-06-26 18:09
    As micropython is based on C, how will it use Spin2 libraries?
  • Ariba wrote: »
    For me it makes most sense to write libraries in Spin2, but I don't think Parallax has anything against C libraries in Obex.

    This is correct.

    OBEX isn't working anymore, but the GitHub is!

    Do you want us to open up a repo for C libraries?

    Ken Gracey
  • ErNaErNa Posts: 1,752
    We can not talk as long as we talk about languages. If an object is clearly defined in requirements and functionality and there is a way to pass information forth and back, I personally don't bother how my partner created that object.I even will be willing to talk forth and not back ;-) if backed by the P2D2
  • ErNa wrote: »
    We can not talk as long as we talk about languages. If an object is clearly defined in requirements and functionality and there is a way to pass information forth and back, I personally don't bother how my partner created that object.I even will be willing to talk forth and not back ;-) if backed by the P2D2
    Cross language code use only works with fastspin of course. It can't be done with Chip's Spin2.

Sign In or Register to comment.