szabgab has asked for the wisdom of the Perl Monks concerning the following question:

I was wondering the other day how difficult it will be to implement the Parrot VM on a real chip ?
If it can be done how would someone use it ? As an additional chip in the computer or as the main processor?
Who would benefit from such implementation ?
This article seems to claim that such implementation might be actually slower (here and there) than a Virtual implementation.
What do you think ?

Replies are listed 'Best First'.
Re: Parrot on a chip
by stvn (Monsignor) on Feb 17, 2005 at 23:02 UTC
    I was wondering the other day how difficult it will be to implement the Parrot VM on a real chip ?

    There is (or at least there was the last time i cared to look) a number of JVM's on a chip out there. I think the real benefit of those were in porting Java to embedded systems. And I expect that would be one "benefit" of doing the same with parrot. However you need to realize that Parrot is a virtual machine, and therefore is not bound by physical hardware and silly things like physics. It can do things (as the author of the article you linked to pointed out) which would be harder or impossible in real world hardware.

    Also keep in mind that Parrot itself is not an OS, it has no underlying file system, or process management (at least as far as I know of Parrot). So that would need to be implemented in some kind of on-board microcode somehow, etc etc etc. It would get ugly after a while.

    If you are interested in such esoteria, take a look at Erlang. It was built to run in the embedded space, and so implements its own mini-OS of sorts, which has file handling and process management. The whole thing was created for running Ericson telephone switches.

    Anyway, thats my 2 cents on the idea. Probably only worth a penny in the end since I am a web developer with an art background and not an electrical engineer :)

    -stvn

      It can do things (as the author of the article you linked to pointed out) which would be harder or impossible in real world hardware.

      Never impossible. Even the software VM eventually goes down to hardware CPU(s). But it is true that the designer of instruction sets for a software VM usually won't bother to ask how easy a given instruction could be implemented in hardware. Often, they may not even have the know-how to figure out how to design a hardware-based architecture (which is fine, since their aim is software).

      Some might be interested in an old architecture, the Burroughs B5000 (poke around Google for information), which was supposedly optimized to run higher-level languages. In the recent ACM interview with Alan Kay, he mentioned a benchmark on that machine (made in 1979) and a more modern one. The modern machine ran it 50 times faster. However, Moore's "Law" should have given it roughly 50,000 times speed up. Somewhere along the way, we lost around three orders of magnitude in speed due to bad architectures.

      "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

      szabgab has asked for the wisdom of the Perl Monks concerning the following question:

      I was wondering the other day how difficult it will be to implement the Parrot VM on a real chip ?

      to which stvn replied:

      There is (or at least there was the last time i cared to look) a number of JVM's on a chip out there. I think the real benefit of those were in porting Java to embedded systems. And I expect that would be one "benefit" of doing the same with parrot.


      starbolin quips in quoting from: IMCC and Parrot Programming for Compiler Developers - Frequently Asked Questions

      Static languages, such as Java, can run on VMs that are dedicated to execution of pre-compiled byte code with no problems. Languages such as Perl, Ruby and Python are not so static. They have support for runtime evaluation and compilation and their parsers are always available. These languages run on their own "dynamic" interpreters.

      Skimming through the documentation it seems one could implement PASM as a CISC machine then IMCC could be tweeked to generate code for your hardware. This would offer a natural partitioning.

      How do you make a statue of an elephant?

Re: Parrot on a chip
by zentara (Cardinal) on Feb 18, 2005 at 13:31 UTC
    seems to claim that such implementation might be actually slower

    Well it makes sense it would be slower, unless it was put on a pci card that interfaces with a fast cpu. Why? Well usually the whole purpose behind putting code on a chip(disregarding size concerns), is to save money, by using a cheaper processor and support circuitry. The designers will try to build in just enough processing power to get the job done. So would a "parrot-on-a-chip", being driven by a 100mhz Pentium, with just a few megs of ram, be as fast as one on a 10 Ghz top-of-theline cpu, with gigs of ram available?


    I'm not really a human, but I play one on earth. flash japh
Re: Parrot on a chip
by chip (Curate) on Mar 29, 2005 at 17:07 UTC
    Parrot is a Virtual Machine, with emphasis on the Virtual. I think that AMD, Intel, IBM, etc. are quite good at making fast silicon. I have no interest in competing with them, even virtually.

        -- Chip Salzenberg, Free-Floating Agent of Chaos