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

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.

Replies are listed 'Best First'.
Re^5: Perl 6 and Perl 5 parsing
by ikegami (Patriarch) on Jan 14, 2011 at 19:24 UTC

    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?

        I don't understand the confusion — it follows directly from the previous statement — so I throw the question back at you. If having a single compile doesn't prevent the nightmare, how can having a single compile be a reason for preventing the nightmare?