Shop OBEX P1 Docs P2 Docs Learn Events
Good IDE for Spin+PASM, maybe PropC — Parallax Forums

Good IDE for Spin+PASM, maybe PropC

AwesomeCronkAwesomeCronk Posts: 1,055
edited 2019-09-29 23:05 in Propeller 1
I recently reset my PC entirely, and have been looking to upgrade to a new IDE for P1. I must have Spin1/PASM, and Prop C would be a bonus. I use Windows 10.

Thanks!
«1

Comments

  • kwinnkwinn Posts: 8,697
    How about ersmith's FlexSpin. Assembly, Spin, BASIC, and C in one compiler.
  • kwinn wrote: »
    How about ersmith's FlexSpin. Assembly, Spin, BASIC, and C in one compiler.
    You probably can configure it to use OpenSpin instead.
    Maybe this should even be added as an easily selectable option in FlexGUI.
  • So, FlexSpin and OpenSpin are compiler/IDEs?
  • What sort of IDE are you looking for, and what do expect it to do for you. There is a PropellerIDE, you get to use Spin, but no "PropC". There is also SimpleIDE, you get to use "PropC", but no Spin. The fastSpin stuff has been mentioned, which has a flexGUI IDE, but a warning, it is a very, very basic IDE. The default for flexGUI is setup for the P2, so you have to remember to set it up for the P1.

    Ray
  • I want to be able to “call” files from multiple languages, if possible.
    OBJ
      cprogram : “cprogram.cpp”
    

    If I could use spin code like that, and call prop c code from spin, and call spin code from prop c, then that would be nigh on perfect.
  • then fastspin is your solution, it can use C (not C++) from Spin or BASIC, and vice versa, but it compiles to Assembler not bytecode so programs are significant larger.

    Mike
  • I want to be able to “call” files from multiple languages, if possible.
    OBJ
      cprogram : “cprogram.cpp”
    

    If I could use spin code like that, and call prop c code from spin, and call spin code from prop c, then that would be nigh on perfect.

    Be aware, you'll get to the "right" answer faster if you start with these kinds of requirements. "IDE" is the wrong question to be asking about at this level. Start by asking what tools support that feature (or one similar) and then find out what editors (IDEs) work (well) with that tool.
  • I want to be able to “call” files from multiple languages, if possible.
    OBJ
      cprogram : “cprogram.cpp”
    

    If I could use spin code like that, and call prop c code from spin, and call spin code from prop c, then that would be nigh on perfect.

    FlexGUI (https://github.com/totalspectrum/flexgui/releases/latest) can do that. FlexGUI is a very simple IDE that uses the fastspin compiler to compile PASM, BASIC, Spin, and C, for both P1 and P2. Note though that because it uses the fastspin compiler rather than PropGCC, only fairly simple C programs may be compiled. The "simple" libraries haven't been ported to FlexC yet, for example. Also, as an LMM compiler the code fastspin produces for Spin is larger than that produced by other Spin compilers (but also much, much faster).
  • So, I can call multiple languages within my code, then program the prop with a hot key or button?
  • yetiyeti Posts: 819
    edited 2019-10-01 10:23
    Some polyglot examples are hiding in the "Testing the new Fastspin Assembly, Spin, BASIC, and C for P1" thread.

    https://forums.parallax.com/discussion/comment/1453190/#Comment_1453190 ... uses a Spin object in FlexBASIC
    https://forums.parallax.com/discussion/comment/1453582/#Comment_1453582 ... uses own FlexC code in in FlexBASIC
    https://forums.parallax.com/discussion/comment/1478735/#Comment_1478735 ... uses a function from FlexC's stdlib in FlexBASIC
    https://forums.parallax.com/discussion/comment/1478765/#Comment_1478765 ... uses FlexC's stdio in FlexSPIN.
    https://forums.parallax.com/discussion/comment/1479088/#Comment_1479088 ... uses own Spin code in FlexBASIC.

    These examples are independent of the IDE. Just use FastSpin with whatever editor or IDE you want.
  • AwesomeCronkAwesomeCronk Posts: 1,055
    edited 2019-10-01 11:32
    Ok. Now, is there an editor that will handle these simultaneously, or should I run Visual Studio for C?

    Edit: looked at that syntax, which is PRECISELY what I wanted! Thanks!
  • RaymanRayman Posts: 15,672
    I use the PropTool for P1... It has some issues, but is hard to beat...

    I'm also slowly working on SpinEdit, which is capable of using any of the P1 compilers (and also Fastspin for P2).
    But, I only really use it for P2...
    http://forums.parallax.com/discussion/169259/spinedit-editor-for-spin-spin2-and-fastbasic/p1
  • Ok. Now, is there an editor that will handle these simultaneously, or should I run Visual Studio for C?

    Edit: looked at that syntax, which is PRECISELY what I wanted! Thanks!

    There are two separate issues: the compiler that translates source code to P1 (or P2) binary, and the editor/IDE that lets you enter code.

    The fastspin compiler is the only one I'm aware of that lets you use multiple languages together that easily for the Propeller. But note that it is a different compiler from PropGCC, so while fastspin lets you use Spin, BASIC, PASM, and C, it doesn't have the same libraries as PropGCC.

    You can use fastspin with any configurable IDE or editor -- all it needs is ASCII text.

    There is a simple IDE called FlexGUI that comes with fastspin already integrated, and I would suggest you take a look at it:

    https://github.com/totalspectrum/flexgui/releases/

    The editor build in to FlexGUI works with any language, but it does not have any special features like syntax highlighting -- it's just a plain basic editor. There are simple buttons for compile and run and to switch between P1 and P2.
  • @oliverhbailey,

    welcome to the forum, again.

    You wish is understandable, but it is not really easy to get changes to say GCC upstream and included into the official release of GCC.

    So PropGcc got stuck on gcc 4.x somewhere and Parallax stopped changing anything since they are using it for BlocklyProp and their whole educational work.

    Same goes for repositories of Linux distributions, they simply do not take everything you want them to offer.

    This is part of the reason people tend to build stuff by themselves on Linux.

    The IDE's you are looking for are SimpleIDE (C/C++) and PropellerIDE (SPIN) they run on Linux. OpenSpin (spin bytecode compiler) also can be build for Linux, same goes for the newer Stuff for P1/P2.

    But all of this are forum user created programs, not Parallax and they, for sure, get nothing upstream into the Debian or other Linux repos.

    Parallax itself just provides Software for Windows (And Chromebooks online)

    So you are pretty much on your own there.

    Mike
  • yetiyeti Posts: 819
    edited 2019-10-01 22:40
    Building PropGCC4 is easiest on the Raspberry PI with up to Raspbian9 because there is a gcc-4.6 package. It vanished with the release of Raspbian10. Unluckily I could not build this gcc-4.6 package from Raspbian9's sources on the current Raspbian10, but grabbing it and its dependencies form Raspbian9 as binaries and forcing them into Raspbian10 still works. We'll see how long.
  • AwesomeCronkAwesomeCronk Posts: 1,055
    edited 2019-10-02 13:16
    Request for assistance from the creator of FlexGUI or experienced users of said software:

    Unpacked the contents of the zip file into path 'C:/Program Files (x86)/Parallax Inc/FlexGUI'.
    Ran FlexGUI.
    Attempted to close FlexGUI.
    Received error log in attached .txt file
    Killed FLexGUI via Command Prompt.
    Tried to open .spin files with FlexGUI and got a whole slew of issues.

    Help please.
  • RaymanRayman Posts: 15,672
    Sometimes, you can't put things into the Program Files folder without being administrator...
    Even if you are admin, Win10 sometimes won't let you do it...

    Try making a C:\FlexGUI folder and put it there...
  • As Rayman said, it seems like a permissions issue. Personally I would just put it on my desktop or downloads folder, or make a folder at C:\. The "Program Files" directories on Windows are special and generally need special permissions to access.
  • JonnyMacJonnyMac Posts: 9,457
    edited 2019-10-02 17:13
    Try making a C:\FlexGUI folder and put it there...

    Yep. I created a folder called C:\MyPrograms and install IDEs and other tools there -- including the original Propeller Tool. This gives me access to the libraries folder which isn't available [without a lot of gyrations] when installed in Program Files (x86)
  • Hmm, I’ll try that in a bit.
  • Yep it works. Thanks all!
  • Moved to C:/Propeller IDEs/FlexGUI

    Can’t open spin files in FlexGUI from the file explorer.
    Can’t compile.
  • Moved to C:/Propeller IDEs/FlexGUI

    Can’t open spin files in FlexGUI from the file explorer.
    Can’t compile.

    Can you give us some clues as to what's going on? What did you try to do? What error messages you're getting, or any alert boxes?
  • For example, here's a successful use of FlexGUI:

    (1) Unzip FlexGUI to C:\Parallax\flexgui
    (2) Double click on C:\Parallax\flexgui\flexgui.exe
    (3) The FlexGUI window opens up. I can see a command bar that has "Compile for P2a" "Run Binary" and similar buttons, and a message that says "Use Commands>Configure Commands... to switch to P1".
    (4) So I go to the Commands menu and select Configure Commands...". I get an "Executable Paths" dialog box with a button that says "P1 defaults". I click on that and then "OK".
    (5) Now I go to the "File" menu and select "Open File". A file selector comes up. I navigate to Parallax\flexgui\samples and select "hello.spin" then "OK". The hello.spin file is loaded into the tab.
    (6) Now I hit the "Compile & Run on P1" button. Some messages appear in the "Compiler Output" window at the bottom indicating that the program has been compiled, and a Windows Firewall message appears about proploader.exe. I click "OK" on that (proploader wants to look for networked P1s, but I don't have any so it doesn't matter). Then a "Propeller Output" window pops up with "Hello, world!" being printed in it over and over.
  • ersmith wrote: »
    F(6) Now I hit the "Compile & Run on P1" button. Some messages appear in the "Compiler Output" window at the bottom indicating that the program has been compiled, and a Windows Firewall message appears about proploader.exe. I click "OK" on that (proploader wants to look for networked P1s, but I don't have any so it doesn't matter).
    Hmm... That doesn't sound good. I should fix proploader so it doesn't try to look for network devices if you specify -s to do a serial load.
  • AwesomeCronk, try double-clicking the flexgui application in the C:/Propeller IDEs/FlexGUI directory. I did this on my Windows 10 PC, and it works fine. I also put a shortcut on my desktop, and that works as well. If you are compiling for the P1 you may need to go into the "Commands/Configure Commands" menu item to set it for the P1 defaults.

    I'm not sure how to set it up so that you can click a source file using the file explorer. Normally you would right-click on a source file with the appropriate extension, such as c, spin or spin2. You would then click on "Properties" and then under the "Opens with" item click "Change". You would then need to click "More apps" and then click "Look for another app on this PC". Once you locate flexgui.exe you would then click on this. I tried this, but it complains that it can't find a usable init.tcl file. And then it complains that it can't find flexgui.tcl. So apparently a TCL file is needed if you want to be able to start flexgui by clicking on a source file.
  • I have a desktop shortcut to that specified file. I am using the P1 defaults. That TCL issue is what I got when I tried to open .spin in FlexGUI form File Explorer. Using File->Open File then navigating to the target file from FlexGUI, I can open the file.

    Using P1 defaults, this is the error that FlexGUI tells me when I click 'Compile & Run on P1':
    "./bin/fastspin" -l -O1 -L "./include" "C:/Program Files (x86)/Parallax Inc/Propeller Tool v1.3.2/Library/_Demos/Parallax Serial Terminal Demo.spin"
    Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2019 Total Spectrum Software Inc.
    Version 3.9.33 Compiled on: Sep 22 2019
    No such file or directory
    Parallax Serial Terminal Demo.spin
    Unable to open file `Parallax Serial Terminal': child process exited abnormally
    Finished at Wed Oct 2 20:38:27 2019
  • I tried it, and I got the same error messages. fastspin could not find the file "Parallax Serial Terminal.spin". I tried adding -L "C:/Program Files (x86)/Parallax Inc/Propeller Tool v1.3.2/Library" to the Compile command line, and that fixed it.
  • Ok I’ll try that any where from two days to a week from now.
  • yetiyeti Posts: 819
    edited 2020-05-05 03:56
    IDEs...
    Hmmm...
    I still can't get excited about these.

    For ages I've used simple editors and and thought of them like just different coloured screwdrivers which can be used interchangeably. A file is a thing and I use whatever editor is at hand. The steps of compiling, downloading and executing the stuff I'm working on just have their own tools. Sometimes OpenSpin is needed because code density is more important than speed, sometimes the opposite is important and FastSpin can show its strengths. And downloaders are diverse too. Sometimes I just use them (edit, compile, download) sequentially in the shell, sometimes in a script and on bigger projects Makefiles come in handy. I like this stoneage way because it gives me the least locked in effect.

    Currently I'm experimenting with Emacs' Org/Babel. I'm writing my stuff in Emacs, code goes into special blocks e.g. tagged like
    #+BEGIN_SRC spin :tangle hello-world.spin
    obj
      stdio: "stdio.h"
    
    pub main
      puts(string("Hello there!"))
    #+END_SRC
    
    and when I type ctrl-c ctrl-v ctrl-t, all such blocks get written to the files named in their BEGIN line. Other blocks like
    #+BEGIN_SRC sh
    fastspin -O2 hello-world.spin
    #+END_SRC
    
    get executed by hitting ctrl-c ctrl-c in them, so they do the compiles. A block like
    #+BEGIN_SRC sh
    spinsim -b hello-world.binary
    #+END_SRC
    
    finally will run the result. This might be done using a propeller loader too.

    Adding some more directives to the header controls what will be exported when stuff is converted to PDF, HTML, LibreOffice, ... and lots of other formats. So this is not only a high level way to script stuff, it produces documentation on the fly. Or is it the other way round? While documenting you are coding, compiling, running, ... your stuff?

    Locked in syndrome?

    All that stuff Emacs processes is plain text. It is kind of readable in its source form propeller-cauldron.org (tell your browser that this is UTF8 text) and maybe this looks a bit scary for some minutes but one really can get used to it. It definitely can be split into files again without Emacs and the text can be understood as is. So being locked in is not a realistic danger of this source format.

    The HTML export of this one is propeller-cauldron.html and already looking nicer. I've not tested other export formats intensively because HTML is (good enough)™ for my needs and fairly portable.

    I'm still exploring what's possible with this environment but I'm fairly certain, that I like it for documenting code while keeping all needed parts together.

    Is it scripting?
    Is it documentation?
    Is it archiving?
    Some call this way of doing stuff "reproducible research".

    I'm still scratching only the surface of the possibilities and I'm happy about finding out more stuff. E.g. today I finally found a way how to tell Org/Babel not to see a_b as a with subscript b. Before finding how to switch this off, filenames like VGA_512x384_Bitmap.spin were an unsolvable problem for me.
    Edit@20200505 - Updated the '.org' and '.html' files.
Sign In or Register to comment.