Google Groups unterstützt keine neuen Usenet-Beiträge oder ‑Abos mehr. Bisherige Inhalte sind weiterhin sichtbar.

Punie ported to PAST-pm

0 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Allison Randal

ungelesen,
02.01.2007, 03:01:5402.01.07
an Perl 6 Internals
I've just checked in the modified Punie code that runs on the improved
compiler tools. I sent various comments to the list as I went through
the port, so I won't repeat them here. A few more comments from the end
of the porting process:

- I like the way PAST-pm handles conditionals. It makes for simple
transformations at the PAST stage (especially if conditionals are parsed
recursively).

- I like the way PAST-pm handles comma operators.

- The modifications to HLLCompiler mean the core compiler script for
Punie is quite short. Very nice.

- I ran into one bit of strangeness with the assignment operator on
simple strings (it was generating an 'assign' opcode with 3 arguments
for the source code "$x = 'test'"). I solved it by setting 'pasttype' to
'assign', but now the generated code is unnecessarily calling the
'clone' opcode (e.g. "clone $P10, $P10"). I'll come back and look at it
later.

- The old Punie was loading a library of builtin functions in the 'main'
routine of every generated Perl 1 script. I haven't figured out how to
do that yet in the new PAST, which means that I can only run Perl 1
scripts interpreted. They fail when pre-compiled to .pir files because
the builtins aren't loaded.

I didn't delete the POST implementation from languages/punie/lib,
because IIRC, it was being used by other language implementations. I'll
come back and delete it after I hear that anyone who was using it has
moved to the new POST.

Many thanks to Patrick for all the work he's put into PAST-pm and
HLLCompiler. They're a huge step of progress.

Allison

Patrick R. Michaud

ungelesen,
02.01.2007, 11:31:5802.01.07
an Allison Randal, Perl 6 Internals
On Tue, Jan 02, 2007 at 12:01:54AM -0800, Allison Randal wrote:
> - I ran into one bit of strangeness with the assignment operator on
> simple strings (it was generating an 'assign' opcode with 3 arguments
> for the source code "$x = 'test'"). I solved it by setting 'pasttype' to
> 'assign', but now the generated code is unnecessarily calling the
> 'clone' opcode (e.g. "clone $P10, $P10"). I'll come back and look at it
> later.

PAST-pm's handling of assignment is about to be refactored a bit
in order to support Perl 6's binding operator (:=). Yes, the
generated code sometimes calls a clone when it doesn't need to --
this is going be handled by having PAST-pm keep track of which
PMCs are "temporaries" and thus available for re-use instead of
requiring cloning.

> - The old Punie was loading a library of builtin functions in the 'main'
> routine of every generated Perl 1 script. I haven't figured out how to
> do that yet in the new PAST, which means that I can only run Perl 1
> scripts interpreted. They fail when pre-compiled to .pir files because
> the builtins aren't loaded.

I'll look into this one a bit. One of the next items that will be
implemented in perl6 (and may make it into PAST-pm) will be to
support BEGIN/CHECK/INIT/END blocks.

Thanks!

Pm

0 neue Nachrichten