PZST - an open-source Propeller IDE in development [ Version 1.0.1 released! ]
Andrey Demenev
Posts: 377
I already mentioned that I am in process of developing my own programming tool for Propeller. PST is not an option for me as I only launch Windows if I absolutely have to (for a hour once a week maybe ) I have been always using Brad Campbell's BST for Prop programming, and mostly was satisfied with it. But there are some troubles which make my work less productive than it could be, so I decided to create my own tool. Brad's compiler is great, especially because of its code optimization features, so I have no reasons not to use it in backend - that saved me a lot time, I do not have to write my own compiler at least
The work is still in progress, but I am posting here as I want community input on features list etc.
Source code can be found on google code : http://code.google.com/p/pzst/
Summary of what I intend to have in first version:
Further plans (not sure about these, need to evaluate):
Screenshot:
Your input is highly appreciated
The work is still in progress, but I am posting here as I want community input on features list etc.
Source code can be found on google code : http://code.google.com/p/pzst/
Summary of what I intend to have in first version:
- cross-platform application, written in Qt
- open source
- application UI localization
- Editor:
- syntax highlighting
- regular expression search/replace
- minimalistic code browser (quickly jump to method definition)
- Compiler/loader:
- serial port to use is specified explicitly (I do not like the loader to open all ports available and sending data - I may have whatever connected there)
- reliable operation with CP2102 USB/UART converter under Linux
- use of any character encoding for string constants, not only Latin-1
- Serial terminal:
- text/hex view
- logging
- macros
- can send as text, text with special chars (C-style \r, \n etc) and hex
- support for different 8-bit encodings
- Project manager:
- project-specific compiler options
- can add non-spin files to project for easy archive creation (SPIN sources + files to be put on SD card, for example)
Further plans (not sure about these, need to evaluate):
- code completion (type "serial." and get dropdown list with methods from FullDuplexSerial)
- simulator
- debugger
Screenshot:
Your input is highly appreciated
Comments
This sounds interesting. I like your requirements list. But, being on the outside of the project, some things are not obvious to me from the descriptions given.
What is Qt? Is this the nokia SDK? Is this a web application that can run on several different hardware?
So is this to be PropTool/BST type tool that runs on various hosts: windows PC, linux PC, mobile device, etc?
So this will be a front end for Brad compiler, but can run on various host platforms?
Qt is a cross-platform graphical user interface tool kit originally created by the Trolltech from Norway, now owned by Nokia. It is free and open source. It can be used to develop GUI appas fpr Linux, Mac, Windows, and mobile phone operating systems.
No, it is a toolkit to develop apps that run locally on your computer, like Windows MFC. It is used for the KDE desktop system and apps on Linux.
Yes.
Yes, yes. Presumably it could also use HomeSpun as a back end compiler.
Audacious project.
You might want to look into the new QML system for developing GUI's in Qt.
QML has a declarative language to describe user interface widgets and layouts mixed with java script. The result is that you can change the look and feel of an app without writing any C++.
So the app logic is in C++, the look is in QML.
At least it makes it easier to get away from the traditional looking tabs, buttons, menus and other widgets.
http://qt.nokia.com/products/qt-quick/
Heater, I would not go for QML for now - I need a tool to code for Propller now, and learning another tool would just take my time. QML looks cool, but not worth learning it for this project
I have one question for you. Are going to put the simulator option in your IDE? I think it will be helpful to test code before it is downloaded to the propeller chip and saves someone alot time.
Sorry for jumping so quickly here, I was on a roll with Qt from a discussion on another thread.
No, don't worry about mobile devices, or any other platform but your own for now. Anyone who is interested in perfecting things for other platforms can roll their sleeves up and contribute.
The iPad is out of bounds any way. Steve won't allow it. There is some restriction in the app store about not being allowed to use any languages than those sanctioned by apple.
Android is not currently supported although I believe someone is working on getting Qt working there.
However this would be great on ARM platforms, like my Beagle Board, a complete computer a bit bigger than a credit card:http://beagleboard.org/
Fair comment re: QML. Best not get diverted with new shiny things whilst you have your perfectly reasonable plan of action in mind. Besides I get the impression that QML has not quite stabilized yet.
For serial ports there is a crossplatform support library for Qt: http://qextserialport.sourceforge.net/
Even a ready made QT serial port terminal program http://qt-apps.org/content/show.php/QTSerialPortTerminal?content=77764
Like Cluso I also think this is going to be great.
The secret with a program like Qt is that it appears to be able to work on a wide variety of platforms. That is very important for writing an IDE - almost more important than the language it is written in.
What this also means is that many people could contribute.
I love the color syntax highlighting.
Drop down autocomplete implies some sort of pre-processing looking for all the spin methods and that would be a very useful addition.
Is your project going to be open source?
I did work for Nokia back in 98 prior to their purchasing the Qt company TrolTech, but only as a contract code monkey on a micro-wave base station development. At the time the KDE desktop using Qt was launched and I was immediately enamoured with it.
I'm not a C programmer, but I have a vague idea that C++ falls somewhere between C89 and C#. If so then I think C89 ought to work on this in console mode? So one could write some console type programs to do specific functions and run them from the main program.
I'm thinking for instance that I have some xmodem code for file transfers. I could write that as a console program using C89 syntax and maybe Andrey could add it as a drop down menu item?
I have been making some very interesting progress with BCX translating Basic to C. When I get home I'd like to see how Qt goes with some of the output from BCX. If that works, it could not only bring in Basic programmers, but could also be the start of running big basic programs that have been translated to Catalina. So this could fairly quickly lead to an IDE that can program in Spin, Pasm, Basic and C. Your choice.
Qt was very easy to download - it took 10mins on my work computer though my home computer might be a little slower (my download speed has been reduced as I went over the limit - my children have been downloading World of Warcraft patches again...)
The idea of C++ is to add classes and object oriented programming to C. C++ is designed to be backward compatible with C so C programs written to some recent standards will compile with a C++ compiler and integrate/link easily with C++ code.
C# is another kettle of fish, unlike C/C++ is does not compile to real machine instructions but to byte codes for running on a virtual machine like Java.
You seem to be considering two different things there:
1) Writing utility programs in C as stand alone console apps that can be invoked from something like PZST which is C++. This is no problem of course and the utility app could as well be written in any other language.
2) Writing code in C that can be linked into something like PZST. This should also be no problem provided a recent C dialect has been used.
One might want to build such utility code as a library for inclusion into the C++.
One might want to provide a C++ "wrapper" around the C code so that it can be used as a class.
Ha ...Think of, or create, a great new tool and immediately your eager users want a dozen new features that you never had in mind in the first place:)
Perhaps we should let Andrey at let get Qt Creator open first:)
By the way, what is "PZST", is it a Russian acronym for "Propeller Integrated Development Environment" or some such?
Trying to answer in order:
As I stated in first post, I have such idea, but it's not top priority
I am aware of it. Last time I checked, it did not support asynchronous read/write
I do not use Qt's built-in rich text editor. Great amount of work required to implement code folding, and tabstops specified in pixels, not characters - enough drawbacks making it not very good for source code editing. I use QScintilla, a Qt wrapper for Scintilla code editor. Scintilla was designed specially for code editing, implements code folding, and syntax highlighting framework is pretty easy to use.[Shameless plug: I am not new to this code highlighting business, I made Text_Highlighter PHP package that lives in PEAR repository, although I do not maintain it anymore - passed it to Stoyan Stefanov, currently a Yahoo! employee. By the way, I also sent a syntax module for SPIN to Stoyan, but seems he did not find time to release it in PEAR. And I made SPIN syntax definition for vim, of course ]
I have that partially done - see the sreenshot - there is a dropdown to quickly jump to method definitions in current file
Yes. I will be publishing the sources as soon as I clean up the code. I like to keep the code I share with others as clean as possible
My first goal is to make working SPIN environment. But having support for other languages sounds very attractive. So, first things first, and then we'll see
Well, that's not bad - I indeed think of it as source of great ideas I would never generate myself
PZST stands for "Propeller Zone Spin Tool", where "Propeller Zone" is the name of website I am setting up to attract attention of Russian-speaking to the Prop
So is your target host a generic PC to start with, or are going to further to specify a paticular flavor of say linux as your prefered? More detail as to you preference is better at this time.
I have a large amount of discarded PC for such projects, what would be the minimum requirements for host hardware?
Oh we are interested, you have your work cut out now:)
For just that we, or at least I as the only vim user around here, owe you a huge debt of gratitude.
Awesome effort.
I cannot give a precise expectation in terms of processor speed, RAM etc - I only can tell about my own expierence. I have been running my Qt applications on a 1GHz computers (don't remember what flavor of x86) with 512 MB RAM, under both Win XP and Debian without any hassles. Also, PZST runs on WinXP in a virtual machine just fine (512 MB RAM in virtual machine, on Debian host with 2GB RAM and 2 GHz Celeron).
I suppose a dialog box would work for many, but honestly that gets in my way. Having an alternative little text box (enabled as an option) that would accept VI style search/replace would be wonderful. Search starts with ? for up, / for down and just enter to start the search. For replace as well as read/write/delete SED commands are just fine.
Another item that is always useful is a "listed search" such as being able to use a "grep" command.
Brad's bstc can produce program list files which is very valuable for debug. Unfortunately, you can't search for stuff in BST's list window.
Being able to search for things in a serial terminal can also be very valuable.
Good luck with your program.
--Steve
Ok, I am going to do some work building some self contained command line modules. Then we can work together on code and you can add these modules later, either copy/paste, or by shelling out to those modules.
@prof_braino
Qt seems to work on lots of platforms, so it should not matter what sort of computer you have. Programs written in Qt include Skype and Google Earth. I always wondered how they got those programs to work on various platforms - Apple/Windows/Linux
I'm downloading Qt on my home computer at the moment. http://qt.nokia.com/downloads/
Back now... yes, that does take 45 mins or so to download and install.
Compilation is a second or so. Sweet.
I love the autocomplete. Type and as soon as you type the <, a dropdown menu appears with all the options.
How cool would it be for the same thing to happen in a Spin editor?!
But some folks feel that this is unnecessary extra work (though in a buisness environment that same people later complain when the project is 150% over budget and the schedule has been pushed back to double the original plan). Personally, I find it too expensive and time consuming NOT to engage process and review. Clearly you take on this project for the fun of writing the code. Would you be interested in an orginazied process of input and review? We have a pool of qualified experts to draw on, perhaps the exercise would be interesting.
I'm trying to open files, and I guess what I want is to be able to open a file in whatever directory I'm running the program from. So in that case, I don't specify any directory at all, and (hopefully) that means you don't have to worry about the different ways directories work in Windows and Linux.
So I have this simple little console program
and I can run it and it works fine. But now I want to compile it and turn it into an .exe
I've run "build" but I don't know where it ended up.
I did find an .exe in the folder C:\Qt\2010.05\untitled-build-desktop\debug
however, when I run this it says "the application has failed to start because mingwm10.dll was not found"
Now - I'll be a little annoyed if one needs .dlls all over the place, as I was hoping with a console application that it would create a self contained .exe file.
So, is this .exe the entire program? Do you need to put .dlls in? If so, how would that work on other operating systems? Has another .exe been created somewhere else that is self contained?
Any help would be most appreciated!
@prof_braino - that sounds interesting. Right now, the test is "is this even possible to do" but very soon hopefully it will be "yes this can be done" and then soon after that, "here is how it could work"
I'm referring to both code, and the idea of getting a group of people together to work on a common project. Hence my post above is partly to solve my problem, and partly to help the next person who might come along and want to contribute.
Sure, once we have something to test, testing will be very useful.
Having worked in the avionics and military sectors for a long while I know what you mean.
But it looks to me as if Andrey has it all already, it's all laid out in his mind clearly enough.
The high level user requirements are listed in the first post.
The implementation approach has been described to us.
The testing will be handled by us expectant and eager users out here:)
If there were a team starting to work on this from the get go and if the thing was big enough I would be also be encouraging the more formal approach.
As it is Andrey will have written the thing and got it working before anyone had time to draw up a design document:)
Since I woke up an hour ago I have been sucking on cups of coffee and composing an answer to that question:)
Dr_A,
We should not turn this into a Qt support thread there are forums dedicated to that already. But just this once.
If you can run it from the IDE, pressing the big greed triangle button, then you already have a .exe
If you hit the "project" button on the left hand side of the IDE it will take you to some tabbed pages where you can set up build configurations, debug/release, paths, etc. There you will see the path in which your app is built and run from. You can change it if you like.
Then hit the "edit" button to get back to your code windows and build and run again.
Yes because if you run the app from a command prompt it does not know where to find the libraries (.dll)
You should not be annoyed. Dynamic libraries is how the world works now a days. Having said that it is possible to build a self contained "static" executable.
It's the entire program of yours, but it needs those dlls to run.
On other operating systems the Qt IDE will be using different compilers, linkers, etc. Like GCC in Linux (and Mac I believe). The final binaries are different. You have to build for Windows on Windows, you have to build for Linux on Linux. If you want to build Windows and Linux binaries on the same machine it's probably best to use an emulator or Virtual Machine, like VMware or VirtualBox to run the target operating system and build for the target in there. I have built Qt apps for the ARM cpu using an ARM emulator on x86 Linux.
Anyway for now I would not worry about building self contained apps. just yet. You have enough to think about learning Qt:)
I just drop the required DLLs into the same directory as the exe and then it will find them. Perhaps that's a little waste full of disk space but with the tera bytes we have now a days I don't worry about that.
Otherwise you need to set the location of the DLLs into your PATH. Or you need to put them where Windows will look for them. See here: http://msdn.microsoft.com/en-us/library/7d83bc18%28v=vs.80%29.aspx
Hey, but as a Windows man you should know that already:)
You can search for the DLLs in your Qt installation directory, I forget where they are exactly just now.
When I get back to a Windows machine I'll see about building static apps.
As you may have heard, on Friday Nokia has jumped into bed with MicroSoft with the help of the MS mole, Nokia's new CEO Elop.
This means that MS now has control of Qt development. Given that MS code will now be used on future Nokia smart phones Qt will be marginalized, development will be stifled/halted the developers will be let go or leave.
MS now has control over a key technology that was about the only competitor to Windows.
I feel sick.
I can only hope that Qt has a big enough momentum in the world that it can continue without Nokia. Perhaps taken over by RedHat or Ubuntu or just surviving with the help of a community of companies and individuals who have a vested interest in it.
For Mac, I need help porting the serial port code - I do not have a mac
eserialport_win.cpp: In function 'void close()':
eserialport_win.cpp:5: error: 'fd' was not declared in this scope
eserialport_win.cpp:6: error: cannot call member function 'virtual void QIODevice::close()' without object
eserialport_win.cpp: At global scope:
eserialport_win.cpp:12: error: 'ESerialPort' has not been declared
eserialport_win.cpp:12: error: 'OpenMode' was not declared in this scope
eserialport_win.cpp:13: error: expected ',' or ';' before '{' token
make[1]: *** [debug/eserialport_win.o] Error 1
make[1]: Leaving directory `c:/Qt/pzst'
make: *** [debug] Error 2
Strange, the module exists. Any suggestions?
Same error happens if built in QtCreator.
Now the fix is commited to the repository