Ken Fox <[EMAIL PROTECTED]> wrote:
> Simon Cozens wrote:
> > ... Mono's work on JIT compilation ... they've got some pretty
> > interesting x86 code generation stuff going on.
> 
> Mono is doing some very cool stuff, but it's kind of hard
> to understand at this time. The x86 code generation macros are
> easy to use, but the instruction selection is based on a
> re-implementation (?) of BURG and it will take some time to
> dig through the way that code works. BURG is a code-generator
> generator in the style of yacc. (More trips to the library...)

BURG means "Bottom-Up Rewrite Grammar"... a way to generate
optimized code quickly *if* you have plenty of memory available.
We're not planning to use this technique in DotGNU because we
think that the resulting heap thrash problem will likely
destroy the performance gains from BURG.

> If all the current JIT work is focused on JVM and CIL, then Parrot's
> JIT is going to break new ground.
> 
> There's a more fundamental issue though. After spending time
> looking at the benefits of a JIT and thinking about the "yet
> another switch/goto implementation" conversation, I'm starting
> to think that a JIT will be almost useless for Parrot.

I don't think so.  Of course Perl is rich enough that you can
create code which is so intricately complicated that trying to
JIT it makes no sense.

But I believe that such code will always be the exception, not
the rule.

> JITs help when the VM is focused on lots of small instructions
> with well-known, static semantics. Perl's use of Parrot is going
> to be focused almost completely on PMC vtable ops.

A lot of real-life Perl code contains just function calls and
operations on scalar variables that contain either a string or a
number, as well as arrays and hashes which contain such values.
I would like this kind of code to be compiled to instructions
with static meaning, together with some kind of marker that this
chunk of code should be JITed.

> Is there any interest in a less dynamic dialect of Perl that can
> take advantage of a JIT?

I think the compiler should automatically identify the parts of
a program where JITing makes sense.

(Disclaimer:  I'm not volunteering to actually implement
this... I'm just speaking as a user who highly values Perl's
flexibility but who still writes pretty simple, straightforward
code most of the time.)

Greetings, Norbert.

-- 
A member of FreeDevelopers and the DotGNU Steering Committee: dotgnu.org
Norbert Bollow, Weidlistr.18, CH-8624 Gruet   (near Zurich, Switzerland)
Tel +41 1 972 20 59       Fax +41 1 972 20 69      http://thinkcoach.com
Your own domain with all your Mailman lists: $15/month  http://cisto.com

Reply via email to