Shop OBEX P1 Docs P2 Docs Learn Events
Python for P2? — Parallax Forums

Python for P2?

Where do we stand with Python on P2? I guess there were two ports, one using p2gcc and the other using Eric's RISC-V JIT interpreter/compiler. Has anyone tried porting Python to FlexC?

Comments

  • You are right as I far as I know. There were two ports done. Eric's has more heap available which is really nice but slightly slower and a little less deterministic due to JIT/caching etc. The version I had is a bit faster in general but uses more heap. I am waiting for ntosme2 to get his GCC P2 port into a full state of readiness so we can hopefully migrate over to that toolchain at some point and see how it compares. Been meaning to update his toolchain again to see how it's progressing but am flat out on this DVI thing. Have you had a chance yourself to see where it's at?
  • Not recently. I have been away for several weeks and am trying to get back up to speed.
  • Ozprop and I had a play with Rogloh's native micropython yesterday. We need to straighten out some terminal issues with both PST and Flexgui (possibly just need later versions) to improve the user experience.

    Using the native micropython with Teraterm was great - tabs and cursors work as you'd expect, and there is a good mix of inbuilt code, but it would be great to get it going better with PST

  • Tubular wrote: »
    Using the native micropython with Teraterm was great - tabs and cursors work as you'd expect, and there is a good mix of inbuilt code, but it would be great to get it going better with PST

    I think micropython generally outputs plain ANSI escape sequences, so the flexgui terminal should support it fine (depending on the underlying console device I suppose; in Linux it works without issue, I haven't tried as much in Windows).

    My micropython comes with a USB driver and complete ANSI terminal support for VGA, so you also have the choice of doing everything natively (e.g. it can run the pye python editor on the P2). The VGA driver is fairly generic, it probably wouldn't be hard to port it to Roger's micropython.

  • I'll revisit this in coming days and sort out the silly stuff. The flexgui terminal was shutting down quickly for some reason which is probably just a command line switch or perhaps needs a fresh installation perhaps use a new PC. I think the loadp2 command ended in -t -k but will go back and check.

    Its good you have a VGA driver that works with Pye, Eric. And Roger will likely have DVI covered too, so two good reference incarnations to play with.

    The USB driver I take it is GarryJ's ?
  • Tubular wrote: »
    The USB driver I take it is GarryJ's ?

    Yes, it's GarryJ's. I converted his Spin wrapper to C, which should be usable in any C compiler.
Sign In or Register to comment.