Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: A great talk on Perl6

by emilbarton (Scribe)
on Apr 02, 2014 at 06:46 UTC ( [id://1080683]=note: print w/replies, xml ) Need Help??


in reply to Re: A great talk on Perl6
in thread A great talk on Perl6

It is usable already on Parrot virtual machine, and will target the Java virtual machine. But that's a question I wanted to ask: why did they choose to implement it that way? Why not making it a lower level language?

Replies are listed 'Best First'.
Re^3: A great talk on Perl6
by raiph (Deacon) on Apr 03, 2014 at 04:24 UTC
    Hi emilbarton,

    A quick clarification. First, Rakudo (well, NQP really, but let's call that an implementation detail for now) not only already targets the JVM as well as Parrot but is generally at parity or better feature wise when running on the JVM.

    (And Rakudo on MoarVM is generally at parity with or better than Rakudo on JVM. The first release of Rakudo Star (a bundle including the compiler and modules) that supports these three backends will likely ship about one month from now.)

    I'm not sure what you meant by your why questions. Are you suggesting Perl 6 should itself be a lower level language? Or that the compiler should target a lower level language? Something else?

    Rakudo targets NQP. NQP in turn targets various backends. If your question is "why NQP?", please watch Patrick Michaud's excellent explanation of where NQP came from, where it fits in, and where it's going at YAPC NA 2013. (I recommend you start at 6 minutes in and watch at least the next 5 and a half minutes.)

      Thank you very much for these explanations, I don't know much about compilers and virtual machines so it's a bit difficult for me to sustain my suggestion. I was just comparing Perl6 with Java and thought that as Java programs could be compiled independently of JVM, i.e. run as C or C++ executables, it would be nice if Perl6 had this possibility too. But now I have a doubt about this possibility in Java, maybe I've just interpreted wrongly some compilation steps I had to do with some Java programs.

      Could NQP or another compiler produce also binary executables (not bytecode intended for virtual machines)? After listening to your link I wonder if this is possible, or if I understand enough of what is going on under the hood to continue this discussion. Sorry for everything silly then.
        > Could NQP or another compiler produce also binary executables (not bytecode intended for virtual machines)?

        One of the main problems with such ideas is to underestimate the dynamism of languages like Perl or JS.

        Just think of the need to have the whole compiler backend to simulate eval.

        Thats why one ends up using a VM with JIT compiler, like V8.

        And of course those can be bundled into a stand-alone executable.

        So the answer depends on the definition of "binary executable".

        Cheers Rolf

        ( addicted to the Perl Programming Language)

        Rakudo can't do that because...

        Well perl-6 can't do that because you can't run perl-6 without a runtime to figure out things like method dispatch and to manage garbage collection and other things. Someone could write a linkable library to provide that but that would only delay perl-6 actually coming out so GET RIGHT ON THAT #perl6!

        Rakudo can't do that because it uses a modified Xeno's Paradox for its development process: every time it gets halfway to completion, someone decides to start a port to yet another backend (or rewrite something else from scratch).

        Java programs could be compiled independently of JVM ... now I have a doubt about this possibility in Java

        I don't think you can do that. Tools like Excelsior JET or exe4j are distributed with, or install, a JVM. Afaik tools that compile to native code do so via a JVM.

        Could NQP or another compiler produce also binary executables (not bytecode intended for virtual machines)?

        In theory, yes, but why? I see plenty of downsides and no upsides. What would you hope such an approach would achieve?

Re^3: A great talk on Perl6
by Anonymous Monk on Apr 02, 2014 at 18:49 UTC
    It's usable if you don't need documentation or libraries. If you like hanging out with drunks on IRC to get bug fixes. If packaging isn't important to you. If you want to deploy code from Git checkouts every day. If you don't mind that Rakudo has been trying to get rid of Parrot for several years. If it's okay that the spec isn't even finished for things like lists or containers. If you're okay being like the third or fourth person using it for anything real.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1080683]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-03-28 16:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found