By the end of August, Parallax will officially release the Propeller 2 PNut-TS (PNut TypeScript) open-source compiler. PNut-TS is a key component in our programming tools, offering developers and chip programmers the flexibility to use any operating system of their choice, including Windows, macOS, Linux, or Raspberry Pi. It even allows for direct programming from a browser—a likely topic for our first P2 community contest. Currently, the Spin2 compiler, PNut, was written in assembly language and is designed to run on PCs with x86 hardware. As a result, factory-supported programming of the Propeller 2 is currently limited to Windows-based computers running our Propeller Tool for Windows.
Our community has also successfully created alternative solutions to PNut by developing their own compilers. Notable examples include Eric Smith’s FlexProp IDE with his FlexSpin Compiler and MaccaSoft’s SpinTools IDE. These tools will continue to serve as effective alternatives, especially since both tools include a front-end Integrated Development Environment (IDE).
But there’s more to this release! At the core of the Propeller 2 toolchain is the Spin2 Interpreter, which works in tandem with the PNut-TS compiler. This interpreter is downloaded to the Propeller 2’s EE Flash or RAM during programming. The interpreter has always been distributed with our tools, but will also have the open source license attached to it. We will also release the Spin2 Interpreter with PNut-TS, enabling the community to contribute to extensions of the Spin2 language. One must carefully consider many details if they choose to work with this level of code.
What’s Next for Propeller 2 Programming Tools?
The first planned improvement to our programming tools is the addition of Visual Studio Code support across Windows, macOS, Linux, and Raspberry Pi. PNut-TS (or FlexSpin) is already compatible with these systems, and automatic compiler detection between PNut, PNut-TS, and FlexSpin will be integrated. The Propeller Tool will also allow users to choose between PNut and PNut-TS.
Our next objective is to develop a web-based compilation and download tool, which will be the focus of our upcoming community contest. The challenge will be to create a browser-based downloader for the Propeller 2. Details of this contest will be provided soon.
Request for Community Help
During the August 14th Propeller Live Forum, we will seek community assistance in testing Propeller 2 code in both PNut and PNut-TS. Detailed instructions will be provided at the forum, and the event will be available for viewing on the Parallax YouTube channel for those who cannot attend live. In the long term, we aim to enhance the OBEX code repository by incorporating an automated method for testing all code using these two compilers.
Where to Find the Files
Who needs access to these files? For most Propeller 2 developers, PNut-TS will simply appear as an option in the development tool you are already using, such as Propeller Tool or Visual Studio Code, within the next few months. If you are involved in creating development tools, extending the Spin2 language, or developing a browser-based downloader, you may require the PNut-TS and Spin2 Interpreter source code. As these systems are released this month, you will find them here:
- The Spin2 Interpreter will be available on OBEX (link to be provided soon).
- The PNut-TS compiler will be hosted on Stephen Morocco’s GitHub (link to be provided soon).
MIT License
Both codes will be released under the MIT license, an approved license by the Open Source Hardware Association, which also governs the release of the Propeller 1 Multicore Microcontroller.
Acknowledgments
The conversion of the code from X86 to TypeScript has been an eight-month effort led by Stephen Moraco of Iron Sheep and Chip Gracey of Parallax. These two engineers collaborated almost daily, converting the code line by line without interruption. This rigorous process was managed via GitHub, incorporating version control, test codes, and binary and output file comparison. They form a formidable team, each bringing unique skills to the project.
Please post any comments, questions or requests below and we will continue to update this news post with the latest information.
Ken Gracey
Parallax Inc.