Shop OBEX P1 Docs P2 Docs Learn Events
Yet Another Linux IDE Request... kinda — Parallax Forums

Yet Another Linux IDE Request... kinda

James NewmanJames Newman Posts: 133
edited 2008-02-06 06:12 in Propeller 1
A few days ago I accidentally somehow nuked my windows instillation. Couldn't get it to boot no matter what, replaced the MBR, tried a repair from windows, checked all the files and everything. Anyway, as I've lost my disk, I decided to go ahead and pull my linux off of the smaller dieing drive and give it the big windows one. So that's done, Took a full day to pull all my data off the drive, then install/configure linux the way I like it, and finally place my data back. This isn't much of a problem, as I play all my games on the ps3 anymore, and I have all the software I use on linux anyway. With the exception of the Propeller IDE.

Now, I could write a simple asm compiler, since it's fully documented, and the prop-pc communication process is also... but how has the progress gone with documenting the Spin byte code? Is it to the point where someone can write their own spin compiler yet? I would go looking, but I don't have much time atm. For now I'm going to use my gfs laptop for finishing my current project.

Any and all information available is appreciated.

Comments

  • hippyhippy Posts: 1,981
    edited 2008-02-04 01:33
    The bytecode is understood well enough that it's possible to generate the required code for any particular Spin statement. There's one unknown opcode ($3F) and some unknowns with sub-opcodes of another ( wrt CogNew / CogInit of a Spin routine ). The 'method pointer table' is understood, at least well enough to generate it.

    The other side of the compilation is parsing through sub-objects to ripple constant definitions back up the object tree. Compilation is at least two pass, maybe more.

    I would say it's perfectly possible to build a third-party Spin compiler at this point in time.
  • Bill HenningBill Henning Posts: 6,445
    edited 2008-02-04 02:36
    The IDE apparently runs under Wine, some people I hear can even download through it - but if you can't, all is not lost, as you can save the eeprom image and use the python script that is floating around to program the Propeller!
    James Newman said...
    A few days ago I accidentally somehow nuked my windows instillation. Couldn't get it to boot no matter what, replaced the MBR, tried a repair from windows, checked all the files and everything. Anyway, as I've lost my disk, I decided to go ahead and pull my linux off of the smaller dieing drive and give it the big windows one. So that's done, Took a full day to pull all my data off the drive, then install/configure linux the way I like it, and finally place my data back. This isn't much of a problem, as I play all my games on the ps3 anymore, and I have all the software I use on linux anyway. With the exception of the Propeller IDE.

    Now, I could write a simple asm compiler, since it's fully documented, and the prop-pc communication process is also... but how has the progress gone with documenting the Spin byte code? Is it to the point where someone can write their own spin compiler yet? I would go looking, but I don't have much time atm. For now I'm going to use my gfs laptop for finishing my current project.

    Any and all information available is appreciated.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com - a new blog about microcontrollers
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-04 05:44
    I use the IDE on a mac using crossover but I can't get downloading programs to work since it is not picking up the serial port. Don't know about wine though. Running under crossover does have a couple of small problems though.

    Steven
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-04 05:48
    James, if you are going to write a compiler, why not write it in spin? Then we wouldn't need to worry about what computer we were using. If no one else does anything I might even (big maybe smile.gif ) start looking at it when I do some more work on DOL and my window manager.

    Steven
  • JT CookJT Cook Posts: 487
    edited 2008-02-04 06:59
    I don't think you can write a compiler in SPIN simply because you do not have the memory. Code that creates a full 32k binary image will be much larger than that uncompiled. The only work around would be using some kind of external memory module.
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-04 07:26
    Why not. You only have to generate the code for one object at a time which will cut down on the memory requirements a fair bit. Also you could just do it in several sequential passes writing the data to a file on an SD card while you are doing it. If you did something like
    1. Find first sub-object
    2. In sub-object replace all constants with the values
    3. Allocate space for variables
    4. Compile the methods one at a time to a file
    5. Make the method pointer table
    6. Step up and object and repeat until you get to the top object

    So yes you will need an SD card or something but I can't see that it will be a big problem. (except that I have never written a compiler before except for a very basic propeller assembler in spin smile.gif )

    Steven
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-02-04 07:39
    Without a broader suite of native string-handling functions, writing a compiler in Spin would be a bit awkward. For portability and a better match to the task, consider a scripting language like Perl or Python.

    -Phil
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-04 08:32
    Phil, what functions are you thinking about? Things like non-case sensitive compares?

    Steven
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-02-04 09:04
    That's a good example. Dictionary lookups, for which hashes are better suited, would be another. And, too, the regular expressions available in scripting languages can make light work of scanning for tokens, which would be harder in Spin.

    -Phil
  • hippyhippy Posts: 1,981
    edited 2008-02-04 13:12
    Spin lacks the data structures which a compiler commonly uses ( records, strings ), isn't suited to modular programming ( objects can't replace modules as there are no simple inter-object calls ). Unless a file system and editor is supported on-chip ( reducing available memory ) it would need to interact with a host to read and write file streams and PC-hosted 'RAM', which is a lot of additional work which isn't needed for a pure host-based compiler. Without getting into overlays, the compiler would be limited to 32KB of bytecode, 8KL of LMM code, less any constant and run-time data. On top of all that, Spin execution is incredibly slow in comparison to a PC host.

    It may be possible to have a Propeller-based compiler ( Chip seems to think so for the Prop II ) but I think that's a niche market ( standalone system on a student's desk ). It's an interesting idea but not, IMO, what anyone interested in anything but 'amateur programming' for the Propeller would consider satisfactory.

    I feel that Propeller-based development is just a distraction, side-stepping even, of what the fundamental issue is; getting existing tools working on non-Window OS's, or rewriting the compiler for those platforms.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2008-02-04 15:01
    From what I have been reading, Wine just keep getting better and better. I have a Xandro's Linux machine and have yet to figure out how to install it. But it would seem to be the least hassle of several choices.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PLEASE CONSIDER the following:

    Do you want a quickly operational black box solution or the knowledge included therein?······
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • hippyhippy Posts: 1,981
    edited 2008-02-04 15:51
    VMware, VirtualBox or similar is an alternative to Wine.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2008-02-04 16:20
    There appears to be a 'Microsoft blessed' version of Wine, called Crossover for $39.95. From Wikipedia, I see that the problems lies in that Windows uses DDLs to construct programs and they are protected. So, one can only go so far to mimic Windows without some cooperation from Microsoft. Additional DDL developed as addons for a particular application are not a problem.

    Since Crossover appears to have all the window and wordprocessing functionality, it seems like the Propeller IDE is likely to operate within it. Additionally, it has the DDLs for serial I/O [noparse][[/noparse]I assume that means USB as well as RS-232].

    And since it makes the installation easier, it seems worth the $39.95 rather than using the Debian version which is more complex to install and remains more questionable about funtionality.

    Has anyone tried it?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PLEASE CONSIDER the following:

    Do you want a quickly operational black box solution or the knowledge included therein?······
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • James NewmanJames Newman Posts: 133
    edited 2008-02-04 23:58
    Well, my biggest problem is that I've never played around with a grammar that used whitespace like Spin does. I've mostly played around with my own bytecode, stack based languages, and simple asm for them. I've written parts for a higher level language, but lost interest when I started using LUA. Sooo... it would be a project, and I'm completely up for it, but I'll look into it more later. I'm trying really hard to finish my current project this week, as it's been eating all of my free time for a while now.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-05 00:30
    As mentioned before, Crossover (from CodeWeavers) sort of works.· When you run the Propeller IDE, you get some system errors which are continuable.· After that, the IDE appears to work, you can compile programs and save them.· The downloading process does not appear to work, but you can use the Python downloader.· The Propeller Tool does not work under Wine ... you need the DLLs included with Crossover.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2008-02-05 06:23
    Mike,
    Is Crossover the best choice, or is that fact yet to be established?
    I understand the download problem is separate from the compile process.

    For Parallax, it would be wonderful to have one Linux solution that is deemed useible. Right now, I am trying to make sure the $39.95 is worthwhile. I already have OpenOffice for free, so I don't need to run MSWord, Excel, and so forth.

    Logistically, having a completely Linux compiled solution seems likely to always struggle to keep up with Parallax's Windows IDEs. Changes would take longer to migrate over. And of course, it might generate its own set of bugs and quirks that require even more support efforts.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PLEASE CONSIDER the following:

    Do you want a quickly operational black box solution or the knowledge included therein?······
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • LarryLarry Posts: 212
    edited 2008-02-05 06:37
    once you get past the issues Mike mentioned, everything seems to work except the special character maps.

    They are still clickable, but the formatting is so jumbled you can't tell what you are clicking on....
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-05 06:56
    Kramer, I suspect that when we get an open source spin compiler it will actually be the other way around with Parallax playing catchup with the open source version. This forum has many members that could contribute while Parallax has (I believe) only one or two people that work on the spin compiler part time.

    Steven
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2008-02-05 07:40
    Thanks Steven,
    A lot of this is IDE development is beyond me and I suspect that many begineers will always be in the mix.

    For me, it just seemed easier to consider the use of Wine or a similar alternative. VMWare is a $189 solution, VirtualBox seems to be asking for donations, and of course Crossover [noparse][[/noparse]a commercial version of Wine] is the $39.95 solution. Debian's Wine is available, but I'm not sure it is as good. Mike mentions that·Debian's lacks critical DLLs.

    Using that approach, I might get other IDEs working equally as well [noparse][[/noparse]Like the BasicStamp's and the SXKey]. I guess you could say I was looking for a lazyman's wholesale fix.

    Also, I am wondering if the downloading problems are specific to USB ports, RS-232 ports or simply both. My impression is that someone might have overlooked one or the other, but that we may be getting untrue reports that none work. Obviously, if the USB works, it may be the lack of installed driver software to support an RS-232 adapter.

    Like James, I am somewhat frustrated by Microsoft's voodoo. After high hopes for XP, things still occasionally stop working, automatic updates suddenly change the environment, and so on. So, I've gotten a Linux mini-laptop as a backup to manage web communications regardless of what my XP machine does. If a virus attacks one, it is more likely to miss the other. But, now I have to plan some of my work according to which workstation is available. Nonetheless, the issues of comparision have led to me learning more, so I'm happy with the challenges.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PLEASE CONSIDER the following:

    Do you want a quickly operational black box solution or the knowledge included therein?······
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 2/5/2008 7:47:38 AM GMT
  • dfletchdfletch Posts: 165
    edited 2008-02-05 21:34
    I'd be willing to help out a couple of hours a week if anyone has a project started.

    I can't escape the feeling though that the "right way" to do this is to make a Propeller backend for GCC and Spin and Propeller Assembler frontends. That might require a large memory model though, at least I think I remember reading something similar in older forum post.

    So I suppose maybe a nice simple place to start would just be a stand alone program that targets both languages, and then integrate the 3 layers (spin input, asm input, bytecode/machine code output) into GCC later if it seems feasible.

    Programming the prop should be a separate program. I am a believer in the old school Unix philosophy of "small tools that do their job extremely well and can be combined via command line scripting". Therefore, I believe a full-on IDE is not a great Linux solution. If you need that, maybe try Windows tongue.gif

    Cheers,

    --fletch
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-06 06:12
    We already have a python script the does downloads on macs and linux so the download side is taken care of. There is at least one assembler floating around, not that assemblers are all that hard any way. So the only thing that needs to be done is a spin compiler. I agree that just a command line tool would be best. There are more than enough code editors around already. Unfortunately I'm not the one to be heading up the project as I have no experience with writing compilers. I'd be happy to help where I could though.

    Steven
Sign In or Register to comment.