cardinal-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cardinal-dev] Parrot IR compiler


From: Melvin Smith
Subject: [Cardinal-dev] Parrot IR compiler
Date: Wed, 29 May 2002 00:52:49 -0400

Hi guys,

Dan rubbed off on me, so I decided to subscribe here.
Thanks for having me. :)

I think you guys have some good input to give on stuff I'm working
on. So to get right to the point, I'm working on the intermediate
compiler for Parrot, and I'd like to hear what Ruby might need.

So far, all the compiler does (besides translating the IR to pasm) is
register allocation. If any of you have Muchnicks book, I like
his MIR language, which I'm taking a few things from.

Presently you can write code with unlimited symbolics or named
locals and imcc will translate:

{
.local int i
i = 0
$I0 = i + 5
$I1 = $I0 * 2
$I2 = $I1 * $I0
i = $I2
$I3 = $I0 + 1
$I4 = $I0
$I5 = $I4
}

To:

set I3, 0
add I0, I3, 5
mul I1, I0, 2
mul I2, I1, I0
set I3, I2
add I1, I0, 1
set I1, I0
set I0, I1

I expect the IR compiler to focus on staying clear, simple and maintainable,
and never develop featuritis, however I want it to be adequate for all languages
targetting parrot.

We have other options like having imcc to become an assembler in its
own right, which is fine by me, but for now, I think Parrot is changing way
too fast to have another assembler branch (we already have 3 at this time).

I'll be committing imcc to the Parrot repository later this week, but in
the meantime, fire away. I think cooperation can make both projects
move a lot faster:)

-Melvin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]