Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unit tests from "Perl 6 Now"?

14 views
Skip to first unread message

Autrijus Tang

unread,
Feb 16, 2005, 9:48:18 PM2/16/05
to sc...@illogics.org, perl6-c...@perl.org
(Resend, this time cc'ing perl6-compilers with the correct address.)

Hey Scott. I have yet to read your "Perl 6 Now!" book (a friend will
bring it to Taiwan next month), but I've just discovered the wealth
of example code that is http://perl6now.com/1590593952-1/.

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.

Thanks,
/Autrijus/

Scott Walters

unread,
Feb 17, 2005, 6:24:30 AM2/17/05
to perl6-c...@perl.org, scro...@gmail.com
Hi Autrijus,

> (Resend, this time cc'ing perl6-compilers with the correct address.)

sc...@illogics.org is having problems right now... the spammers are winning.

> Hey Scott. I have yet to read your "Perl 6 Now!" book (a friend will
> bring it to Taiwan next month), but I've just discovered the wealth
> of example code that is http://perl6now.com/1590593952-1/.

Does anyone want a copy of this book? Email me at sc...@illogics.org and
carbon copy scro...@gmail.com. I've been meaning to email certain people
individually offering, but... well, it has something to do with I more feel
like I laid an egg than wrote a book.

> 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.

However, if you want to use anything in there, the code examples are public
domain per point 7 of the readme at http://perl6now.com/1590593952-1/README.txt

There's a lot of confusion about what _Perl 6 Now_ is, so please pardon me here
for me a moment... it tries to introduce some of the ideas going into Perl 6.
The introduction is for people who haven't had exposure to basic ideas
previously. This includes people who have worked only with Perl, or who have
worked only with object-oriented and procedural languages. It uses Perl 5
modules to introduce these spiffy, alien (to traditional Perl) ideas. It
doesn't try to introduce Perl 6's syntax because _Perl 6 and Parrot Essentials_
already does this, and it does a better job than I could do. It's my hope the
two complement each other well. http://perl6now.com has the whole frontmatter
on-line (including the introduction), by the way. That better explains what
I've tried to do.

I've been following development of Pugs with some astonisment. I've
unfortunately been hellishly busy tending to neglected clients (and trying
to recruit new clients!) after writing this sucker or I'd have Pugs and Haskell
downloaded and running. 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.

Best regards,
-scott


Autrijus Tang

unread,
Feb 18, 2005, 3:14:02 AM2/18/05
to Scott Walters, perl6-c...@perl.org, scro...@gmail.com, in...@cpan.org
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 http://perl6now.com/1590593952-1/README.txt

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. :)

Thanks,
/Autrijus/

0 new messages