Is there any upgrades for the P2 Propeller Tool editor?
Capt. Quirk
Posts: 872
Any improvements for P2-Propeller Tool's:
find/replace, select all, or the workspace?
Bill M.
find/replace, select all, or the workspace?
Bill M.
Comments
I'm starting to use VS Code to edit P2 code. I use it every day at work for Python programming.
Does that mean that a lot of P1 spin will just work on P2?
If yes, can you post an updated pnut so I can give it a try out please?
I've been trying to port Kye's SD_FAT code (the upper level which gives file access as I've done the PASM code already). It would be so much easier if I could just use spin2 and fix just the specific compile errors
And will you release the compiler code to Eric so he can put it into Fastspin?
The new language has some differences from the old one. I plan to make a language description soon that covers everything in Spin2 and has a section on the differences between Spin and Spin2. It's 95% the same. Mainly, we can accommodate multiple return values now and ABORT works a little differently. Also, a lot of operators have changed to more textual versions, but maybe all the old ones can be supported, as well, for compatibility.
I want to get it complete before I put it out, but I may only be a few days from that.
The compiler code is all in 80386, so maybe nobody would want to look at it. The language description will be quite sufficient to support compiler writers.
Not immediately. We are using what we have that works in Windows and updating it for Spin2, as a first effort.
Pity.
Does the x86 compiler codebase use standard DOS/BIOS calls or does it make use of Windows API? I wonder if it might run in some DOSBox type of environment on non-Windows PCs?
Thanks Chip.
There isn't anything in the code that will be difficult to convert if necessary apart from looking at the abort code.
So I'm looking forward to trying it
Neither. It communicates with the host application through data structures. The host application (written in Delphi Pascal) does the storage, I/O, and user interface.
(The big problem here is that most PCs these days have AMD64 CPUs and running 32bit x86 code on AMD64 Linux (multiarch) takes a bit of fiddling and package-installing)
If the compiler is decently quick this time round, it could also be ran on ARM/POWER/MIPS/whatever through QEMU emulation.
I wonder how complex it is to turn 32-bit x86 code into ...into what? What is it even called? Is there some standard? What makes 64-bit code?
https://software.intel.com/en-us/articles/introduction-to-x64-assembly
With SIMD instructions, you might as well not program in assembly, since you wouldn't want to be bothered with figuring out how to pack in multiple data operations. Better to have a smart compiler get you good performance. They say near the beginning that x64 assembly is good to know if you are needing to locate bugs from compiler output or analyzing malware, but it's more practical to write in C and let the compiler figure out the SIMD (single-instruction multiple-data) instructions for you, as most programmers won't be able to better the performance of C. Sigh...
It's less about the SIMD instructions (which in the cases where they're most useful (vector/matrix operations) would obvious if their names weren't so cryptic) and more about the instruction pipeline and getting it to issue as many instructions at once as possible.
But yes, in most(but not all) cases, a C++ compiler will generate something about as good as you would have written.
Yes, the last things I need to add to the interpreter/compiler are some commands to facilitate smart pin usage. I need to think of what they ought to be and how much they should attempt to do.
I worked all night and got the last hard thing in the interpreter and compiler working: COGSPIN, which is like COGINIT for Spin. I could call it COGINIT, but then we'd have to put () around methods to force a PASM-style COGINIT, in case a method was used as the program-address parameter. Maybe better to keep them separate keywords.
Here is a little program I tested it with:
Here's with a method pointer:
I actually still need to code the for obj{[]}.pub{[]} case in the middle parameter. This is exceptional because it doesn't do what it looks like it does, as it never calls the method, but sets it up as an initial method to start the interpreter on.
Here's the interpreter code that does COGSPIN:
the Propeller tool to crash while closing the program.
Bill M.
- Can't change the "regular" background color despite there being a grayed-out box for it (is fixed as white)
- Text colors can not be relative to the block's default foreground (only exactly the same as block foreground OR relative to block background OR the same in every block type)
- Can't change colors of the line numbers and anything else outside the edit box (that may be difficult to accomplish, given most of the things outside seem like they are just regular ol' Windows built-in stuff)
These shortcomings work together to make it impossible to set a good light-on-dark scheme.
And yes, PLEASE make the find/replace box not modal.
Also, some bug reports:
- Sometimes, when you change resolutions while PropTool is running (or rather, when some program enters a low-res fullscreen mode?), the "Object Info" window gets super corrupted until you restart proptool. Haven't been able to reproduce it now.
- When you ...
1. Open a .binary/.eeprom file
2. click on the only entry in the object list inside the "Object Info" window (editor turns blank at this point)
3. Try to open another .binary/.eeprom file by double-clicking it in Explorer whithout closing the "Object Info" window first
... you won't be to open any files by double-clicking until you restart proptool. Super annoying when you're using an external compiler but need proptool to load the binaries (since it is the only loader I can semi-reliably use without DTR auto-reset on P1)
(note: I'm slowly working on a new set of compiler tools written in Typescript/JavaScript. To cut my teeth on the various libraries I'm using, I'm starting with support for P1. The lack of a BNF-like definition has made it a little challenging, though. For instance, a symbol is defined as /[_a-zA-Z]\w*/ using regex syntax, but that fails for local symbols in DAT sections. In that case, you need a separate production that includes the colon, which is not immediately clear from the propeller manual. A BNF-like definition would make this kind of thing very clear.)
> Would it be possible to get the language definition in a formal language like BNF?
>
> (note: I'm slowly working on a new set of compiler tools written in Typescript/JavaScript. To cut my teeth on the various libraries I'm using, I'm starting with support for P1. The lack of a BNF-like definition has made it a little challenging, though. For instance, a symbol is defined as /[_a-zA-Z]\w*/ using regex syntax, but that fails for local symbols in DAT sections. In that case, you need a separate production that includes the colon, which is not immediately clear from the propeller manual. A BNF-like definition would make this kind of thing very clear.)
Looks interesting. I just read up on BNF. I don't have time to do it, right now, but it shouldn't be too hard if someone wanted to do it.
I'd be happy to help out. And I completely understand why you don't want to do it right now. These things can get quite involved for a non-trivial grammar. On the other hand, that's when these can be the most helpful.
Ah, it happened again... not sure what I did to cause it.
So like searching for "foo" will match foo, but not food or foobar. It may be that proptool is not properly handling the = vs == case when Whole words is checked, so maybe just fix that?
Usually the whole word matching should only allow whitespace and certain key symbols to be touching the word, such as quote or comma or underbar. So == should be considered a "whole word" and thus not match a search for "=".
It's much easier than having to list all possible things to exclude.