P2 (or P1) self hosted development options?
Haven't been around in a while, so I have a lot of catching up to do.
First of all, congrats to Chip, Parallax, and dare I say, the community as a whole for the release of the P2 (I told you I haven't been around in a while )
Realizing that for much of my uC use cases, I'd benefit from being able to develop directly on the uC, ideally interactively (at least partially), through a terminal emulator or the like, rather than the typical code-on-PC->compile->load->run method. I'm wondering what options currently exist for this. It looks like there might be BASIC and presumably FORTH (there always is, isn't there lol). Having to precompile and load things like drivers and libraries the "old fashioned" way isn't a deal breaker either, or rather, having that option could be convenient. I suspect a PASM compiler running on the prop would be relatively straight-forward, but what about something a bit higher level like [a subset of] SPIN or C or python or something?
Cheers,
Mark
Comments
You can do it with Micropython by having the text editor pye.py on attached uSD card.
Catalina can also self host a couple different ways, I think.
Might be a basic or two around...
Hi @mark
Welcome back!
I do use Taqoz Forth in the interactive way you describe your working. Peter has spend lots of hours to optimise this for P2 and it is stable.
It comes with an assembler and a number of low level drivers like i2c and SDcard. With Teraterm you can send over Forth text. I have also written an editor, which I find sufficiently convenient to really use. Most importantly Taqoz supports using of all 8 cores. In my opinion Forth had it's great days for PCs, when they had <512kB, so this Language and it's compactness and speed fits very well to P2.
While I use Forth most often, depending from the needs of the actual project, I would always check, if the Flex Compiler Suite might bring advantages. The compiler brings more speed and you can use more drivers or code others have written, because you can mix languages.
Have fun, Christof
Rayman,![:) :)](https://forums.parallax.com/resources/emoji/smile.png)
You missed plugging your success with Ladder Logic.
There is a also a Basic interpreter - work in progress - for EC32MB (needs PSRAM) - https://github.com/pik33/P2-Retromachine-Basic - https://github.com/pik33/P2-Retromachine-Basic/blob/main/The P2 Retromachine Basic 0.49 documentation.pdf
I'm another forth programmer that has developed a few things for Taqoz Reloaded. As you may know, a forth system freshly installed will start up and wait at the user prompt for stuff to be typed in. Just like old school operating systems like DOS. What I added to make the similarity even more so was that if an unknown word was typed in, then a file of the same name was searched for on SD card. If found, then the source code within was compiled and the code run. Have a look here at the code. To do the same in the other languages on the Propeller would take a lot more effort.
Cheers, Bob
Since you include P1 in your question, I'll just mention Sphinx (self-hosted Spin(1) compiler on P1).
m
It is a pity, that UPN was not introduced in the first place. CP/M had: target operator source. For good reason. Then MS-DOS introduced: source operator target . For good reason also: divide and conquer. The same story with HP and TI when introducing high price HP35 and affordable TI calculators. One UPN, the other uses brackets. That brings us to the good idea: before deciding it is always a good idea to switch on the brain. That's why we have the P1 and P2. It was not easy, but hard ;-)
Catalina.
Fully self hosted C, PASM. Basic, Pascal and Lua development on a P2 (requires PSRAM).
Lua, Basic and Pascal only on a P1 - no C or PASM (requires some kind of XMM RAM).
The C compiler is fully functional but a bit slow, but ok for the type of small programs typically written for a P2. PASM and Lua fully functional and fast.
Ross.
That’s impressive! I’m curious to know how many people actually use a self-hosted environment on the P2. It’s asked for a lot but I wonder how often it’s actually used.
Well, naturally, I use it a lot![:) :)](https://forums.parallax.com/resources/emoji/smile.png)
But mostly for Lua programming. I don't even bother having a Lua compiler on my PC, because it is so usable on my P2. I'm in the process of adding WiFi support, and of course I will be adding it to both C and Lua, because my next Propeller project is going to be written entirely in Lua.
Ross.
Did you optimize the Lua bytecode interpreter to use XBYTE (is that right?) on the P2?