This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Using Kawa to port Perl to the JVM


"Bradley M. Kuhn" <bkuhn@ebb.org> writes:

> I'd like to somehow use a walk of the perl intermediate representation to
> generate Kawa's intermediate representation.

I think that is the best approach.

> Thus, I'd like to reuse much of what is in gnu.expr.* in some way.  However,
> I am not sure what is reusable.  Some things seem pretty general, but a lot
> of it seems specific to Lisp-like languages.

Such as?  I think most of it should be re-usable.

> Do you all (and, in particular, Per :) have an suggestions on what parts of
> gnu.expr.* I should look at reusing?

All of it ...

One problem that comes to mind:  What kind of control structures does
the Perl intermediate format use?  If it involves unrestricted gotos
that would be a little more difficult, since gnu.expr does not at this
point support that.  However, it does support the ususual control
structures, including exit from a block.

> I started by thinking I should just begin subclassing Expression, creating
> my own Perl expressions.

In general, you should avoid sub-classing.  For example, data
operations (anything that in Scheme would be a builtin procedure)
should all be handled as ApplyExp instances.  You can use that to
call a specific method, if you need to.

> However, at first glance, I got concerned that the
> Compilation class is so Scheme-specific,

Not as far as I know.

> and that subclassing it wouldn't work for Perl.

Sub-classing is to be avoided for other reasons.

Is there a convenient on-line definition of the Perl intermediate format?
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]