How does Parrot compare to other virtual machines?

前端 未结 7 1566
梦如初夏
梦如初夏 2021-02-01 03:52

Parrot is the virtual machine originally designed for Perl 6.

What technical capabilities does the Parrot VM offer that competing virtual machines such as the Java Virtu

相关标签:
7条回答
  • 2021-02-01 04:08

    You can read about much of this on the Parrot VM Intro page.

    The main advantage Parrot has over the JVM or the CLR would be that it is designed to support dynamic languages first, and potentially provide better support and performance for dynamically typed languages. The JVM and the CLR are both geared more towards supporting statically typed languages, and many of the design decisions show that.

    0 讨论(0)
  • 2021-02-01 04:21

    One other thing that makes Parrot different from most VMs (certainly different from the JVM), is that it's a register machine rather than a stack machine. But I think people will be arguing for a long long time whether that can be called an advantage or a disadvantage.

    0 讨论(0)
  • 2021-02-01 04:22

    Parrot is the virtual machine originally designed for Perl 6.

    There are now two VMs originally designed for Perl 6; commits to MoarVM began in 2012.

    What technical capabilities does the Parrot VM offer that competing virtual machines such as the Java Virtual Machine (JVM)/Hotspot VM and Common Language Runtime (CLR) lack?

    In another answer on this page, Reini Urban, the current (April 2015) Parrot lead dev, provides a brief comparison of Parrot with the JVM and CLR VM.

    According to Reini, a key advantage Parrot has over MoarVM is "effectively lock-less threads".

    0 讨论(0)
  • 2021-02-01 04:25

    I don't know JVM and CLR enough, but my tips:

    • dynamic languages (closures, polymorphic scalars, continuations, co-routines) support (speed)
    • dynamic method dispatch,
    • first class functions,
    • first-class continuations,
    • parameters (optional, named, ..),
    • register based
    • has HLL interoperability provided at an assembly level
    • range of platforms

    Update: This is probably irrelevant as JVM is one of Rakudo Perl 6 backends nowadays. See Rakudo Perl 6 on the JVM (Perl 6 Advent calendar 2013, Day 3).

    0 讨论(0)
  • 2021-02-01 04:28

    The main advantage and technical difference over the JVM and the CLR is that types (classes called PMC's) and ops (methods) may be dynamically loaded from efficient user-provided C implementations, and the parser framework to create and extend languages is built-in.

    0 讨论(0)
  • 2021-02-01 04:28

    This question is outdated. Rakudo Perl 6 no longer targets Parrot as a backend; MoarVM is the preferred backend, with the JVM backend a work in progress (generally works, but many Perl 6 features not implemented or currently broken). Development work (not ready for users) is being done to add Javascript as a third backend.

    0 讨论(0)
提交回复
热议问题