Shop OBEX P1 Docs P2 Docs Learn Events
PZST - an open-source Propeller IDE in development [ Version 1.0.1 released! ] — Parallax Forums

PZST - an open-source Propeller IDE in development [ Version 1.0.1 released! ]

Andrey DemenevAndrey Demenev Posts: 377
edited 2012-09-13 17:32 in Propeller 1
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:
  • 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:
pzst.jpg


Your input is highly appreciated
1024 x 717 - 136K
pzst.jpg 136.4K
«1345678

Comments

  • prof_brainoprof_braino Posts: 4,313
    edited 2011-02-06 21:48
    ... my own programming tool for Propeller. .. not ... Windows ... Brad's compiler .... community input on features list etc.

    [*]cross-platform application, written in Qt
    [*]application UI localization
    [*]syntax highlighting
    [*]regular expression search/replace
    [*]serial port to use is specified explicitly
    [*]reliable operation with CP2102 USB/UART converter under Linux
    [*]text/hex view

    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?
  • Heater.Heater. Posts: 21,230
    edited 2011-02-06 22:04
    prof_braino,
    What is Qt? Is this the nokia SDK?
    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.
    Is this a web application that can run on several different hardware?

    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.
    So is this to be PropTool/BST type tool that runs on various hosts: windows PC, linux PC, mobile device, etc?

    Yes.
    So this will be a front end for Brad compiler, but can run on various host platforms?

    Yes, yes. Presumably it could also use HomeSpun as a back end compiler.
  • Heater.Heater. Posts: 21,230
    edited 2011-02-06 22:10
    Andrey Demenev,

    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/
  • Andrey DemenevAndrey Demenev Posts: 377
    edited 2011-02-06 23:24
    prof_braino, Heater has answered your questions for me :) I just have to add that I do not think supporting mobile devices is worth the trouble (I mean small screen devices - iPad would be a good target maybe, but it is not supported by Qt right now, AFAIK). I am going to make a tool that works good for me in first turn, and cross-platform operation if provided automatically by Qt, except some platform-specific hardware-related code (serial port).

    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
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-02-07 00:18
    Ooh this sounds great :)
  • bsnutbsnut Posts: 521
    edited 2011-02-07 01:07
    Cluso99 wrote: »
    Ooh this sounds great :)
    I am in agreement as well and keep up the great work you are doing.

    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.
  • Heater.Heater. Posts: 21,230
    edited 2011-02-07 01:19
    Andrey,

    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.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-02-07 01:41
    This sounds brilliant. I only heard about Qt yesterday, so I downloaded it and wrote a couple of short programs. First impression is that it is going to be easy to work with. The ability to set up a rich text box with auto coloring of keywords will be very handy.

    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?
  • Heater.Heater. Posts: 21,230
    edited 2011-02-07 01:54
    The way I have been evangelising for Qt recently people might suspect I work for Nokia. I do not, and have no connection to Qt apart from being a happy user.
    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.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-02-07 02:05
    It is a very nice find, heater.

    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...)
  • Heater.Heater. Posts: 21,230
    edited 2011-02-07 02:32
    Dr_A,

    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.
    So this could fairly quickly lead to an IDE that can program in Spin, Pasm, Basic and C.
    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:)
  • Heater.Heater. Posts: 21,230
    edited 2011-02-07 02:38
    Andrey,

    By the way, what is "PZST", is it a Russian acronym for "Propeller Integrated Development Environment" or some such?
  • Andrey DemenevAndrey Demenev Posts: 377
    edited 2011-02-07 05:11
    Ough, I did not expect this level of interest :)

    Trying to answer in order:
    bsnut wrote: »
    Are going to put the simulator option in your IDE?
    As I stated in first post, I have such idea, but it's not top priority
    Heater. wrote: »
    For serial ports there is a crossplatform support library for Qt: http://qextserialport.sourceforge.net/
    I am aware of it. Last time I checked, it did not support asynchronous read/write
    Dr_Acula wrote: »
    The ability to set up a rich text box with auto coloring of keywords will be very handy.
    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 :) ]
    Dr_Acula wrote: »
    Drop down autocomplete implies some sort of pre-processing looking for all the spin methods and that would be a very useful addition.
    I have that partially done - see the sreenshot - there is a dropdown to quickly jump to method definitions in current file
    Dr_Acula wrote: »
    Is your project going to be open source?
    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

    Dr_Acula wrote: »
    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.

    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 :)
    Heater. wrote: »
    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:)
    Well, that's not bad - I indeed think of it as source of great ideas I would never generate myself
    Heater. wrote: »
    By the way, what is "PZST", is it a Russian acronym for "Propeller Integrated Development Environment" or some such?

    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
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-02-07 05:42
    I am going to make a tool that works good for me in first turn, and cross-platform operation if

    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?
  • Heater.Heater. Posts: 21,230
    edited 2011-02-07 06:23
    Andrey,
    Ough, I did not expect this level of interest
    Oh we are interested, you have your work cut out now:)
    And I made SPIN syntax definition for vim, of course.
    For just that we, or at least I as the only vim user around here, owe you a huge debt of gratitude.

    Awesome effort.
  • Andrey DemenevAndrey Demenev Posts: 377
    edited 2011-02-07 06:46
    I have a large amount of discarded PC for such projects, what would be the minimum requirements for host hardware?

    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).
  • jazzedjazzed Posts: 11,803
    edited 2011-02-07 07:57
    You mentioned regex/search and replace.

    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
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-02-07 15:39
    Andrey, it looks like you are the expert on color highlighting.

    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
    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.

    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
    #include <
    
    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?!
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-02-07 19:28
    I'm a software quality and process guy. I like to see Testable Requirement (high level, user functional requirements, supported by testable design requirements, supported by testable implementation requirements), and peer reviews. [So planning is 90% of the work and coding is 10% of the work; instead of coding is 90% of the work and bug fixes are the other 90% or the work].

    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.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-02-07 19:36
    This is an extremely simple question for Qt users and I would appreciate some help.

    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
    #include <QtCore/QCoreApplication>
    #include <stdio.h>
    
    int main(int argc, char *argv[])
    {
        QCoreApplication a(argc, argv);
        printf("hello");
        return a.exec();
    }
    

    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.
  • Heater.Heater. Posts: 21,230
    edited 2011-02-07 23:34
    prof_braino,

    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:)
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-02-07 23:46
    @heater, as one of our resident Qt experts, how do I take that little console program in post #21 and turn it into a standalone .exe file?
  • Heater.Heater. Posts: 21,230
    edited 2011-02-08 00:13
    Dr_A,

    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.
    I've run "build" but I don't know where it ended up.
    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.
    however, when I run this it says "the application has failed to start because mingwm10.dll was not found"
    Yes because if you run the app from a command prompt it does not know where to find the libraries (.dll)
    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.
    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.
    So, is this .exe the entire program? Do you need to put .dlls in?
    It's the entire program of yours, but it needs those dlls to run.
    If so, how would that work on other operating systems? Has another .exe been created somewhere else that is self contained?
    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.
  • Heater.Heater. Posts: 21,230
    edited 2011-02-13 05:58
    A very sad time for Qt.

    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.
  • Andrey DemenevAndrey Demenev Posts: 377
    edited 2011-02-27 22:46
    Code is on Google code : http://code.google.com/p/pzst/
  • Andrey DemenevAndrey Demenev Posts: 377
    edited 2011-02-27 22:56
    I will be making windows installer and Debian package (and possibly Ubuntu)

    For Mac, I need help porting the serial port code - I do not have a mac
  • jazzedjazzed Posts: 11,803
    edited 2011-02-27 23:08
    Code is on Google code : http://code.google.com/p/pzst/
    Ok, where do I get QSCI ?
  • jazzedjazzed Posts: 11,803
    edited 2011-02-28 00:15
    eserialport_win.cpp:3: error: 'ESerialPort' has not been declared
    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.
  • Andrey DemenevAndrey Demenev Posts: 377
    edited 2011-02-28 00:35
    Ahh, at the last moment I have moved everything to PZST namespace, but forgotten to test the build under Windows. Fix:
    andrey@debian:~/working/pzst$ svn diff
    Index: eserialport_win.cpp
    ===================================================================
    --- eserialport_win.cpp	(revision 2)
    +++ eserialport_win.cpp	(working copy)
    @@ -1,5 +1,8 @@
     #include "eserialport.h"
     #include <QTime>
    +
    +using namespace PZST;
    +
     void ESerialPort::close()
     {
         if (fd != ESP_INVALID_HANDLE) {
    andrey@debian:~/working/pzst$ 
    

    Now the fix is commited to the repository
Sign In or Register to comment.