On Sat, 6 Sep 2003, Amir Karger wrote:

> OK. I think I've learned enough about Parrot to respond to this email
> intelligently.
> 
> --- Nicholas Clark <[EMAIL PROTECTED]> wrote:
> > > - Is it not being ported because of a lack of tuits, or because
> > > it's extremely hard?
> > 
> > We'd need dynamic opcode loading because we don't want to have the
> > Z-machine specific opcodes compiled into every parrot (or every other
> > specialist set of opcodes)
> 
> Right. What you're saying here is that I'll need to write Zmachine.ops,
> or some such. It will include all the Z-machine operations, which the
> bytecode will call.

Yep.
 
> > We'd want dynamic bytecode conversion because we want parrot to be
> > able to directly load Z-code files, rather than having to first run
> > an external program to convert them.
> 
> Right. The problem that I see with this is that Z-code "story" files
> have a very definite header format, which is almost but not quite
> entirely unlike Parrot bytecode. Just for example, the first few bytes
> are totally different, but are necessary for both languages.

Right, which is good.

What I want to have happen is that when parrot is handed a bytecode file 
to execute, it examines the header of the file to find out what type of 
bytecode it is, and dispatch to the right loader. So when you load up a 
story file as if it were native bytecode, the bytecode loading routines 
identify it as a zcode story file rather than parrot bytecode and dispatch 
it to the zcode loader rather than the parrot bytecode loader.

> From what I can understand, "native" means (if we ignore dynamic
> bytecode
> conversion issues) running directly from the bytecode, but writing new
> ops. That is, not using PASM at all. In that case, do I even have
> access
> to Parrot's stack? (Or do I just need to access all of it through C?) I
> guess maybe my mistake is in thinking of PASM as Parrot. 

PASM is parrot's assembly, but when you're writing actual op functions 
you're extending parrot's opcodes--C is essentially Parrot's microcode. 
>From within opcode functions you have full access to all of the underlying 
structures, so if you want to access Parrot's stack in z-machine ops, go 
for it.

                                        Dan

Reply via email to