4 ms·
I'd like someone to compare it to LLVM.
by rw 17y ago
I'd like someone to compare it to LLVM.
- johnnybgoode 17y agohttp://news.ycombinator.com/item?id=656536 http://news.ycombinator.com/item?id=656536
- russell 17y agoBeing the altruistic guy that I am, I read the article for you. :-) (Not to mention that I was wondering my self.) My take on LLVM is that it is a low level interpreter, near to the actual hardware. Parrot probably is itself, but the big bonus with Parrot is that it inherits a huge library from Perl and CPAN. That's the advantage for somebody developing a new language: an already existing massive library. Like the advantage the Java VM has with all the class libraries. This advantage is not so great if you are developing a language where the library violates the constraints of the language, e.g. immutable objects. I surmise that Google went with LLVM for Python because Python already had that massive library and didnt need Perl's. Both Parrot and LLVM are register based interpreters which give a nice speed improvement over stack based interpreters, like CPython and JVM. The registers are an abstraction and dont have anything to do with the available machine registers. Even compilers targeting real hardware use abstract registers internally. A minor misstatement in the article. Writing a parser is not hard. There are a huge number of tools out there. Parrot's is just one more. And if your language is simple, hand coding a recursive descent parser isn't all that difficult. It just isn't worth the effort.
- dave_au 17y agoThe unladden-swallow page says they're using the LLVM JIT compiler in order to be able to compile Python / bits of Python to machine code. So it's less about choosing a VM from LLVM / Parrot / JVM / etc and more about using a feature of LLVM to get a speedup.
- granular 17y agoThe Perl folk are being very bold, IMO. With Parrot and Rakudo, they're saying that you can write code in Perl 6 and utilize libs in other languages (including the CPAN in Perl 5), or you write code in other languages and still have access to all those libraries. That is, they must be quite confident that Perl 6 is a winner, and that most users won't just write, say, Python, run it on Parrot, and make use of the CPAN from there. (Please tell me if I'm totally missing the point, but my understanding is that any Parrot-hosted lang can access any other Parrot-hosted lang's libs.)
- donaldc 17y agoPerl (especially Perl 6, if/when it reaches completion) and Python fill very different temperamental niches. They have profoundly different takes on programming, despite their similarities in terms of both being high-level, interpreted languages. So it seems likely that both will be around for a good long while. If many languages start using Parrot as a VM, it will moderate the current "rich get richer" dynamic of programming language competition. A language leading in the module race will no longer have such a huge advantage. This will help Perl 6 immensely, of course, since it will start out with very few Perl 6 modules. They'll need to get the Perl 5 CPAN modules working on Parrot to compensate, and it is a happy side-effect that this will make these same modules usable by any other languages running on Parrot. Also, a point the article doesn't mention is that Perl 6 itself is designed to be a mutable language. Going one step beyond the article, why implement a whole new language at all, just to add/try out a new concept? It may be simpler to instead modify the Perl 6 parser (written in Perl 6 of course) to add your new concept to the syntax and semantics of Perl 6. I love the idea. I just hope there's actually a ready-for-production implementation of Perl 6 running on top of Parrot at some point.
- pohl 17y agoI just wanted to add some clarification regarding LLVM: it is not, at all, an interpreter. Rather, it is a compiler back-end in the sense that it translates from an IR (intermediate representation) to machine code. The way that it's written makes it useful both in static compilation and JIT (just in time) compilation contexts. Also noteworthy: the IR has both a human-readable and compact binary persistent representations, so it's conceivable that one could use the latter (LLVM BC, as in "bitcode") to ship architecture-neutral binaries to end users that get compiled down to optimized machine code at installation time, or launch time, or just-in-time while the executable is running. LLVM is many things, but it is not an interpreter at any level.
- uriel 17y agoI'd like someone to compare it to Dis: http://doc.cat-v.org/inferno/4th_edition/dis_VM_design http://doc.cat-v.org/inferno/4th_edition/dis_VM_design
- draegtun 17y agoAs noted in other comments here Parrot & LLVM are not mutually exclusive. Parrot has been compiled on LLVM as can be seen on this post: http://perlgeek.de/blog-en/news/parrot-buids-with-llvm-gcc.writeback http://perlgeek.de/blog-en/news/parrot-buids-with-llvm-gcc.w...
- draegtun 17y agoAnd just for further reference Perl5 has also been tested with LLVM: * http://use.perl.org/~Matts/journal/38786 http://use.perl.org/~Matts/journal/38786 * http://www.perlfoundation.org/perl5/index.cgi?llvm http://www.perlfoundation.org/perl5/index.cgi?llvm