Spin Implementation?
Seairth
Posts: 2,474
Is the Spin interpreter still going to be loaded from ROM, or will it now be embedded in the compiled binary? Either way, has there been any consideration of publishing the code for it?
Comments
Therefore I expect source to be available, as is for the P1.
If parameters and local variables are on the CLUT stack it means Spin programs cannot get their addresses any more.
I suspect not many programs want to do that but it might be worth remembering.
I think it would break Lonesock's F32 floating point object for example.
It's a combined stack. And, yes, it would make locals only directly addressable. Any indexed variables would have to be declared in main memory using VAR. The upside to this is that you are not likely to run out of stack space having only 256 longs because you wouldn't be putting arrays on the stack. And recursive calls would have to be very limited.
Do you guys see this as much of a problem? I look at it as if locals were something akin to registers.
Why?
The CLUT version should be a little faster, but it will break some existing Spin code and limit call stack depth.
The HUB version would not break existing code, and allow deep stack nesting (and recursion)
- use separate address spaces for byte code and for data
- this allows 16 bit pointers (like the Spin interpreter currently uses) for code and for data
I am sure this has occurred to several people already... and I would prefer a flat 32 bit address space, but this would allow getting something running faster.
Are we precluding Spin programs from using video harware?
Actually can current Spin use video hardware? I have never thought about it.
Same for C for that matter. I was thinking than an FFT might do that for the sin table or an emulator would do that for the dispatch table.
Having multiple versions of the interpreter may cause some confusion. We may need to explicity include the source for the interpreter with the Spin source code. Maybe this can be specified in the OBJ section, or a new specifier may be needed.
I'm with Heater on this point, but there is a whole lot more to be discussed yet.
Frankly, I would love it if SPIN included LMM this time around. We could do in-line PASM and make large, fast programs "bbc-Basic" style, ideally not as ugly syntax wise though. When it's all said and done, I probably will make this a project based off of whatever SPIN we settle on.
Such LMM code has then also access to the CLUT and all the other cog features that are not supported by Spin commands.
Andy
Edit: I see potatohead had the same idea while I wrote it...
Do you think that initially a restriction to using the lower 64KB hub space might be acceptable?