This is the mail archive of the
mailing list for the Kawa project.
Re: Using Kawa to port Perl to the JVM
- To: "Bradley M. Kuhn" <bkuhn at ebb dot org>
- Subject: Re: Using Kawa to port Perl to the JVM
- From: Per Bothner <per at bothner dot com>
- Date: 11 Dec 2000 09:54:13 -0800
- Cc: kawa at sources dot redhat dot com
- References: <20001211065158.I13562@ebb.org>
"Bradley M. Kuhn" <email@example.com> 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?