in reply to Re^7: Run Perl 5 in the Browser!
in thread Run Perl 5 in the Browser!

JIT is about optimizing the main cases and observing the edge cases.

You don't need guarantees because you just fall back to the generic solution if the input variables become unusual.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^9: Run Perl 5 in the Browser!
by ikegami (Patriarch) on Aug 23, 2018 at 20:39 UTC

    It's the checking that makes it slow right now, so I'm not sure how what you said helps.

      What I suggested is very similar to memoization.

      Only you don't cache the result of a function based on passed values.

      You cache the optimized code based on passed types *

      see https://en.m.wikipedia.org/wiki/Just-in-time_compilation

      Hence the "slow" checking only happens at call time.

      (of course you'll need kind of type of inference deduce implied types inside a sub)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      *) and global states like bigint