Shop OBEX P1 Docs P2 Docs Learn Events
Python for P2 - Page 4 — Parallax Forums

Python for P2

124»

Comments

  • I'm still thinking I can get MicroPython running in xmmc mode on the P1. :smile:
  • Roy Eltham wrote: »
    Also, I didn't notice anyone stepping up with LLVM experience, while a few of you that worked on propgcc are still around.
    That is what I remember as well. So I guess LLVM can be off the table. That leaves us with GCC or Eric's compiler. I still think the multi-language support provided by Eric's compiler makes it compelling.

  • cgraceycgracey Posts: 14,152
    edited 2018-12-02 00:31
    David Betz wrote: »
    Roy Eltham wrote: »
    Also, I didn't notice anyone stepping up with LLVM experience, while a few of you that worked on propgcc are still around.
    That is what I remember as well. So I guess LLVM can be off the table. That leaves us with GCC or Eric's compiler. I still think the multi-language support provided by Eric's compiler makes it compelling.

    Eric's compiler does some nice things, like dead code removal. One other nice thing about his work is that it doesn't inherit a giant mass of uknown stuff.
  • cgracey wrote: »
    David Betz wrote: »
    Roy Eltham wrote: »
    Also, I didn't notice anyone stepping up with LLVM experience, while a few of you that worked on propgcc are still around.
    That is what I remember as well. So I guess LLVM can be off the table. That leaves us with GCC or Eric's compiler. I still think the multi-language support provided by Eric's compiler makes it compelling.

    Eric's compiler does some nice things, like dead code removal. One other nice thing about his work is that it doesn't inherit a giant mass of uknown stuff.
    GCC does dead code elimination as well of course. But you're right. I was thinking of that earlier. Eric obviously understands his code perfectly and I've looked at his code enough that I think I can understand it as well. I don't think anyone can say that about the GCC code base. It's pretty opaque and has a steep learning curve. That's why I'm thinking that Eric's compiler might be the best solution as long as Parallax and its customers don't demand C++ support.
  • cgraceycgracey Posts: 14,152
    Well, that would be awesome to have something more homegrown and understood.
  • David,

    I don't know about the P2 but for the P1 people often want to use an Arduino library if it already exists and some of the ones I have seen are written in C++.
  • Genetix wrote: »
    David,

    I don't know about the P2 but for the P1 people often want to use an Arduino library if it already exists and some of the ones I have seen are written in C++.
    Yes, there is that. Actually, can we move this discussion to the "Status of P2 C/C++ Compiler?" thread as Dave Hein suggested a while back?
  • David Betz wrote: »
    I'm still thinking I can get MicroPython running in xmmc mode on the P1. :smile:

    I've been thinking about this and it seems like it should be possible. It would be a good proof of concept. Maybe a new thread in the P1 forum?
  • Another two options:
    i. Something like vbcc (compilers.de). It's a teeny tiny C compiler (obviously, not useful for C++ so probably a no-go as it won't do arduino compatability).
    ii. A commercial compiler compiler like CoSy which could rapidly speed the process up.
    iii. Engaging ace.nl (who wrote CoSy) to do the LLVM backend port. Since the number of ports they've done are likely in the tens they should be pretty damn efficient at it now.

    I'm digging around some other sources and ideas, but failing that gcc is still probably the quickest route to ground but the next question would be, which major rev?
  • __red__ wrote: »
    I'm digging around some other sources and ideas, but failing that gcc is still probably the quickest route to ground but the next question would be, which major rev?
    Easiest would be to use the same rev that P1 PropGCC uses. It already supports an older version of the P2 instruction set. Also, Eric has done some work on moving P1 PropGCC to a newer GCC rev but there have never been the resources to validate it for use with the Simple Libraries. Really, I think the best way to get PropGCC generating P2 code is to enlist Eric Smith's help. He wrote the P1 code generator and understands it better than anyone else.

  • I think C++ should be a requirement. Most people that say "C" actually mean C/C++ as in one of the big 3 (gcc, llvm, msvc). Arduino is C++, AVR MCUs are C++, Pretty much everyone has C++.

    We already have a working gcc for P1. It can't be that much to get it targeting P2 with basic functionality. It can be incrementally improved over time.

    If you go down the C only path, then it needs to at least support the full C standard (C99 being the minimum I think). Does Eric's C compiler do that? I still think not supporting C++ is a bad idea.
  • David BetzDavid Betz Posts: 14,516
    edited 2018-12-02 11:44
    Roy Eltham wrote: »
    I think C++ should be a requirement. Most people that say "C" actually mean C/C++ as in one of the big 3 (gcc, llvm, msvc). Arduino is C++, AVR MCUs are C++, Pretty much everyone has C++.

    We already have a working gcc for P1. It can't be that much to get it targeting P2 with basic functionality. It can be incrementally improved over time.

    If you go down the C only path, then it needs to at least support the full C standard (C99 being the minimum I think). Does Eric's C compiler do that? I still think not supporting C++ is a bad idea.
    I think Eric's plan s to support some version of the ANSI C standard. I don't know how likely it is that he'd go on to support C++ as well though.

  • RamonRamon Posts: 484
    edited 2018-12-02 12:17
    [edit: moved to correct thread (c/c++ status]
  • Ramon,
    That requires a lot of work, and on an ongoing basis. I don't think anyone here can commit to that.
  • RaymanRayman Posts: 14,646
    edited 2018-12-02 14:07
    I also want C++ (At least, I think so).
    Will be interesting to see what I like better when all the options are available...

    Spin 2 has a syntax more like C+ now... I really disliked ">=" not working like C++
    I suppose it's possible that I'll wind up liking Spin2 more that C++ for P2 work...
Sign In or Register to comment.