Hi all,
I've been curious to try out Will Braswell's RPerl compiler. I've tried to compile it on various systems using cpanm. Although on many system I have forced a successfull install, I have not been able to compile the basic example given in Will's documentation. I get errors like:
/root/perl5/perlbrew/perls/perl-5.24.1/lib/site_perl/5.24.1/RPerl/Data
+Structure/Array.cpp:42:228: error: unable to find string literal oper
+ator ‘operator"" INTEGER’
In file included from /root/perl5/perlbrew/perls/perl-5.24.1/lib/site_
+perl/5.24.1/rperltypes.h:13:0,
from /root/perl5/perlbrew/perls/perl-5.24.1/lib/site_
+perl/5.24.1/RPerl.h:10,
from /root/perl5/perlbrew/perls/perl-5.24.1/lib/site_
+perl/5.24.1/RPerl.cpp:4,
from /root/perl5/perlbrew/perls/perl-5.24.1/lib/site_
+perl/5.24.1/rperlstandalone.h:22,
from ./rperl_test2.cpp:6:
That error was when I used perl-5.24.1 built with perlbrew, and gcc-4.7.1. Should I try building RPerl with system Perl? Or do I need to upgrade some environment variable? Or maybe upgrade gcc?
By the way the code I'm trying to compile with RPerl looks like this:
#!/usr/bin/perl
# Foo Bar Arithmetic Example
# [[[ HEADER ]]]
use RPerl;
use strict;
use warnings;
our $VERSION = 0.001_000;
# [[[ CRITICS ]]]
## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCh
+eckedSyscalls) # USER DEFAULT 1: allow numeric values & print operat
+or
## no critic qw(RequireInterpolationOfMetachars) # USER DEFAULT 2: al
+low single-quoted control characters & sigils
# [[[ OPERATIONS ]]]
my integer $foo = 21 + 12;
my integer $bar = 23 * 42 * 2;
my number $baz = to_number($bar) / $foo;
print 'have $foo = ', to_string($foo), "\n";
print 'have $bar = ', to_string($bar), "\n";
print 'have $baz = ', to_string($baz), "\n";
Thanks for the help,
spintronic