Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why to use Parrot (or other VM) if I have an interpreter?

Why should I use VM, like Parrot, for a dynamic language I use (Python, Perl, ...) if I already have an interpreter? What can I potentially gain, for the cost of having different VM between my code and my machine, and by using a separate interpreter?

(I am new in VM issue, so maybe the answer is obvious)

EDIT

What's the benefit of Parrot VM for end-users?

like image 723
Jakub M. Avatar asked Aug 17 '11 13:08

Jakub M.


1 Answers

Why should I use VM, like Parrot, for a dynamic language I use (Python, Perl, ...) if I already have an interpreter?

First, if you're starting a project, then you may not already have an interpreter.

However, assuming you have an interpreter and are considering whether to add functionality to it or rewrite it to use Parrot, the tradeoffs that come to mind are:

  • In general, Parrot is probably better tested than the interpreter in question (better optimizer, better garbage collector, etc.)
  • In general, Parrot's developers know more about cross-platform issues than run-of-the-mill programmers
  • In general, Parrot has solved most problems you're likely to run into
  • Parrot was designed with complete generality in mind, and that added a ton of complexity; you may not need the extra generality

Personally, Parrot's optimizer (and register-based design, largely to make optimizations easier) and well tested cross platform codebase would be enough to convince me.

like image 72
Max Lybbert Avatar answered Oct 02 '22 13:10

Max Lybbert