The legendary TimToady pointed me in the right direction. First, STD.pm and the scripts for using it live in the Pugs repository. I got
http://svn.pugscode.org/pugs
, though it may be possible to just get the src/perl6
directory tree, as that is the one we are interested in.Once you have that
src/perl6
directory, cd
to it. You need to make
to get it ready to use. Unfortunately, it is hardcoded to assume Perl 5.10 is available in /usr/local/bin/perl
. If, like me, you only have 5.10 installed as a local user, you will need to go through the code and replace that path with the path to your Perl 5.10. (This is a great application for a quick Perl script.) You also need to have Moose
and YAML::Syck
installed. (I should thank moritz and PerlJam for helping me with getting this directory prepped to work.)If you get that all set up and execute
make
and it doesn't return any errors, then you should have a working STD.pm
! The tryfile
command will try to parse your Perl 6 file carefully and provide sensible error messages.
You're not going to get away that easily ;-) - you also have to tell us if the output from STD.pm was actually helpful.
ReplyDeleteWell, my first try produced a beautiful error message: Obsolete use of C-style "for (;;)" loop; in Perl 6 please use "loop (;;)" instead. I already knew that, but (as I pointed out in my last post) Rakudo accepted it without complaint. (Of course, I knew that one already, so it's not particularly helpful, but it is quite impressive -- enough so to probably push me over the edge to building Perl 5.10 on my MacBook Pro.)
ReplyDeleteUnfortunately, I had to get to paying work in two senses of the word: I've spent the last five hours since getting that working paying bills and doing the quarterly tax forms.
@SF
ReplyDeleteDid u get Padre Perl 6 plugin working on your Mac?
If so, you would have found all that you have mentioned inside it along with quick fixes for that error and more. STD.pm is used to parse and highlight Perl 6 files in Padre and these nice error messages are collected in an error list pane.
P.S. When Rakudo catches up, we will be able to run STD via Rakudo. Right now, STD.pm is dependent on Perl 5.10 features namely the regex engine and state variables. I know that it is a bit slow, but it works :)
@Ahmad, I've not gotten it installed yet. But since I just installed 5.10 to get STD.pm working on my laptop, I'll probably install Padre Perl 6 very soon as well.
ReplyDelete@moritz, I should add that I've now used STD.pm to help convert this Perl 5 script to Perl 6 with great success -- though the script still has a few glitches that need to be worked out.