Hi,
GDR! wrote:
I'm new here so I'll say hello - I'm GDR!.
Welcome! :-)
I was looking at the Parrot project recently and I'd like to
implement the VM in hardware. I'm not deeply into the project,
however, so I'd like to ask you if the Parrot bytecode is now stable
enough to begin hardware developement - I wouldn't like to end up with a chip
supporting some pre-historical version of VM.
I'm sure there will be additions and probably the odd deprecation to the
opcodes, and there are probably some that are spec'd and not implemented
yet (e.g. for I/O stuff - I'm not sure without checking).
That said, I think changes to the bytecode format are going to be the
least of your problems. Have you seen how many ops there are, for
starters? :-) Also, many of the opcodes do pretty complex stuff, and
many of them depend on what a PMC does, and you'll probably find
yourself needing to call back into software a LOT. You certainly can't
get things like method dispatch done in hardware, as it's up to a
particular class system to choose how to implement it. Even things like
indexing into arrays falls into that boat.
I'm curious what you want to achieve through working on this. Since
you'd be calling back into software so much, and it's highly unlikely
you're going to make anything that executes compiled, optimized C faster
than the leading CPUs of today, I'd be highly skeptical of getting any
kind of performance gains. Especially with JIT and all that jazz.
If this is for a degree project or something (just a guess), personally
I'd not do this. I did a (well received) project in my own degree
involving Parrot, and I know others have too, so I certainly encourage
people to do Parrot-related projects. I think it'd be very hard to make
a success of this one. Of course, I'm always open to being proved wrong.
Hardware-level instructions to allow high-performance execution of
dynamic languages could be an interesting area to explore - I don't know
what's been done there already - but I don't think that trying to
implement Parrot in hardware is the way to go if you want to look into
this...you might find Parrot and other dynamic language's interpreters
for hints as to what might be needed though.
Hope this helps,
Jonathan