Have you heard about RPerl?

2016-05-04 10:17:46 admin Perl Interests News 0 Comments

Let’s take it from ground zero.

What’s RPerl?

RPerl is a compiler for Perl 5. The name stands for Restricted Perl, it comes from the the fact that the compiler only uses certain parts of Perl, those that can be made to run fast. The name also stands for Revolutionary Perl, because of the level of speed it offers. It’s basically really, really fast so you can just imagine that the R stands for run, run, run.

How does it work?

Basically RPerl converts Perl, certain parts of it anyway, in order for it to handle operations faster. RPerl rewrites Perl 5 into C++ and compiles the resultant C++ source using Inline::CPP. Perl's XS tools and a standard C++ compiler convert the XS source code into machine-readable binary code. Bottom line, the Perl 5 code turns into binary code, fast binary code.

Why do I need RPerl?

RPerl is something very useful, it’s a not on a need basis, people think about this word way too much, it’s on a practical and easier for you to work basis. Perl is a great programming language with a lot of flexibility that often is traded for speed. This combined with an inherent compiling process makes Perl rather slow so having something like RPerl helps greatly in one aspect that always matters, speed.

Before carrying on:

Low magic - the parts of Perl that can be made to run faster, parts that RPerl uses

High magic - these are the most complex and flexible parts of Perl, that RPerl can’t use

RPerl handles the low magic parts of Perl, because only these can be statically compiled. Leaving the high magic parts out means leaving out that the functionalities that high magic stand for, but as RPerl doesn't use those parts anyway it’s not an issue.

Here’s a graph from i-programmer.info that shows how RPerl handles speed with the Bubble Sort algorhytm. Perl needed 15 secs to complete, compared to just 0.04 seconds for RPerl. That’s quite a difference!

repel5chart

RPerl is a great option to improve Perl’s performance when it comes to speed, an advantage that can be useful in many situations. It’s free and open source.

You can find more information about this on their website.

Leave a comment


0 Comments

Subscribe to our newsletter!

Make sure you never miss the interesting stories of Perl startups, apps and projects.