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

Re^3: Perl 6 and Perl 5 parsing

by ikegami (Patriarch)
on Jan 14, 2011 at 18:58 UTC ( [id://882392]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl 6 and Perl 5 parsing
in thread Perl 6 and Perl 5 parsing

Then whats the point in separating compile time and run time

Speed. There's no reason to compile code every time it's executed. That would be very slow, and there's no advantages to doing it that way.

In a way so as long there is a BEGIN block isn't that impossible.

Not at all. It just prevents the compile-time of all code blocks from happening at the same time.

Replies are listed 'Best First'.
Re^4: Perl 6 and Perl 5 parsing
by moritz (Cardinal) on Jan 14, 2011 at 19:20 UTC
    Speed

    And consistency.

    Consider code like

    for (1..10) { # some statements # grammar modification here }

    If compile time and run time modification were not separated, the head of the loop would be once parsed without the grammar modifications, and then reparsed with grammar modifications - a nightmare for readability and debugging.

      I had mentioned code polymorphism in my reply, but I removed it before posting because code polymorphism can still occur with a single compile-time. Yes, it's nightmarish, but it's not a reason for separating compile-time.

        Yes, it's nightmarish, but it's not a reason for separating compile-time.

        Huh? A nightmare is not worth avoiding? Why is it no reason?

Log In?
Username:
Password:

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

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

    No recent polls found