Padre::Plugin::Parrot - Experimental Padre plugin for Parrot


Padre-Plugin-Parrot documentation  | view source Contained in the Padre-Plugin-Parrot distribution.

Index


NAME

Top

Padre::Plugin::Parrot - Experimental Padre plugin for Parrot

SYNOPSIS

Top

This Plugin provides several features

After installation you need to enable the plugin via the Plugin Manager of Padre. Once that is done there should be a menu option Plugins/Parrot with several submenus.

About is just some short explanation

The other menu options will count the number of characters in the current document using the current Perl 5 interpreter or PASM running on top of Parrot. Later we add other implementations running on top of Parrot.

The syntax highlighting provided by this module can be enabled on a perl file-type (actually mime-type) base in the Edit/Preferences/Mime-types dialog.

INSTALLATION

Top

This whole plugin is quite experimental. So is the documentation. I hope the plugin can work with released and installed versions of Parrot as well but I have never tried that. Let me outline how I install the dependencies.

It is quite simple though it has several steps in it.

Later we'll make this more simple.

I start with Rakudo (the implementation of Perl 6 on Parrot).

Install Rakudo

 $ cd $HOME
 $ mkdir work
 $ cd work
 $ git clone git://github.com/rakudo/rakudo.git
 $ cd rakudo
 $ perl Configure.pl --gen-parrot
 $ make

Configure env variables

Configure PARROT_DIR to point to the root of parrot Configure RAKUDO_DIR to point to the directory where rakudo was checked out. (I have these in the .bashrc)

 $ export PARROT_DIR=$HOME/work/rakudo/parrot
 $ export RAKUDO_DIR=$HOME/work/rakudo




Once this is done if you run Padre now you can enable Parrot/PGE highlighting of Perl 6 files via the Edit/Preferences/Mime-types dialog.

Adding Cardinal (Ruby) highlighting

In order to support Ruby highlighting one needs to configure the CARDINAL_DIR environment variable to point to the place where the cardinal.pbc can be located.

  $ cd $HOME/work
  $ git clone git://github.com/cardinal/cardinal.git
  $ export CARDINAL_DIR=$HOME/work/cardinal         # add this also to .bashrc
  $ cd $PARROD_DIR
  $ mkdir languages
  $ cd language
  $ ln -s $CARDINAL_DIR
  $ cd cardinal
  $ perl Configure.pl
  $ make

Once this is done if you run Padre now you can enable Parrot/PGE highlighting of Ruby files via the Edit/Preferences/Mime-types dialog.

Embedding Parrot

Configure LD_LIBRARY_PATH (also in .bashrc)

 $ export LD_LIBRARY_PATH=$PARROT_DIR/blib/lib/

Build Parrot::Embed

  $ cd $PARROT_DIR/ext/Parrot-Embed/
  ./Build realclean
  perl Build.PL
  ./Build
  ./Build test

The test will give a warning like this, but will pass:

 Parrot VM: Can't stat no file here, code 2.
 error:imcc:syntax error, unexpected IDENTIFIER
	in file 'EVAL_2' line 1

Now if you run Padre and enable Padre::Plugin::Parrot it will have an embedded Parrot interpreter that can run code written in PIR. (See the Plugins/Parrot/Count Characters...) menu options.

Related Tickets in Parrot

Top

Adding more highlightings

Top

In order to add more syntax highlighters one needs to

1)

make sure the relevant language can compile to a pbc file

2)

add and entry to the @config variable.

3)

add color codes to the missing tokens in Padre::Plugin::Parrot::ColorizeTask

TODO

Top

COPYRIGHT

Top

LICENSE

Top

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.

Parrot

Top

Some text $PARROT_DIR/docs/intro.pod


Padre-Plugin-Parrot documentation  | view source Contained in the Padre-Plugin-Parrot distribution.