Shop OBEX P1 Docs P2 Docs Learn Events
Big Spin - is it still a pipedream? — Parallax Forums

Big Spin - is it still a pipedream?

Dr_AculaDr_Acula Posts: 5,484
edited 2011-02-27 11:34 in Propeller 1
With the C3 now supporting 64k of external ram, plus a number of other hardware designs that have external memory, I am wondering if we could brainstorm the idea of Big Spin, ie Spin that breaks out of the 32k memory size of the propeller chip.

I was inspired by this thread http://forums.parallax.com/showthread.php?127976-Spin-Simulator&highlight=spin+simulator

I'm also pulling in ideas from Zog, Catalina, the Zicog simulation and Bean's Basic.

The limitation, as always, is that we don't seem to have any open source code. But, that didn't stop those four projects listed above.

So why can't we write this ourselves?!

We already have "Big Pasm", in the form of LMM. It takes one cog and you can keep writing pasm code until the memory runs out.

So it seems to me that what we need is something to translate Spin into LMM, and I see two ways to do this. One is to translate to the bytecode that the Spin interpreter uses. I see most of this as possible but there are still bits missing, though the Spin Simulator might be able to plug those holes. Especially the bit about the flat 32 bit memory map.

The other option I see is Bean's Basic option where you compile to pure Pasm and don't run it through any simulator at runtime. This may well produce faster code and save a cog as well.

There have also been posts in the past about better IDE optios, eg auto indenting, autocompletion of all the methods available in an object once you type the . and other things. Maybe a new/improved IDE is an option.

But, the IDE may not be the highest priority.

So here is the idea. Take some existing spin code, typed into a text editor, or the Proptool or BST. Keep typing code, 500k or more. None of the above will be able to compile this, but they can at least save it and you will be working in a familiar environment.

Then run a simple batch file to compile this program to LMM pasm.

I've been thinking about how it might be possible to write a compiler using the collaborative input from many people, each of whom may have expertise in different languages, and I have come up with a concept that I'd like to run up the flagpole and see if anyone salutes.

The idea is to create a multipass compiler. I wrote a two pass compiler once, but it should be possible to do it with more passes and hence break the task up into smaller pieces. Each pass works on text files stored on the hard drive. The input is text file(s) and the output is text files(s). One pass could be written in C. The next in Java. The next in Basic. It does not matter as long as the program can read text files and write text files.

An example. The first pass might be to take the original Spin file, work out the names of the sub objects, and translate all instances of variables into a unique name that identifies that variable. For instance, in the main spin program there might be a variable "i", and in a sub object "serial" there might also be a variable "i". These are different variables, so you go through all the Spin code and replace "i" with "main.i" and in the sub object with "serial.i"

The next pass might simply combine all the sub objects and the main object into one big text file. Each pass is simply reading text files and then saving new text files.

The next pass might group all the CON parts together, and all the VAR parts, much as the Proptool compiler seems to do. Maybe this is not necessary?

The next pass could put all the CON values into a text file list and save as a separate text file.

The next pass could take all variables and create a list of those variables along with a token that goes with those variables, eg "myvariable" becomes "variable1" in a list. This list is now in a separate text file for use later on.

The next pass would do a global replace to put in "variable1" "variable2" in the code instead of the actual names. Or maybe just token numbers v1 v2 v3

Next pass would take all nested bracket code and expand it out to separate lines. Bracket code seems to have a hidden long that is passed from the inside to the outside - we could use "result" or something to move data to the next line.

The next pass might take all "myvariable:=1" and put in standardised spaces eg "myvariable := 1"

The next pass could search for text strings like "==" and ":=" and tokenise those.

The next pass could look for indents and convert (temporarily) into a format easier for a compiler to understand, eg nested "{" and "}" like in C.

And finally, we can start to do some compilation, eg variable1 := variable2 translated into LMM pasm.

We need a pass to search for loops, eg "repeat" and convert into conditional jumps.

And we need a pass to do some other complicated things like a cognew, which now would take the next 2k of data from external memory, move it to a fixed common location in hub memory and then execute pasm code to move it into the cog.


Now, the entire project is extremely daunting. But each of the above bits of code are not so hard. And they may well be a lot easier if anyone is free to program in their own language.

So I suppose the big question is whether there is enough demand for Spin programs that are more than 32k.

Thoughts, input, critique, offers of help, showstopper comments and even flames would be greatly appreciated.

Cheers, Drac
«13456710

