Re: Executing Perl 6 code using PIR backend

2007-04-15 Thread Will Coleda


On Apr 15, 2007, at 11:36 AM, Andrew Shitov wrote:


Hi perlers,



< SNIP of Pugs stuff>



OK, trying to use parrot for executing PIR-code:

   parrot test.pir

Plenty of errors this time:

error:imcc:syntax error, unexpected DOT
in file 'h.pir' line 7
error:imcc:syntax error, unexpected DOT
in file 'h.pir' line 180
error:imcc:syntax error, unexpected DOT
in file 'h.pir' line 194
. . .

All these 'unexpected DOT' messages correspond to staments in PIR- 
source with

'new' instruction such as

   $P8 = new .PerlArray


Would anyone tell me how to deal and live with it? :-)


All of the Perl* PMC types were changed into dynamically loaded PMCs  
- they're not available at runtime without jumping through some  
hoops. (These were designed for a more perl5-ian set of requirements,  
and weren't going to be used by the perl6-on-parrot effort.);


Most of the Perl types have builtin parrot analogues, however:

PerlArray -> ResizablePMCArray
PerlHash -> Hash
PerlString -> String
PerlInt -> Integer
PerlNum -> Float
PerlUndef -> Undef
PerlEnv -> Env

PerlScalar is kind of a base class for the string/int/num types, I'm  
not sure if there's a direct analogue in core parrot.


The old perl PMC stuff is still in the parrot repository for the  
moment in languages/perl5/.


Hope this helps, though I'm out of touch enough with Pugs that I  
don't know if this is related to something in pugs-land that needs  
updating.


--
Will "Coke" Coleda
[EMAIL PROTECTED]




Executing Perl 6 code using PIR backend

2007-04-15 Thread Andrew Shitov
Hi perlers,

maybe I have missed something but I cannot run pugs with -C option.

Initial goal was to compile Perl 6 programme into bytecode and run it
(with parrot or even mod_parrot).

First step is to convert the simpliest code test.p6 which contains

   say 'Hi!';

into .pir-file, so I typed

   pugs -CPIR test.p6 > test.pir

and really received test.pir file.

What to do next? There are two ways in mind: either use pugs -B or
parrot.

When I call pugs with an option -B

   pugs -BPIR test.pir

an error occured:

***
Unexpected "'"
expecting comment, operator, statement modifier, ";" or end of input
at h.pir line 2, column 6

Looks like -BPIR is totally ignored. The same error you will get if
simply run pugs test.pir.

OK, trying to use parrot for executing PIR-code:

   parrot test.pir

Plenty of errors this time:

error:imcc:syntax error, unexpected DOT
in file 'h.pir' line 7
error:imcc:syntax error, unexpected DOT
in file 'h.pir' line 180
error:imcc:syntax error, unexpected DOT
in file 'h.pir' line 194
. . .

All these 'unexpected DOT' messages correspond to staments in PIR-source with
'new' instruction such as

   $P8 = new .PerlArray


Would anyone tell me how to deal and live with it? :-)


Pugs -v is 6.2.13 and parrot -V is 0.4.10 --without-icu on i386-linux.
   

--
Andrew Shitov
__
[EMAIL PROTECTED] | http://www.shitov.ru