suburbia

Premshree's (品速力) Personal Weblog

etc.

Pugs
suburbia
[info]premshree

I have one last set of pictures from Vienna that I’ll probably post a little later. (My health hasn’t been good at all, so didn’t bother.)

Moreover, I’ve been playing with Pugs lately. nothingmuch (whom I had met at OSDC Israel) gave me a commiter bit yesterday. Haven’t done anything much yet, except for writing a couple of tests. For now (sometime maybe) I’m just going to write Perl6 examples so I get a feel of the language and also figure out what’s broken and stuff (class attribute inheritance, Perl5 module imports—sort of, etc.). Will probably look into the guts of the module import bit later.

Anyway, what interested me to Pugs is that the guts are all written in Haskell—something I had an interest in and used a tad at one point. And, of course, the people are all really nice.


Building Pugs on OS X
suburbia
[info]premshree

It’s indeed not very straightforward to install Pugs on OS X. There’s some good instructions available here. Anyway, I’ll just rehash most of the things mentioned there with the current state of the art, and some additional notes. These instructions are for GHC 6.4.1, hs-plugins (the latest), parrot 0.4.2 and Pugs 6.2.11.

Install parrot

Download parrot.

sudo mv parrot-0.4.2/ /usr/local/
cd /usr/local/parrot-0.4.2/
perl Configure.pl
make
make test # optional
sudo make install

Install GHC

(You’ll need DarwinPorts for this.)

sudo port install ghc

This will take a *long* time. Took me a little more than five hours. (Optionally, you could probably download the OS X binary.)

Install darcs

darcs is a revision control system, written in Haskell, required to get hs-plugins.

sudo port install darcs

Again, you could optionally download a binary.

Install hs-plugins

darcs get http://www.cse.unsw.edu.au/~dons/code/hs-plugins
cd hs-plugins/
runhaskell Setup.lhs build
runhaskell Setup.lhs install
sudo ranlib /usr/local/lib/plugins-1.0/libHSplugins-1.0.a

Install Pugs

Download Pugs.

export PUGS_EMBED=perl5,parrot
export PARROT_PATH=/usr/local/parrot-0.4.2
perl Makefile.PL
make
sudo make install

make will take a while. Took me around two hours. The wait is worth it; however, you could optionally use make unoptimized — this will make Pugs compile faster, but will run much slower.

That should be it. Pugs should run fine now (here’s a screenshot):

$ pugs
...
^z
$ pugs -e "print 'hello, world';"
hello, world


Shalom!
suburbia
[info]premshree

My visa for Israel just came through. I’ll be speaking at OSDC::Israel::2006. 26-28 February. Larry Wall will be there, and so will Audrey Tang (of Pugs fame). Should be fun. (All this assuming I’m not terribly bogged down with work.)

I’ll maybe speak to Larry about Perl and Ruby and all that stuff if I get a chance. ;-) You Ruby guys, anything you’d like me to ask Larry?

Need to apply for my Schengen visa now, as I intend to spend the weekend in Vienna.