Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: New Book: Exploring Programming Language Architecture in Perl

by moritz (Cardinal)
on Nov 29, 2009 at 19:32 UTC ( [id://810033]=note: print w/replies, xml ) Need Help??


in reply to Re: New Book: Exploring Programming Language Architecture in Perl
in thread New Book: Exploring Programming Language Architecture in Perl

Actually all attempts to write a Perl 6 compiler in Perl 5 have shown that it's not a very good idea.

If you want to cover only a small part of Perl 6, the one that's close to Perl 5, your chances are very good, and it runs reasonably fast. Maybe a few Perl5ism leak through, but all in all that's fine. (For example v6 works on that level).

However if you plan to write a full Perl 6 compiler on top of Perl 5, you can reuse less of Perl 5's power for Perl 6, and end up using Perl 5 as an assembly language. Perl 5 is a great high level language, but a rather poor assembly language, so your compiler and the run-time engine becomes slow, very slow.

That happened to the KP6 ("KindaPerl6") compiler, and I guess it will happen to all other Perl 6 compiler projects which use Perl 5 too heavily under the hood.

  • Comment on Re^2: New Book: Exploring Programming Language Architecture in Perl

Replies are listed 'Best First'.
Re^3: New Book: Exploring Programming Language Architecture in Perl
by billh (Pilgrim) on Nov 30, 2009 at 23:04 UTC

    > Actually all attempts to write a Perl 6 compiler in Perl 5 have shown that it's not a very good idea.

    It's not at all an attempt to discuss Perl 6, I wouldn't presume to second guess the developers on that topic. It's really just an exposition of the more fundamental ideas of programming languages in general, particularly lexical closures and continuations, and the interesting places you can get to if you follow those leads. Really just a jumping off point for people who might like to explore further.

    I must stress that this is not a book about perl, it just happens to use perl because it is a convenient language and has a wide user base (and because I like Perl.)

    Bill H
    perl -e 'print sub { "Hello @{[shift->()]}!\n" }->(sub{"World"})'
Re^3: New Book: Exploring Programming Language Architecture in Perl
by zentara (Archbishop) on Nov 30, 2009 at 14:16 UTC
    However .... Perl 6 compiler on top of Perl 5.,......and end up using Perl 5 as an assembly language. Perl 5 is a great high level language, but a rather poor assembly language,

    ...that jogs the memory.... i do remember the initial promo on Perl6, where an assembly language of sorts, called Parrot, was going to be the base language for all interpreters, like Perl, Python, Ruby, etc.

    ...whatever happened to the dream of the Grand Unified Language ? .. :-)


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku
      i do remember the initial promo on Perl6, where an assembly language of sorts, called Parrot

      Parrot is a virtual machine; the assembly language is called PIR (Parrot Intermediate Representation). But it's not essential for language interaction. The important concept is that parrot knows about common concept in dynamic programming languages (like subs, methods, strings, integers, other numbers, conversion between types, namespaces), and thus allows you to call methods on foreign objects.

      Since Perl 5 was never ported to Perl 6, I don't see how parrot relates to the statement that Perl 5 is a poor assembly language.

      ...whatever happened to the dream of the Grand Unified Language ?

      That's still alive, and in Rakudo you can eval() Ruby code, and load Ruby libraries - to the extend that they run on the ruby compiler for parrot, which is quite limited right now.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-29 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found