develooper Front page | perl.perl6.compiler | Postings from February 2005

Re: Unit tests from "Perl 6 Now"?

Thread Previous
Autrijus Tang
February 18, 2005 00:16
Re: Unit tests from "Perl 6 Now"?
Message ID:
On Thu, Feb 17, 2005 at 03:24:30AM -0800, Scott Walters wrote:
> > Is it possible for me to include part of them into the Pugs distribution
> > as unit tests under the t/ directory, under the Perl license?  As Pugs's
> > test harness has just been checked in, your code snippets should provide
> > an excellent ground to test the interpreter with.
> Yes, but I think there might be a communication error... _Perl 6 Now:
> The Core Ideas Illustrated with Perl 5_ is full of Perl 5, not Perl 6.
> Any Perl 6 examples are trivial and only minimal effort was made to make
> sure they were current or even correct. So I'm not sure the small amounts
> of Perl 6 in there will be useful to you. 

Actually, any small amount is useful right now.  :-)

Also I think it'd be wonderful to, say, "forwardport" those perl5
examples into equivalent p6, and check for their results against
the perl5 version.

> However, if you want to use anything in there, the code examples are public 
> domain per point 7 of the readme at

Yay!  You++

> I still have an ambition to target the Perl 5 "B" VM as a backend for
> the Perl 6 language (after all, Perl 5 runs a heck of a lot of
> different places and the VM is extremely high-level) but it's clear I
> should use Pugs instead of that other grammar. Until I heard about
> Pugs I thought my detour was going to be... well, I don't want to talk
> about it, but it involved Perl6::Rules, chickens, and very confused
> shoppers.

(Cc'ing Brian "Ingy" Ingerson, who is planning to do similar things.)

I entirely agree.  There's some of my long-term plans for Pugs:

* Incrementally rewrite parts of Pugs with Perl6 (and maybe PGE),
  leaving only the evluator monad and primitives implemented in Haskell.

* Add a Perl5-compatibility mode based either one a Perl5->PugsAST
  parser, or Larry's Perl5->Perl6 translator.

* Add a bytecode compiler as Compile.hs, which takes AST just like
  the current Eval.hs does, but emits some sort of machine code.

The most straightforward thing for Compile.hs above is to emit Haskell
code, perhaps even Template Haskell code.  However, I'd be willing to
work with other people on producing Perl5VM bytecode, or even Parrot
bytecode.  As I said, the Compiler part need not be written in Haskell;
it is conceivable to write it in (pugs-interpreted) Perl6.

I have discussed some of these plans on IRC with Patrick yesterday.
I'd be happy to talk about this, should you have the time for it. :)


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