Comments

  • Heater.Heater. Posts: 21,230
    edited 2011-01-21 06:00
    I don't think I would ever want to create large programs in Spin, not when we have C available. If I want Spin like objects I would use a limited subset of C++ features to do so.
    (Having said that the Prop II will have us writing somewhat bigger Spin apps)

    So, I'm seriously not up for this but:

    1) Your first decision might be whether yo want to compile to spin byte codes or LMM. Given that LMM requires 4 bytes to be fetch from memory for each op and byte codes only requires one it might be more efficient to use bytecodes when our memory interfaces are so slow and only byte wide. On the other hand LMM gets the work done faster so it might be a wash. As an example Catalinia uses LMM and Zog uses bytecodes, turns out that Zog is still slower in most cases although that is not helped by the nature of the byte codes and the fact that Zog keeps his stack/data in ext RAM rather than HUB.

    2) Where do you want to put your stack and data? Keeping it in HUB would of course be quicker.

    3) I'm sure you don't need so many passes to write such a compiler. Have a look how Jack Crenshaw builds a Pascal like compiler here http://compilers.iecc.com/crenshaw/ A fascinating read.
  • ericballericball Posts: 774
    edited 2011-01-21 06:23
    Although the SPIN language doesn't have any inherent memory space restrictions, both the Propeller Tool and the SPIN bytecode interpreter (and possibly the bytecode itself) have restrictions on the amount of RAM. So then the question is whether there's any advantage to SPIN versus other options (C, Zog, or even localroger's Windmill). The main advantage IMHO is the cognew function - the ability to start a SPIN or PASM running in parallel. (That and the code in the Obex). However, even with Big SPIN, the Propeller is still limited to 8 cogs and 32K of HUB RAM.
  • Heater.Heater. Posts: 21,230
    edited 2011-01-21 06:32
    ericball,
    ...the question is whether there's any advantage to SPIN versus other options...The main advantage IMHO is the cognew function

    No problem you can do COG new in C from Catalina and Zog and perhaps in other languages so I guess big Spin could do it as well.

    BUT: I will assume that only one COG will be running one LMM or bytecode interpreter for big Spin code in external memory, otherwise things get very slow.
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-01-21 08:03
    This thread raises three different ideas:

    1. Converting Spin bytecodes to LMM PASM
    2. Writing a Big Spin intepreter that can access more than 32k/64k of memory
    3. Writing a Spin compiler that can create programs greater than 32k in size

    The first idea is probably the easiest to implement. LMM PASM code could be written for each Spin bytecode and a simple program could be written that replaces each bytecode by a LMM PASM snippet. There is not much advantage to this since it would run slower and require more program space. The current interpreter does expend extra cycles to decode a bytecode, and many simple operators execute a lot of NOPs because they are combined with other simple operators. So this approach may break even in terms of execution time for certain operators.

    The second idea would need to address the 16-bit bottlenecks in the current Spin interpreters. These are related to the memory pointers pbase, vbase, dbase, pcurr and dcurr. These are the basic memory pointers that determines where a Spin program's variables and instructions are located. These five values are stored as longs in the interpreter, but they exist as words in the 16-byte binary program header and in the call frame. The call frame contains the values of pbase, vbase, dbase and the return address used by the calling method. This would need to be increased from 16-bit values to a larger size. We could continue to use the 16-byte binary program header and add an additional "relocation" variable at run time. This would allow us to run 8 64K programs in 512K of RAM, where each cog uses 64K. A memory manager could be used to allocate and access much more memory beyond the 512K size.

    The Spin interpreter would need to change it's memory access to accomodate external RAM. It currently contains 36 places where it uses a rdxxxx or wrxxxx instruction to access hub RAM. These 36 places would need to be modified so that they would call centralized routines, which would determine whether hub RAM or external RAM is being addressed. Of course, this would increase the size of the interpreter where it wouldn't fit in cog RAM anymore. A modified version of SpinLMM could be used to move a portion of the interpreter to hub RAM, which would provide more space in the hub RAM for the hub/external RAM access routines. This is certainly a doable task.

    There are two approaches to a Big Spin compiler. Either a open source compiler needs to be developed first, or we would need to convince the owners of one of the three closed source compilers to add this feature.
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-01-21 08:20
    Heater. wrote: »
    I will assume that only one COG will be running one LMM or bytecode interpreter for big Spin code in external memory, otherwise things get very slow.
    Yes, 8 cogs accessing external RAM could be quite slow. It might not be too bad with 2 cogs, where there accesses might tend to interleave with each other, but 8 cogs would be slow. A memory cache could be implemented for each cog, but that becomes complicated and needs additional cycles to support it. So the best approach may be to run Big Spin in one cog, and PASM or standard Spin in the other cogs.
  • jazzedjazzed Posts: 11,803
    edited 2011-01-21 09:34
    I've been working on this in the background the last few weeks to let programs be run from external memory. I've done this before for an EEPROM based code model, but that had some horrible limits. The current project does not suffer those limits because I drastically changed the interpreter.

    I've taken the spin interpreter and put the main bytecode logic into HUB and load to COG space on demand. The math operations remain in COG without need for overlays. I've changed key read/write methods to use a cache interface running in a separate COG. With these changes and the 64KB limits, i've been able to run simple programs such as pin toggling. All code, stack, and data live in external memory. This implementation runs about 1/3rd the speed of spin for pin toggling.

    As Dave mentions, the startup pointers are 16 bit and any program would have 64KB memory space until a BigSpin compiler is available. One of the other complications for getting more than 64KB is the object call lookup. Of course there has to be a way to address HUB memory from BigSpin code which will also require a compiler assist. As mentioned more than one interpreter accessing external memory is a problem.

    Given all that, I propose:
    • Only one BigSpin interpreter VM be runnable at a time
    • The BigSpin compiler should put code start at $10000 to differentiate code/data from HUB access,
      change startup variables to be longs, and change method and object entries to be longs.
    One possible consideration for a faster "not so big spin" is to use HUB for stack and variable storage. The compiler would have to be changed even more for this option, but it would allow executing from EEPROM or other non-volatile storage without severe language limits. Of course "not so big spin" program size would be limited by HUB memory because of stack/data and would allow fewer memory buffers for video, etc....

    By contrast to "not so big spin", the BigSpin version would not keep stack/variables in HUB and allow using up to 2GB of external memory which I guess is more like HugeSpin.
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-01-21 13:54
    I had forgotten about the 16-bit entries in the method table. The 16-bt entries for methods within an object aren't too restrictive. They allow for objects to be as large as 64K each, with up to 64K of stack variables. The bigger problem is with external object references. These entries contain the relative pbase and vbase entries for the referenced objects. These would need to be larger than 16 bits.

    The current compilers could be used to generate binaries for individual objects that fit within 32K. Each object would be compiled and linked with stubs generated from the objects that they reference. The stubs would contain small routines that would perform long jumps to the correct point in another object. It's similar to the technique I use with method pointers, except that the pointers would contain 32-bit values. The stub routines would just add 32-bit offsets to the pbase and vbase to get to the right place in the real object's code space.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-01-21 16:41
    Some great ideas here.

    I imagine Dave has solved some of this with the simulator.

    I like Jazzed's idea of starting code at $10000.

    The comments about 16 bit bottlenecks in the spin interpreter raises some issues I was not aware of. So... if there are problems with the existing spin interpreter, is it indeed going to be easier to compile to LMM opcodes?

    Here is an idea. You have Big Spin running entirely in external memory, with its own stack in external memory. Yes, that is a bit slower. But... the upside is you can then be also running totally standard spin from hub memory, with multiple standard spin interpreters, thus preserving the advantage of parallel processing and also preserving all the existing obex code that runs spin in multiple cogs. Another advantage could be that the cogs could all be loaded from the Big Spin code, thus saving up to 14k of hub ram that would be used for cog code. You would need a small bootloader that would first load Big Spin to external memory and start its cog. Then that bootloader would chain a standard binary into hub ram.

    So for speed, in parallel you can have slow but big spin, medium and standard spin and fast cog code. Then the speed limitation of serial ram does not matter so much.

    I like the idea of code fragments. I'd also like to build those code fragments right from the start as 32 bits for everything, even if it means it takes a little more code space. With external memory, code space is no longer so precious. So calls to PUBs right at the end of the program exist in a flat 32 bit memory space.

    Re jazzed's comments on the eeprom, I'd take it as a given that there is an sd card.

    I need to check out the spin simulator. I just had a crazy idea about writing this big spin compiler in the spin simulator using spin.

    heater
    I don't think I would ever want to create large programs in Spin, not when we have C available.

    The problem I see is that while C exists, it can't use the vast majority of Obex code that is written in Spin. I've been working on porting a couple of VGA objects into C and it is not easy. I got one working, but the other one is very complex. It involves multiple shells into homespun then recombining the code back in as hex array data, and also copying C constants and translating them into CON data within each Obex code so that both languages can use common hub locations. RossH has ported a few and integrated them into the C language, but invariably one seems to need Obex code that hasn't been done yet. I think I could port maybe one Obex a month, but the whole Obex is daunting, and it is not easy to automate either.

    The link to the pascal compiler is very interesting.

    Probably not as many passes are needed through the multipass compiler - this was just an idea that might mean more people could contribute.

    I'm thinking of something similar to Bean's compiler - mainly because attempts in the past to shoehorn big spin into the existing interpreter seem to have stalled in the past. But maybe the 16 bit problem is solvable in other ways?
  • RossHRossH Posts: 5,353
    edited 2011-01-21 17:39
    Hi Dr_Acula,

    I don't want to put you off - "Big Spin" is an excellent idea - but why waste your own time re-inventing the wheel? Parallax must already be a long way down the track to developing their own version of Big Spin, since they will need it for the Prop II - otherwise, how are they going to make effective use of the 128kb of Hub RAM on that chip?

    Parallax cop enough flack as it is for expecting their customers to use Spin - they'd cop a whole lot more for releasing a new flagship chip without a language that could make effective use of of its entire memory space. So if its true that the Prop II is going to be released sometime this year, then Big Spin must already exist - at least in prototype.

    Also, the last thing we want is a plethora of different and incompatible variations of Spin floating around - I think this is a positive benefit from Spin not being "open source". Even though we have other Spin compilers, Parallax still rules the roost - and this is a significant reason why the Spin OBEX succeeds where a C OBEX might not - no-one would write a Spin object intended for re-use that only works with one particular non-Parallax Spin (or C) compiler!

    If I were you I'd wait till we see more details about what changes Parallax intend making to the existing Spin language to support the Prop II (I seem to recall a thread discussing this very thing a few months ago). When you know what the new language looks like, then "back port" a version to the Prop I. I very much doubt Parallax will be interested in doing this since every Prop I platform with XMM RAM - and you will need XMM RAM to run it at all! - is completely different.


    On the (unrelated) subject of re-usable C components, I think you may want to rethink your approach before trying to reproduce the entire OBEX in C! While Spin users are likely to make heavy use of OBEX code, I'm not sure the same is true of C users. In my experience, C users make much less use of re-usable component libraries, and are much more to creating their own. Not necessarily just because they want to - but because they usually have to.


    In the meantime, I'm with Heater - use C for large projects, and Spin for small ones. After reading or writing more than a couple of pages of Spin at a time, I begin to understand why Parallax called it that!

    Ross.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-01-21 17:57
    Just my opinion...

    The problem we are all trying to resolve is one that really requires one big program and up to 7 normal little programs for our 8 processor prop. I see that solution as C (or any other language) running mainly from the extended memory (sram/eeprom/etc). We already have some of those solutions but they need a better interface to the other spin & pasm programs.

    So, what I see is some way to segregate the 7 spin/pasm processes from the main process, written in C or whatever. That is why I chose a second prop, but there are of course other ways. I believe a standard interface is required between the main process and the other standard processes, with the ability to import/export the interface so that the main process can be compiled completely separate from the other 'standard' processes.
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-01-21 20:30
    I thought a little bit more about the idea of converting Spin bytecodes to LMM PASM. It may not be as slow as I first thought. I ran the hello.spin program under SpinSim using the C Spin interpreter and and the PASM Spin interpreter. I wrote a small program to merge the PASM and Spin bytecode listings, and have attached it below.

    The PASM Spin interpreter executes a heck of a lot of instructions to decode a Spin bytecode and execute it. The Spin instruction ldli0 (Load Long Immediate Zero) required 25 PASM instructions to load a 0 onto the stack. This operation could be done in as little as 4 PASM instructions, which is a factor of one-sixth. It may be that Spin bytecodes converted to PASM LMM would run at about the same speed as interpreted Spin.
  • jazzedjazzed Posts: 11,803
    edited 2011-01-21 22:16
    Nice listing Dave. Care to explain each of the columns? Some are obvious, others are not.
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-22 02:37
    RossH wrote: »
    Hi Dr_Acula, I don't want to put you off - "Big Spin" is an excellent idea - but why waste your own time re-inventing the wheel? Parallax must already be a long way down the track to developing their own version of Big Spin, since they will need it for the Prop II - otherwise, how are they going to make effective use of the 128kb of Hub RAM on that chip? Ross.
    The idea is to have Big Spin on the Propeller 1, even if there's a Big Spin coming out on the Propeller 2. Therefore, from my perspective in using primarily the Propeller 1, it would not be a waste of time to develop it. If you are saying that Parallax already has Big Spin working and they can release a version for the Propeller 1, then that's a different story.
  • RossHRossH Posts: 5,353
    edited 2011-01-22 03:18
    Humanoido wrote: »
    The idea is to have Big Spin on the Propeller 1, even if there's a Big Spin coming out on the Propeller 2. Therefore, from my perspective in using primarily the Propeller 1, it would not be a waste of time to develop it. If you are saying that Parallax already has Big Spin working and they can release a version for the Propeller 1, then that's a different story.

    Hi Humanoido,

    My point is that Parallax has to develop Big Spin for the Prop II anyway - so we may as well wait till they release some specifics about the language changes. I'd be willing to bet they have already made a start on it.

    To develop an incompatible version of "Big Spin" for the Prop I could end up being (at best) a waste of time, or (at worst) quite counterproductive.

    Mind you, plenty of us do sillier things! :smile:

    Ross.
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-01-22 07:07
    jazzed wrote: »
    Nice listing Dave. Care to explain each of the columns? Some are obvious, others are not.
    The columns are as follows:
               Stack Last Val.  
    Type Cog #  Addr on Stack  PCURR Spin Bytecodes  Spin Bytecode Mnemonic
    ---- -----  ---- --------   ---- --------------  ----------------------
    SPIN Cog 0: 01cc 00000000 - 001c 01              ldfrm
    
    
    
    Type Cog #   PC  Instruction             PASM OP Dst   Src Write flags
    ---- -----   --- -----------             ------- ---   --- -----------
    PASM Cog 0:  009 00bc0bee                rdbyte  005,  1ee
    
    The attached file lists the Spin bytecode mnemonics with some descriptions. I need to work more on this document. The memory mnemonics have the following format:

    {ld, st, la, ex}{l, m, w, b}{l, v, o, a, i}{c, x, 0, 1, m1}

    Each field has the following meanings:

    {ld, st, la, ex} - Load, Store, Load Address, Execute
    {l, m, w, b} - Long, Medium, Word, Byte (Medium is 3 bytes)
    {l, v, o, a, i} - Local offset, Var offset, Object offset, Absolute address, Immediate
    {c, x, 0, 1, m1} - Compact, Indexed, zero, one, minus one

    The third variable on a the stack would be loaded with "ldllc 12" or "ldll 12" The ldllc generates a one-byte code and the ldll generates two bytes. An indexed byte in the DAT area would be stored with "stbox $111".

    Dave
  • jazzedjazzed Posts: 11,803
    edited 2011-01-22 07:49
    RossH wrote: »
    To develop an incompatible version of "Big Spin" for the Prop I could end up being (at best) a waste of time, or (at worst) quite counterproductive.
    While I agree that PropII will require a bigger spin, support for external memory may not be an objective as it is probably not doable in a COG without overlays or some LMM (single line overlay). The more we figure out today, the easier it will be to port tomorrow.

    I'm not sure why BigSpin would have to be incompatible with Spin. The entire Spin language specification can be supported with one exception. The only exception/real complexity at this time is multi-cog BigSpin which is solvable but impractical. As DR_A seems to suggest, one BigSpin that could start normal multiple Spin COG threads would be a requirement. BigSpin will obviously be able to start PASM otherwise it is useless.

    BigSpin is interesting because Propeller people program in Spin - just check heater's poll if you want proof - everyone should participate in that poll to possibly prove otherwise.

    @Dave thanks for your explanation. Some of the fields were confusing.
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-01-22 09:23
    I hand coded the first five Spin bytecode instructions in the hello.txt listing, and the results are shown below to the right of the interpreter's PASM code.. The interpreter executes 159 PASM instructions for these five Spin bytecodes. There are 19 rxxxxx/wrxxxx instructions, which results in a total of 178 instructions cycle times (178*4 system cycle times) if we ignore hub waits. My hand-coded PASM contains 29 instructions.

    SpinLMM uses 8 instructions times to execute an LMM instruction, so this would take 232 instruction cycles to execute, which is a bit slower than the interpreter. The hand-coded PASM requires 116 bytes versus the original Spin bytecodes, which is only 10 bytes. So it seems like there isn't much advantage to converting Spin bytecodes to LMM PASM. The only practical use would be to access external RAM.

    However, this might be useful for Small Spin, which would execute entirely within a Cog. Small Spin would still use the stack, and it could perform recursive method calls. It would also have access to VAR and DAT variables. The only restriction is that the program would have to fit entirely within a cog.

    Small Spin could be optimized a bit by not using the stack unless it is absolutely necessary. The Spin statement x := y + z pushes y onto the stack, then pushes z onto the stack, executes an add instruction that pushes the result onto the stack, and then pops the result off the stack and stores it into x. This could be optimized to the point where temporary registers are used instead of the stack.

    It may be possible to do further optimization where some Spin variables could be kept in registers as well. This would reduce the use of the stack even more. The nice thing about this is that PASM driver code could be written in Spin instead of PASM. There could be a Tiny Spin mode that doesn't use the stack at all. This wouldn't allow for recursive method calls, but it would be much faster.

    Dave
    SPIN Cog 0: 01cc 00000000 - 001c 01              ldfrm
    PASM Cog 0:  009 00bc0bee                rdbyte  005,  1ee         mov     X, PBASE
    PASM Cog 0:  00a 80ffdc01                add     1ee, #001         or      X, #1
    PASM Cog 0:  00b 857c0a40                cmp     005, #040 wc      wrword  DCURR, x
    PASM Cog 0:  00c 5c4c00ee X if_nc        jmp     000, #0ee         add     DCURR, #2
    PASM Cog 0:  00d a0bc0605                mov     003,  005         wrword  DCURR, VBASE
    PASM Cog 0:  00e 20fc0604                ror     003, #004         add     DCURR, #2
    PASM Cog 0:  00f 80fc061a                add     003, #01a         wrword  DCURR, DBASE
    PASM Cog 0:  010 50bc2603                movs    013,  003         add     DCURR, #2
    PASM Cog 0:  011 24fc0602                rol     003, #002         wrword  DCURR, DCALL
    PASM Cog 0:  012 2cfc0603                shl     003, #003         add     DCURR, #2
    PASM Cog 0:  013 a0bc081a                mov     004,  01a         mov     DCALL, DCURR
    PASM Cog 0:  014 28bc0803                shr     004,  003         mov     X, #0
    PASM Cog 0:  015 60fc08ff                and     004, #0ff         wrlong  DCURR, X
    PASM Cog 0:  016 50bc3204                movs    019,  004         add     DCURR, #4
    PASM Cog 0:  017 627c0a01                test    005, #001 wz
    PASM Cog 0:  018 617c0a02                test    005, #002 wc
    PASM Cog 0:  019 5c7c001e                jmp     000, #01e
    PASM Cog 0:  01e 68bc0beb                or      005,  1eb
    PASM Cog 0:  01f 043c0bef                wrword  005,  1ef
    PASM Cog 0:  020 80ffde02                add     1ef, #002
    PASM Cog 0:  021 043fd9ef                wrword  1ec,  1ef
    PASM Cog 0:  022 80ffde02                add     1ef, #002
    PASM Cog 0:  023 043fdbef                wrword  1ed,  1ef
    PASM Cog 0:  024 80ffde02                add     1ef, #002
    PASM Cog 0:  025 043fd5ef                wrword  1ea,  1ef
    PASM Cog 0:  026 a0bfd5ef                mov     1ea,  1ef
    PASM Cog 0:  027 80ffde02                add     1ef, #002
    PASM Cog 0:  028 5c7c0158                jmp     000, #158
    PASM Cog 0:  158 083c01ef                wrlong  000,  1ef
    PASM Cog 0:  159 80ffde04                add     1ef, #004
    PASM Cog 0:  15a 617c0c40                test    006, #040 wc
    PASM Cog 0:  15b 5c7c0008                jmp     000, #008
    PASM Cog 0:  008 a0fc0000                mov     000, #000
    
    SPIN Cog 0: 01d8 00000000 - 001d 37 24           ldlip $1f
    PASM Cog 0:  009 00bc0bee                rdbyte  005,  1ee        mov     X, #$1f
    PASM Cog 0:  00a 80ffdc01                add     1ee, #001        wrlong  DCURR, X
    PASM Cog 0:  00b 857c0a40                cmp     005, #040 wc     add     DCURR, #4
    PASM Cog 0:  00c 5c4c00ee X if_nc        jmp     000, #0ee
    PASM Cog 0:  00d a0bc0605                mov     003,  005
    PASM Cog 0:  00e 20fc0604                ror     003, #004
    PASM Cog 0:  00f 80fc061a                add     003, #01a
    PASM Cog 0:  010 50bc2603                movs    013,  003
    PASM Cog 0:  011 24fc0602                rol     003, #002
    PASM Cog 0:  012 2cfc0603                shl     003, #003
    PASM Cog 0:  013 a0bc081d                mov     004,  01d
    PASM Cog 0:  014 28bc0803                shr     004,  003
    PASM Cog 0:  015 60fc08ff                and     004, #0ff
    PASM Cog 0:  016 50bc3204                movs    019,  004
    PASM Cog 0:  017 627c0a01                test    005, #001 wz
    PASM Cog 0:  018 617c0a02                test    005, #002 wc
    PASM Cog 0:  019 5c7c00c4                jmp     000, #0c4
    PASM Cog 0:  0c4 a0bc0005                mov     000,  005
    PASM Cog 0:  0c5 84fc0035                sub     000, #035
    PASM Cog 0:  0c6 5c6c0158 X if_z_or_nc   jmp     000, #158
    PASM Cog 0:  0c7 00bc03ee                rdbyte  001,  1ee
    PASM Cog 0:  0c8 80ffdc01                add     1ee, #001
    PASM Cog 0:  0c9 24bc0001                rol     000,  001
    PASM Cog 0:  0ca 617c0220                test    001, #020 wc
    PASM Cog 0:  0cb 84f00001   if_c         sub     000, #001
    PASM Cog 0:  0cc 617c0240                test    001, #040 wc
    PASM Cog 0:  0cd 6cb001e5 X if_c         xor     000,  1e5
    PASM Cog 0:  0ce 5c7c0158                jmp     000, #158
    PASM Cog 0:  158 083c01ef                wrlong  000,  1ef
    PASM Cog 0:  159 80ffde04                add     1ef, #004
    PASM Cog 0:  15a 617c0c40                test    006, #040 wc
    PASM Cog 0:  15b 5c7c0008                jmp     000, #008
    PASM Cog 0:  008 a0fc0000                mov     000, #000
    
    SPIN Cog 0: 01dc 0000001f - 001f 38 1e           ldbi 30
    PASM Cog 0:  009 00bc0bee                rdbyte  005,  1ee         mov     X, #30
    PASM Cog 0:  00a 80ffdc01                add     1ee, #001         wrlong  DCURR, X
    PASM Cog 0:  00b 857c0a40                cmp     005, #040 wc      add     DCURR, #4
    PASM Cog 0:  00c 5c4c00ee X if_nc        jmp     000, #0ee
    PASM Cog 0:  00d a0bc0605                mov     003,  005
    PASM Cog 0:  00e 20fc0604                ror     003, #004
    PASM Cog 0:  00f 80fc061a                add     003, #01a
    PASM Cog 0:  010 50bc2603                movs    013,  003
    PASM Cog 0:  011 24fc0602                rol     003, #002
    PASM Cog 0:  012 2cfc0603                shl     003, #003
    PASM Cog 0:  013 a0bc081d                mov     004,  01d
    PASM Cog 0:  014 28bc0803                shr     004,  003
    PASM Cog 0:  015 60fc08ff                and     004, #0ff
    PASM Cog 0:  016 50bc3204                movs    019,  004
    PASM Cog 0:  017 627c0a01                test    005, #001 wz
    PASM Cog 0:  018 617c0a02                test    005, #002 wc
    PASM Cog 0:  019 5c7c00cf                jmp     000, #0cf
    PASM Cog 0:  0cf 84fc0a37                sub     005, #037
    PASM Cog 0:  0d0 00bc05ee                rdbyte  002,  1ee
    PASM Cog 0:  0d1 80ffdc01                add     1ee, #001
    PASM Cog 0:  0d2 2cfc0008                shl     000, #008
    PASM Cog 0:  0d3 68bc0002                or      000,  002
    PASM Cog 0:  0d4 e4fc0ad0                djnz    005, #0d0
    PASM Cog 0:  0d5 5c7c0158                jmp     000, #158
    PASM Cog 0:  158 083c01ef                wrlong  000,  1ef
    PASM Cog 0:  159 80ffde04                add     1ef, #004
    PASM Cog 0:  15a 617c0c40                test    006, #040 wc
    PASM Cog 0:  15b 5c7c0008                jmp     000, #008
    PASM Cog 0:  008 a0fc0000                mov     000, #000
    
    SPIN Cog 0: 01e0 0000001e - 0021 35              ldli0
    PASM Cog 0:  009 00bc0bee                rdbyte  005,  1ee         mov     X, 0
    PASM Cog 0:  00a 80ffdc01                add     1ee, #001         wrlong  DCURR, X
    PASM Cog 0:  00b 857c0a40                cmp     005, #040 wc      add     DCURR, $4
    PASM Cog 0:  00c 5c4c00ee X if_nc        jmp     000, #0ee
    PASM Cog 0:  00d a0bc0605                mov     003,  005
    PASM Cog 0:  00e 20fc0604                ror     003, #004
    PASM Cog 0:  00f 80fc061a                add     003, #01a
    PASM Cog 0:  010 50bc2603                movs    013,  003
    PASM Cog 0:  011 24fc0602                rol     003, #002
    PASM Cog 0:  012 2cfc0603                shl     003, #003
    PASM Cog 0:  013 a0bc081d                mov     004,  01d
    PASM Cog 0:  014 28bc0803                shr     004,  003
    PASM Cog 0:  015 60fc08ff                and     004, #0ff
    PASM Cog 0:  016 50bc3204                movs    019,  004
    PASM Cog 0:  017 627c0a01                test    005, #001 wz
    PASM Cog 0:  018 617c0a02                test    005, #002 wc
    PASM Cog 0:  019 5c7c00c4                jmp     000, #0c4
    PASM Cog 0:  0c4 a0bc0005                mov     000,  005
    PASM Cog 0:  0c5 84fc0035                sub     000, #035
    PASM Cog 0:  0c6 5c6c0158   if_z_or_nc   jmp     000, #158
    PASM Cog 0:  158 083c01ef                wrlong  000,  1ef
    PASM Cog 0:  159 80ffde04                add     1ef, #004
    PASM Cog 0:  15a 617c0c40                test    006, #040 wc
    PASM Cog 0:  15b 5c7c0008                jmp     000, #008
    PASM Cog 0:  008 a0fc0000                mov     000, #000
    
    SPIN Cog 0: 01e4 00000000 - 0022 3a 01 c2 00     ldmi 115200       mov    x, #$01
    PASM Cog 0:  009 00bc0bee                rdbyte  005,  1ee         shl    x, #8
    PASM Cog 0:  00a 80ffdc01                add     1ee, #001         or     x, $c2
    PASM Cog 0:  00b 857c0a40                cmp     005, #040 wc      shl    x, #8
    PASM Cog 0:  00c 5c4c00ee X if_nc        jmp     000, #0ee         wrlong DCURR, x
    PASM Cog 0:  00d a0bc0605                mov     003,  005         add    DCURR, #4
    PASM Cog 0:  00e 20fc0604                ror     003, #004
    PASM Cog 0:  00f 80fc061a                add     003, #01a
    PASM Cog 0:  010 50bc2603                movs    013,  003
    PASM Cog 0:  011 24fc0602                rol     003, #002
    PASM Cog 0:  012 2cfc0603                shl     003, #003
    PASM Cog 0:  013 a0bc081d                mov     004,  01d
    PASM Cog 0:  014 28bc0803                shr     004,  003
    PASM Cog 0:  015 60fc08ff                and     004, #0ff
    PASM Cog 0:  016 50bc3204                movs    019,  004
    PASM Cog 0:  017 627c0a01                test    005, #001 wz
    PASM Cog 0:  018 617c0a02                test    005, #002 wc
    PASM Cog 0:  019 5c7c00cf                jmp     000, #0cf
    PASM Cog 0:  0cf 84fc0a37                sub     005, #037
    PASM Cog 0:  0d0 00bc05ee                rdbyte  002,  1ee
    PASM Cog 0:  0d1 80ffdc01                add     1ee, #001
    PASM Cog 0:  0d2 2cfc0008                shl     000, #008
    PASM Cog 0:  0d3 68bc0002                or      000,  002
    PASM Cog 0:  0d4 e4fc0ad0                djnz    005, #0d0
    PASM Cog 0:  0d0 00bc05ee                rdbyte  002,  1ee
    PASM Cog 0:  0d1 80ffdc01                add     1ee, #001
    PASM Cog 0:  0d2 2cfc0008                shl     000, #008
    PASM Cog 0:  0d3 68bc0002                or      000,  002
    PASM Cog 0:  0d4 e4fc0ad0                djnz    005, #0d0
    PASM Cog 0:  0d0 00bc05ee                rdbyte  002,  1ee
    PASM Cog 0:  0d1 80ffdc01                add     1ee, #001
    PASM Cog 0:  0d2 2cfc0008                shl     000, #008
    PASM Cog 0:  0d3 68bc0002                or      000,  002
    PASM Cog 0:  0d4 e4fc0ad0                djnz    005, #0d0
    PASM Cog 0:  0d5 5c7c0158                jmp     000, #158
    PASM Cog 0:  158 083c01ef                wrlong  000,  1ef
    PASM Cog 0:  159 80ffde04                add     1ef, #004
    PASM Cog 0:  15a 617c0c40                test    006, #040 wc
    PASM Cog 0:  15b 5c7c0008                jmp     000, #008
    PASM Cog 0:  008 a0fc0000                mov     000, #000
    
    
  • jazzedjazzed Posts: 11,803
    edited 2011-01-22 11:03
    Dave Hein wrote: »
    So it seems like there isn't much advantage to converting Spin bytecodes to LMM PASM. The only practical use would be to access external RAM.
    I'm getting external memory BigSpin performance about 1/3rd of normal spin for a simple interpreted thread of code. If SpinLMM can do better, it would be worth the effort.

    SPIN LMM might be worth pursuing anyway as an alternative because the original SPIN spaghetti VM bytecode handlers do not execute all code since up to 4 functions are packed into one "jN" routine. The reason this is valuable is the overlay load time for BigSpin as I have it now may be longer than given LMM handlers would execute. Too bad Cluso99 is not interested in this topic.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-01-22 15:53
    I don't see speed as an issue for the majority of programs. If Big Spin is too slow then do one or more of:

    1) Start another cog and run normal spin in parallel
    2) Change from serial to parallel memory (8x speed increase?)
    3) Use PASM
    4) Use inline PASM within Big Spin
    5) Open up a cog, load it with some PASM and then shut it down again

    Option 4 ought to be an integral part of LMM Big Spin anyway
    Option 5 opens up some new ways of programming. Because memory is no longer so precious you don't have to worry about using up 2k of memory space for every cog that is loaded.

    As for waiting for the Prop 2, I'll probably get in trouble for saying this, but the Prop 2 has been "just around the corner" for as long as I have been on the forums. It isn't here now so we can't use it. And the world of microcontrollers changes rapidly. I just paid $115 including shipping for an Apad which runs Android and looks like an ipad. Then I paid another $39 for a licence for http://www.basic4ppc.com/index.html screenshot: http://www.basic4ppc.com/android/screenshots.html and now it is possible to program the device in VB.net. Other languages are possible too. Gorgeous display, touchscreen, wifi, USB, Cat5 network, speaker, microphone, heaps of code space.

    The catch though is the Apad runs rather warm whereas a Propeller runs almost cold, and that is most relevant for battery powered applications. And a Dracblade plus 20x4 LCD plus freebie CRT VGA screen plus $3 keyboard is still cheaper than an Apad. So I'm keen to see what we can push the Prop to do with larger programs.

    @Dave, can I just check - you have a simulator running in a flat memory space, right? Presumably each line of the simulation has to do some sort of translation to get the simulation to work. For example, taking that wonderful Pascal compiler tutorial listed earlier, to decode a := b*c / (d - e) you need to know BODMAS and you need to push things on and off a stack in the right way. If a simulator is doing this that is 3/4 of a compiler, so the next step is to translate this into something the propeller understands. This would be 1) spin interpreter bytecodes or 2) PASM for LMM. Which of these do you think will b easier.
  • jazzedjazzed Posts: 11,803
    edited 2011-01-22 16:29
    Dr_Acula wrote: »
    I don't see speed as an issue for the majority of programs.
    Obviously you misunderstood the context ... again.

    The fastest relative implementation for a given set of constraints should be used.

    Any luck looking at that Spin compiler?
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-01-22 17:21
    The fastest relative implementation for a given set of constraints should be used.

    I agree. Presumbably that is going to be code that is compiled to pasm rather than interpreted? And using parallel rather than serial ram?

    Ok, let's push it to the extreme. Compiled and optimised code, running in LMM pasm with external sram. With latched ram, you can optimise it even further if you do things in blocks of 256 bytes so only one latch is changing most of the time. Or use Cluso99's idea of joining propeller pins to sram pins with no latches. That will be almost as fast as real spin.
    SPIN LMM might be worth pursuing anyway as an alternative because the original SPIN spaghetti VM bytecode handlers do not execute all code since up to 4 functions are packed into one "jN" routine. The reason this is valuable is the overlay load time for BigSpin as I have it now may be longer than given LMM handlers would execute.

    Sounds like a reason why LMM is better?

    I'm more inclined towards LMM Spin at the moment, but on the other hand, if most of the work has been done with interpreted spin, that might speed things up. On the other other hand, several discussion threads in the past have faded away when the complexities of interpreted big spin are looked at in more detail.
    Any luck looking at that Spin compiler?

    Which one do you mean? I'm deep inside the Pascal compiler at the moment. Maybe the answer is going to be to build this from scratch, like Bean's Basic?
  • RossHRossH Posts: 5,353
    edited 2011-01-22 17:32
    jazzed wrote: »
    I'm not sure why BigSpin would have to be incompatible with Spin. The entire Spin language specification can be supported with one exception. The only exception/real complexity at this time is multi-cog BigSpin which is solvable but impractical. As DR_A seems to suggest, one BigSpin that could start normal multiple Spin COG threads would be a requirement. BigSpin will obviously be able to start PASM otherwise it is useless.
    Big Spin has to be a simple as existing Spin or else it won't get used much. Once people start having to think about "special" cogs, and "special" code that can only run on particular cogs, or programs which can be compiled only for one platform, or using only one compiler, then the whole exercise is doomed.

    That's why I suggested waiting to see how Parallax plans to extend Spin for the Prop II - the main benefit of Big Spin would be if it makes Spin programs that would normally only be executable on the Prop II (because it its larger memory) also able to be executed on the Prop I (albeit more slowly).
    jazzed wrote: »
    BigSpin is interesting because Propeller people program in Spin - just check heater's poll if you want proof - everyone should participate in that poll to possibly prove otherwise.
    Of course people program in Spin - its the language (the only language) officially sanctioned by Parallax!

    My own opinion is that the Spin language doesn't scale well, and is quite unsuitable for the size of applications that will be possible on the Prop II (or the Prop I with Big Spin).

    But if nothing else, Big Spin would give us a terrific opportunity to find out once and for all!
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-01-22 17:45
    Dr_Acula wrote: »
    @Dave, can I just check - you have a simulator running in a flat memory space, right? Presumably each line of the simulation has to do some sort of translation to get the simulation to work. For example, taking that wonderful Pascal compiler tutorial listed earlier, to decode a := b*c / (d - e) you need to know BODMAS and you need to push things on and off a stack in the right way. If a simulator is doing this that is 3/4 of a compiler, so the next step is to translate this into something the propeller understands. This would be 1) spin interpreter bytecodes or 2) PASM for LMM. Which of these do you think will b easier.
    The Spin interpreter is a stack-based VM. It is implemented in PASM on the Prop. SpinSim is a C implementation of the Spin VM. SpinSim does the same operations as the PASM interpreter, and it works with the stack in the same way. This does make the job easier for the compiler. The compiler doesn't have to worry about which register contains the right parameters for an operation. It just pushes the parameters onto the stack and the operator pulls them off.

    I think it is slightly easier to write a Spin compiler that generates Spin bytecodes. However, it would probably be about the same effort to generate LMM PASM codes. I played around with this idea about a year ago, but I didn't get very far with it. I spent a couple of hours today modifying a copy of the SpinSim VM to generate PASM code. I'm hoping to spend another couple of hours on it and try converting a small Spin program into PASM. I'll post some results once I get it working.

    Dave
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-01-22 17:53
    Big Spin has to be a simple as existing Spin or else it won't get used much.

    I agree. The motivation for this is the ability to drop in any Obex code into a program. Indeed, if you had a big enough memory chip (eg jazzed's chip), you could put the entire obex in the memory chip, one after the other. The only coding difference would be that you can't have more than 8 cogs running. But all the obex code I have looked at all has a cogstop method, so if you want to free up a cog, stop it, start a new method etc. Your 'main' program will need to keep a record of what is running where which maybe you don't need to worry about if you only ever load up 8 cogs.

    From a compiler point of view, the jumps are bigger. eg you call a PUB that is 500k away from where you are. But in a flat 32bit memory space that should not be hard in LMM pasm.

    So: -
    no 'special' code.
    no 'special' cogs, as the program plus its stack plus any other internal thing are entirely in external memory.
    no 'special' hub access that could potentially clash with existing obex code. (of course if the user wants talk to hub ram that is their program)
    re one platform, the default platform is maybe the C3, but ideally the LMM driver includes the few lines of code needed to talk to any external ram
    re 'one compiler', I think there are advantages to a command line compiler that deals with txt files. Keep it modular and open source. If it is command line driven it can be integrated easily into any existing IDE with just a few lines of code.


    @ Ross
    My own opinion is that the Spin language doesn't scale well

    Can you explain a bit more?
  • jazzedjazzed Posts: 11,803
    edited 2011-01-22 18:24
    There is a lack of definition of what BigSpin should be. Let's "get down to brass tacks" features.
    Here's a beginning list of "usage" so that we may understand the constraints of "implementation."

    BigSpin is by necessity a superset of Spin which among other features will include:
    • Should be syntax compatible with SPIN + some BSTC/Homespun extensions.
    • Source code files will use .bspin, that is: SomeDemo.bspin.
    • Will allow running normal SPIN code to run in HUB space as required.
    • Will allow starting normal PASM code as required.
    • Will be loaded and run in external memory by a normal SPIN program.
    • Will maintain variables and stack in external memory.
    • Will have access to normal HUB via HUB address + $10000000 (or other).
    • May support simple BSTC or Homespun extensions.
    • Allow non Propeller Tool extensions to be easily converted.
    • May support by a simple read/write external memory interface.
    • May support a COG cache access external memory interface.
    • A modified compiler will generate code and data sections at a start address > $FFFF.
    I'm sure there are more "usage" requirements that I missed. Please feel free to add them.

    I see DR_A has started a requirements list too. I think the list is compatible except for maybe BSTC/Homespun extensions which I really think is important to have in their primitive forms.
  • RossHRossH Posts: 5,353
    edited 2011-01-22 20:02
    Dr_Acula wrote: »
    Can you explain a bit more?

    Here is a (partial) list of things you might consider adding to "Big Spin" if you were actually free to develop a replacement for Spin itself. Most of these things don't matter a jot in programs up to a few thousand lines of code - but they all contribute to making larger or more complex projects needlessly difficult (in some cases nearly impossible!):
    • Spin has no memory management. It is hard to predict (or control) where in RAM a variable is going to end up. This will matter much more in Big Spin as you want to be able to specify whether things are in internal or external RAM.
    • Spin has no library management. This makes it is very hard to organize components even within your own program - everything has to live in the same directory (not exactly true, but nearly so).
    • Spin has no "externals" and no linker. This means spin programs or components cannot be distributed in binary form, and also that every program has to be recompiled from a complete set of source every time. It also makes it difficult to interoperate between Spin and other languages.
    • Spin has no conditional compilation - jazzed suggests adopting the Homespun/bstc extensions - but if Parallax themselves doesn't do so, then most existing Spin users (who use the Parallax tools exclusively) are left to mess around with preprocessors etc. Most of them will simply not bother with anything so arcane - and there goes your user base!
    • Spin has no include file processing - same consequences as previous point. We've all discovered that just being able to include a common "object" is not good enough - e.g. you can't include a PASM subroutine and then call it from existing PASM code. Also, including objects incurs overhead, whereas include files do not.
    • No macro definition capability - same consequences as previous point. Even the simplest macros can save a heap of complex and repetitive coding, and also improves the efficiency of the resulting programs. It makes large programs much easier to prototype and to maintain.
    • Spin has very small limits on numbers of symbols, and the size of symbols - same consequences as previous point (although this is an implementation rather than a language issue). Most Spin programs are currently small enough that this doesn't matter. But these limits would become major problems in larger programs. Of course, these limits can be increased - both bstc and Homespun do so - but again unless Parallax themselves does so then it means your program will compile only under one particular compiler.
    • Spin has no function (method) pointers. This makes it much more difficult to implement a whole bunch of elegant programming techniques designed to make large complex programs more maintainable. Of course, many other languages exclude pointers to functions as well - but they generally provide other techniques to make up for the lack (e.g. inheritence, templates, interfaces or generics).
    • Spin has no structures or pointer types. You have to simulate these on your own (and be aware of Spins propensity to re-order things). In a small program (where you can keep track of all references yourself) this is ok. In a large program, this is a maintenance nightmare.
    • Spin has very few variable types (ditto constant types and enumerated types) and no type extension capability. Languages that are "type poor" only really work well when you can "see" the whole source at once. Once a program becomes large enough that you struggle to remember which file contains the explanation of the use of a particular data type or structure or pointer (because none of it is evident in the code itself) then such languages are a positive menace.
    These are the main ones - I have tried to exclude things that are just my "personal preference".

    Ross.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-01-22 20:35
    jazzed & others: It is not that I am not interested. I just have other things on my plate and cannot devote the time to do things. I do however, still read them even if I don't comment.

    My spin interpreter will give you a 20+% increase in performance and the maths get a real boost. Also, there is some cog available which I had started to use to improve further code. It does however use hub for the bytecode decode table and this is where it gains some speed boost and space.

    Now, here are some thoughts to improve the performance of user spin bytecode (i.e. the output from the compilers). However, to do this would require access to the spin compiler code (homespun, bst or Proptool and note I believe mpark has released the source of the prop sphinx compiler. So, a post compiler stage could rip through the bytecode and remove the push/pop pairs that are unnecessary. This would give another performance increase.
  • jazzedjazzed Posts: 11,803
    edited 2011-01-22 20:59
    And now you and everyone else reading "the list" knows why there are other SPIN compilers available :lol: And to all those held hostage by the Propeller Tool I offer my sympathy!

    Most of the items on your list are not discouraging and has a workaround. The number of variables and methods per object is the only one that comes close to a problem and would need to be fixed. Even function pointers are possible more than one way in standard Spin.

    Also I tested #include "somepasm.inc" as in-line PASM in Homespun and it worked just fine for me.
    I did not test it extensively with large files though.

    As you suggest the "typical" Parallax customer probably wouldn't use BigSpin.
    Many of the a-typical adventurers would however.
  • RossHRossH Posts: 5,353
    edited 2011-01-22 21:45
    jazzed wrote: »
    And now you and everyone else reading "the list" knows why there are other SPIN compilers available :lol: And to all those held hostage by the Propeller Tool I offer my sympathy!
    If they read these forums, they knew this anyway. :innocent:
    jazzed wrote: »
    Most of the items on your list are not discouraging and has a workaround. The number of variables and methods per object is the only one that comes close to a problem and would need to be fixed. Even function pointers are possible more than one way in standard Spin.
    Not discouraging to you. They're not a problem to any users willing and able to find (or build) workarounds. They are also not a problem to users doing projects using only the Parallax tools. That's why these problems have remained outstanding for so long. But the point is they will become more serious problems for typical users as projects get larger. Only a very small percentage of people on these forums currently attempt "large" projects on the Prop I - and when they do they don't use Spin (since you can't).

    But this situation will change when the Prop II arrives - some of these issues will have to be sorted, or Spin risks becoming unusable as the mainstay programming language of the Propeller. We're not talking here about programs that are merely 4 times larger than current programs (assuming the Prop II has 128kb of Hub RAM). Most of this RAM is currently used for non-code anyway (e.g. buffers). We're talking about a chip that is capable of running programs between 10 and 100 times larger. Do you really think Spin is up to this? I don't!

    If we can convince Parallax to adopt at least some of the existing solutions (e.g. those which are already implemented in the non-Parallax tools) then that will help - otherwise "Spin II" (I will use this term to distinguish "whatever Parallax does to Spin for the Propeller II" from "Big Spin") will be a problem.
    jazzed wrote: »
    As you suggest the "typical" Parallax customer probably wouldn't use BigSpin.
    Many of the a-typical adventurers would however.

    Exactly - so who is the target market? The "a-typical adventurers" are currently using other languages anyway. Are you suggesting they would migrate back to Big Spin if it were available? Why would they?

    Ross.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-01-22 22:35
    jazzed said
    BigSpin is by necessity a superset of Spin which among other features will include:

    The key word there is 'superset' Big spin ought to be 100% backwards compatible with standard spin. But it can include other things too if you want and that list is a great list. I'd support all those things. And Ross's list is great too, because those are things that can be fixed.

    I particularly like jazzed's idea "Will be loaded and run in external memory by a normal SPIN program."

    You could take that one step further and allow normal spin to load and reload big spin programs.

    Maybe I'm wrong with this statement, but I assume all the compilers out there still have bits that are not open source? So if one has to start from scratch, that pascal compiler earlier might be where I might start. A somewhat daunting, but not impossible task.
    Exactly - so who is the target market?

    I think up till now the target market has been the adventurous ones, but I think that may be changing with the C3. We now have a nifty board with lots of memory and we have Spin that maxes out at 32k and at the moment people can't use that external memory to store a program bigger than 32k.
Sign In or Register to comment.