Stories
Slash Boxes
Comments

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Bernhard (4508)

Bernhard
  Bernhard.Schmalhofer@gmx.de

A physicist playing with bioinformatics and Parrot. Working as a freelance software engineer. Ohlo: http://www.ohloh.net/accounts/8606

Journal of Bernhard (4508)

Thursday May 01, 2008
06:32 AM

Eclectus now emits Not Quite Perl6

Eclectus is a Scheme-compiler implemented in Scheme. The compilation target is a Parrot Abstract Syntax Tree, which is being run with the help of the Parrot Compiler Toolkit.

A sideline in Eclectus is the the problem how to tell PCT about the PAST generated in Scheme. Up to now I generated PIR that built up that data structure. This involved nasty dealings with unique ids for Parrot registers.

Generating NQP is much saner. The PAST is now set up with nested PAST::Node constructors.

Even nicer would be to create a YAML representation of PAST. But PCT doesn't support this yet.

Wednesday April 02, 2008
03:05 PM

HQ9+ reimplemented with PCT

Klaas Jan's excellent "Parrot Compiler Tools" - Tutorial inspired me to go back and reimplement HQ9+ with PCT. The result is in http://svn.perl.org/viewvc/parrot/trunk/languages/hq9plus/.

As HQ9+ is not really a hard language, it all went fairly smooth. 'mk_language_shell.pl' created me a stub in 'languages/hq9plus'. Then I copied some reusable files from the old implementation in 'languages/HQ9plus'. This was fine under Linux, but caused pain for folks on case-insensitive file systems. Sorry, next time I try to think before committing!

For looking up snippets of PAST I used the old trick: write a snippet of Perl 6 and look at the PAST that Rakudo generates.

The last problem was whitespace handling. For that I only needed a simple change in the grammar. Replace all 'rule's by 'token's and sprinkle some '\s*'s.

The next thing on my agenda is for Plumhead and Eclectus. I want to switch from 'generate PIR that sets up PAST' to 'generate NQP that sets up PAST'.

Tuesday March 18, 2008
05:19 PM

Parrot 0.6.0 "P&P" released

On behalf of the Parrot team, I'm proud to announce Parrot 0.6.0 "P&P." Parrot is a virtual machine aimed at running dynamic languages. This release is a milestone release featuring the revamping of Parrot Magic Cookies.

Parrot 0.6.0 can be obtained via CPAN (soon), or follow the download instructions. For those who would like to develop on Parrot, or help develop Parrot itself, we recommend using Subversion or SVK on our source code repository to get the latest and best Parrot code.

Parrot 0.6.0 News:

- Specification
  + launched pdd18_security.pod
  + updated pdd17_pmc.pod
  + launching draft of pdd28_character_sets.pod
- Documentation
  + cleanup of IMCC documentation
- Configuration
  + add step auto::gettext
  + add step auto::crypto
- Compilers
  + PCT:
    . Fix '-e' option
    . Phase out P6Regex in favor of Perl6Regex
  + IMCC:
    '.local Array my_arr' is illegal now
- Languages
  + C99: reimplementation with PCT
  + lolcode:
    . various updates
    . add support for functions with params
    . add math functions
  + Rakudo:
    . support for 'say'
    . first cut at smart matching
    . indirect method calls
    . support for Pairs
    . added methods 'grep' and 'first'
    . implement auto{increment,decrement}
    . initial implementation of 'perl6doc'
  + Lua:
    . various updates
    . add base64 library
  + Cardinal: basic support for functions with parameters
  + Pheme: various updates
  + Ecmascript: various updates
  + Tcl: now targeting tcl 8.5.1, no more expected failures in test suite.
    (No, this doesn't mean everything's implemented. =-)
  + Eclectus: various updates
  + WMLScript: various updates
- Implementation
  + PDD17 (PMCs)
  + Add library YAML::Dumper
  + Add the MD2, MD4, MD5, RIPEMD160, SHA & SHA1 PMC, as a wrapper
     around libcrypto
- Miscellaneous
  + various bugfixes, code cleanups and coding standard fixes
  + consting
  + remove external Perl 5 modules from the Parrot distribution

Thanks to all our contributors for making this possible, and our sponsors for supporting this project.

Enjoy!

Monday February 25, 2008
04:09 PM

Techtip of the week

When being shocked that your notebook is kaputt, as it apparently gets no power, please make sure that you are using the correct power supply. There are plugs with a slightly wider inner diameter.
Sunday January 06, 2008
02:30 PM

Parrot Abstract Syntax Tree in Scheme-XML

