Shop OBEX P1 Docs P2 Docs Learn Events
New PNut-TS compiler for P2 development on Windows, Mac, Linux (yes, RPi) - Page 3 — Parallax Forums

New PNut-TS compiler for P2 development on Windows, Mac, Linux (yes, RPi)

13»

Comments

  • Hi @"Stephen Moraco",

    Just some more info on this issue:
    I am running on the latest Debian 13 Trixie but also see the same on Fedora 42 and Debian 12

    I can run from command line but would really like to understand the VSCODE situation.

    I appreciate your tremendous work in the propeller community and understand you are juggling many things !

    Thanks
    Bob

  • NEWS

    We've just released v1.52.2; we've improved performance where we can.

    Here's what's new/fixed:

    v1.52.2

    Improved performance

    • Several small changes to the code allow us to compile faster (I'm seeing ~1.9x to ~2x), but this depends on the style of your code. Your mileage may vary.

    PNut-TS is found at its Public Repository, while the latest Releases are also found there at the Releases Page

    We do comprehensive regression testing in preparation for each release. We also add to our regression suite to test all new capabilities. You can review our coverage testing via regress at PNut-TS Coverage Testing

    If you spot any issues with code generation or compilation, you can review the testing process. This should help you identify differences between PNut v52a and PNut_TS v1.52.2.

    We look forward to hearing what you find.

    As always, you can report issues here, or, better yet, if fixes are needed, report problems on the repository issues page. (You can also see the current list of what's been reported at this page.)

    Stephen & Chip

  • NEWS

    We've just released v1.53.0. (PNut v53 parity)

    Here's what's new/fixed:

    v1.53.0

    Added

    • Language: OFFSETOF(struct.member) compile-time function — returns byte offset of a member within a structure definition
    • Language: Support for {Spin2_v53} language version directive
    • CLI: Allow filename without .spin2 extension — resolves to .spin2 if file exists in current directory

    Fixed

    • Language: CASE block colon parsing now validates colon token (3 locations changed from get_element to get_colon)
    • BUGFIX: Fixed {Spin2_v##} version tag not being detected when preceded by blank lines after header comments. Files with comment blocks followed by a blank line before the version tag would silently default to v41, causing keywords like STRUCT and SIZEOF to go unrecognized
    • BUGFIX: Fixed off-by-one error in inline {...} comment handling within the elementizer. Non-doc comments embedded mid-line (e.g., long {old_value}$FF0000) would eat the first character after the closing }, producing cryptic "Undefined symbol" errors
    • Diagnostics: When a version-gated keyword is used without the required language version, the compiler now reports "STRUCT" requires {Spin2_v45} or later instead of the misleading Expected "=" "[" "," or end of line
    • Compatible with PNut_v53.exe

    PNut-TS is found at its Public Repository, while the latest Releases are also found there at the Releases Page

    We do comprehensive regression testing in preparation for each release. We also add to our regression suite to test all new capabilities. You can review our coverage testing via regress at PNut-TS Coverage Testing

    If you spot any issues with code generation or compilation, you can review the testing process. This should help you identify differences between PNut v53 and PNut_TS v1.53.0.

    We look forward to hearing what you find.

    As always, you can report issues here, or, better yet, if fixes are needed, report problems on the repository issues page. (You can also see the current list of what's been reported at this page.)

    Stephen & Chip

  • RaymanRayman Posts: 16,197

    @"Stephen Moraco" Just tried installing this on Windows (as part of getting dual FS working).
    Have to say, the install is very complicated. Hope it can be simplified in the future.

    Got to the end and realized also need to install VSCode and set that up. Shelved it at that point.
    Is there no way to include a preconfigured VSCode exe into the distro?

    Also, appears that regular PNUT and PropTool are part of the install... Why is that?
    Might consider dropping that if not really needed...

  • @Rayman, this shouldn't be that hard... can you take me down the path you followed? Each tool is standalone and does not require any others, so I'm confused about what you are seeing.

    The releases page from which you downloaded the compiler takes you to a Windows installation page that just says to download the .zip file, unpack it, and place it in the same location where you keep tools on your system. Add the path to it in your user or system environment, and then you just run it from the command line. It is completely standalone. I do not make Windows installer packages, so the move and setup environment has to be done by hand.

  • RaymanRayman Posts: 16,197

    Guess landed here: https://github.com/ironsheep/P2-vscode-langserv-extension/blob/main/TASKS-User-win.md#installing-pnut-ts-on-windows

    This is maybe an overcrowded page with instructions on how to install almost everything...
    Maybe a simplified page with just pnut-ts would be nice?

    Just want the very minimum needed to get it working.
    Actually have to figure out if want pnut-ts or pnut-ts-term.
    I downloaded the pnut-ts-term thinking that would be the full thing with a terminal window, but seems it's just the terminal.

    Thinking now that pnut-ts is where to start and maybe it can compile from the command line once installed?

    Why are pnut-ts and pnut-ts-term two separate things?

  • Stephen MoracoStephen Moraco Posts: 457
    edited 2026-03-24 21:58

    @Rayman, good question. pnut-ts is the pnut compiler rewritten for cross-platform support, while pnut-term-ts is the downloader, debug displays, and PST replacement with automatic logging also full cross-platform.

    When you install any of these, use pnut-ts --help or pnut-term-ts --help to get the built-in command line help.

    Re the overcrowded page... each OS page is the full page for installing and running the full VSCode-based development environment, which includes the compiler of your choice (depending on OS) and the downloader of your choice. Flexspin is supported, along with the downloaders that come with Flexspin.

    If one thinks of the entire toolchain, I could end up with nearly 10 different install pages, so I've opted for a single development install, so if one chooses one or two tools early, they'd be set up by following the single instructions in a way that would allow one to add more until the entire toolchain environement is setup to work together.

  • RaymanRayman Posts: 16,197

    Ok, so I need pnut-ts and pnut-term-ts to be able to compile and load?
    If so, seems like they should be combined into one thing?

    Hopefully, I can install them in the same folder.

    There isn't an editor here, right?
    Maybe I can set this up as external tool in Spin Tools IDE?

  • @rayman, to your question, you can use any downloader; the compiled .bin is not specific to any downloader.

    @JonnyMac has been teaching us about how to run external tools from the Spin Tools IDE, so yes, that will work.

    I run with VSCode as my editor with the Spin2 extension providing full support for editing, compilation, and download.

    I also run the compilation and testing from a shell script.

    And I also run pnut-term-ts in headless mode when I don't need the PST part, which downloads, captures the debug log, and terminates. This is how i do my regresison testing.

Sign In or Register to comment.