[Please forgive me for chiming in late on this thread; I just got a chance
to catch up on mailing list traffic.]
> > On Tue, Sep 12, 2000 at 03:17:47PM -0400, Ken Fox wrote:
> > > That's fine for the VM and the support libraries, but I'd *really* like
> > > to see the parser/front-end in Perl. There are dozens of RFCs that require
> > > some non-trivial extensions to the parser. It would be nice to code these
> > > in Perl
> On Tue, 12 Sep 2000, Simon Cozens wrote:
> > Are there any better reasons than "It would be nice?"
Dan Sugalski wrote:
> It'd make things easier? (I'd rather write a parser in perl than C...)
I have one argument to make for writing the parser in a subset of Perl.
While it does make bootstrapping a bit harder the first time, it also
makes bootstrapping more *possible* in other cases where it would be
virtually impossible otherwise.
In other words, I am arguing that writing the parser in a subset of Perl
makes the easy jobs a bit harder, but the hard jobs possible. :)
Someday, for the JVM port of Perl, I'd like to support eval(). The only way
to do that on the JVM natively is to have a parser that compiles to JVM
code, too.
When I brought this problem to Per Bothner (well-known GCC hacker, and
author of the Scheme to JVM port, Kawa), he said: "Well, the best way would
be if a parser for Perl was written in a subset of Perl. Then, you could
bootstrap a simple compiler in Java that supports that subset, and that
would buy you the full parser."
I really like that idea.
While C is ubiquitous for most computing tasks, it isn't ubiquitous on
native JVM platforms. You really need to have everything available in Java
or a language that compiles to the JVM efficiently. C will likely
eventually compile to to the JVM, but it'll never be as native as Java is.
Consider, too, that people may want to implement Perl in another way,
perhaps radically different ways, down the line. It will be a nice
jump-start for them if there is some subset of Perl that buys you a full
Perl parser.
So, I'd like to see the parser written in a simple subset of Perl or some
other small language that can be bootstrapped fast. And, if we pick a
simple subset of Perl, translating to efficient C probably shouldn't be too
hard.
Does this argument make sense? Comments welcome.
--
Bradley M. Kuhn - http://www.ebb.org/bkuhn
PGP signature