As I'm hacking away at Eclectus, Scheme on Parrot in Scheme, I'm starting to pick some Scheme knowledge. So before implementing new features I employed my new wisdom and did some refactoring on my Scheme code.

The most nasty thing in compiler.scm was the generation of PIR while traversing the to-be-compiled s-expression. I decided to use XML Infoset as an intermediate representation, as I already have an XSLT sheet for generating a PIR representation of PAST from an XML representation of PAST. The nice thing is that the XML infoset can also be represented as a Scheme s-expression, that is SXML. The Scheme librarx SSAX-SXML can turn SXML into XML and perform XSLT operations.

For an example let's look at the Scheme form:

(fx+ (fx+ -10 11) (fx+ (fx+ 4 3) (fx+ 3 3)))
In Perl 5 this could be expressed:

say ( (-11 10) + ( (4 + 3) + (3 + 3)));
Represented as SXML this becomes: (|PAST::Stmts| (|PAST::Op| (|@| (pasttype "call") (name "say")) (|PAST::Op| (|@| (pirop "n_add")) (|PAST::Op| (|@| (pirop "n_add")) (|PAST::Val| (|@| (value -10) (returns "EclectusFixnum"))) (|PAST::Val| (|@| (value 11) (returns "EclectusFixnum")))) (|PAST::Op| (|@| (pirop "n_add")) (|PAST::Op| (|@| (pirop "n_add")) (|PAST::Val| (|@| (value 4) (returns "EclectusFixnum"))) (|PAST::Val| (|@| (value 3) (returns "EclectusFixnum")))) (|PAST::Op| (|@| (pirop "n_add")) (|PAST::Val| (|@| (value 3) (returns "EclectusFixnum"))) (|PAST::Val| (|@| (value 3) (returns "EclectusFixnum")))))))))
Sunday December 09, 2007
04:33 PM

Plumhead and Eclectus

I'm inching forward with Plumhead, PHP on Parrot, and Eclectus, Scheme on Parrot.

Both have been converted to use the shiny new Parrot Compiler Toolkit. I don't use NQP yet, but being able to use Perl6 for compiler and library implementation is sooo sweet. Kudos to Patrick Michaud.

On the Plumhead side, Jeff Horwitz did some brave hacking and added Plumhead to mod_parrot. See http://www.smashing.org/jeff/node/24

Saturday November 17, 2007
01:14 PM

Introducing Eclectus

When working on 'languages/scheme' in the Parrot repository I got estranged with using Perl5 for implementing Scheme on Parrot. It sure does the job, but I want to learn about Lisp, not about Arrays of Arrays in Perl 5.

I came across An Incremental Approach to Compiler Construction at http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf. This is a Scheme to x86 assembly compiler, implemented in Scheme. The cute thing is that the compiler construction is done in small steps. Every step constitutes a working compiler for a larger subset of Scheme. So I stared to work on Eclectus, a bootrapping Scheme to PBC compiler.

For pictures ses http://en.wikipedia.org/wiki/Eclectus

Wednesday October 31, 2007
03:09 PM

Teaching myself Scheme

In the last weeks I have been neglecting Plumhead, that is PHP on Parrot. Instead I have been concentrating on learning about Common Lisp and Scheme. Currently I'm working my way through a nice Scheme tutorial, Teach Yourself Scheme in Fixnum Days http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html. I try to make the tutorial examples work in 'languages/scheme', a Scheme on Parrot implementation from Jeff Goff.

I also got me a copy of Lisp in small pieces. But I found that it's better to know a little bit of Scheme, before starting to delve into that.

Tuesday October 02, 2007
04:25 AM

Seen on reddit: What large websites are running on

Seen on programming.reddit.com:
What nine of the world’s largest websites are running on http://royal.pingdom.com/?p=173.
Perl has a strong showing. However the selection of sites has been debated. http://programming.reddit.com/info/2vbag/comments
The data for the table was scraped from http://highscalability.com/
Sunday June 24, 2007
04:22 PM

Bitflip error

On Friday a colleague @work asked me about an error in a webapplication. There was a Perl syntax error in Sys::Hostname. As I saw no reason that anybody should mess with with Sys::Hostname, I checked the time Hostname.pm was last changed. Confusingly the last change was in 2004, apparently this was the time the server was set up. A diff with another Perl 5.8.0 installation showed a single bit change. The first space, 0x20, of Hostname.pm line 104 has turned into into a '(', 0x28. The only explanation I can imagine is that a bit has flipped in file cache.

Strange.