develooper Front page | perl.perl6.internals.api.parser | Postings from December 2000

Re: Now, to try again...

Thread Previous | Thread Next
Sam Tregar
December 17, 2000 11:32
Re: Now, to try again...
Message ID:
On Sun, 17 Dec 2000, David Grove wrote:

> That sounds too complex for what seems like a more simple solution. When
> you say "turn simple 'languages' into perl", that's what Dan's told me is
> my source filter. Actually, it's a bit more than a source filter. The goal
> would be to turn the creole language into perl, but not necessarily by
> filtering it, at least not solely. It can also map creole lexemes to perl
> lexemes (within the context of a more complex more-than-filter filter).

I imagine that Larry will weigh in on this subject, but I'd like to
comment anyway.  How useful is a "little language" so similar to Perl 6
that you can use Perl 6's parser to parse it?  Anything substantially
different is going to require its own parser.

It comes down to what is meant by "little language".  When I hear that
term I immediately think Scheme and TCL.  They both have a small core and
extremely regular syntax.  I can imagine writing a smallish parser that
spits out Perl bytecode for either.  Or does "little language" mean a Perl
where some keywords are spelled differently and some operators use
different symbols but the language is otherwise unchanged?

Sounds like a language-design question, doesn't it?

> Must a creole parser/lexer be invented that outputs a source tree, or
> could it be as simple as translating to a common form (Perl 6 language
> spec) and having only that common form be turned into our source tree?

I imagine this could be left up to the "creole" parser.  It could call the
Perl 6 parser any time it wants, but I don't see why it should have to!
Ultimately any parser that interfaces with the Perl parser API will have
to produce Perl 6 bytecode.  If it needs help getting there, that's ok.

> the former would be faster but would almost certainly be a programming
> nightmare... at least it would complicate things beyond common sense.

What?  I don't think anyone expects writing a new frontend for Perl 6 to
be an easy job but "a programming nightmare"?  "Beyond common sense"?  I'm
not suggesting they program it in StoryServer!


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About