OK, I’m going to get long winded here…
Perl wasn’t my first language, but it was one of the first I learned after getting into unix sys admin. It felt natural and seemed like the distillation of unix and regex into a language. For years it was my goto.
Then I started playing with other languages - python, ruby, crystal - and really liked crystal’s built in compiler.
I inquired in a facebook perl group about a perl compiler, and someone pushed “rperl” which was said to be able to compile perl programs.
I spent hours trying to get it to build with cpan, only to find out that it doesn’t work with modern perl versions. The github repo has been untouched for years.
So I spun up a docker ct with an old perl (5.28) and tried it out.
It turns out that it won’t even begin to compile a perl program until a lot of boilerplate and compiler directives have been added. Then begins a series of attempts to compile, fixing details the rperl compiler doesn’t like.
I tried to compile a test program that counts the number of instances of each login shell in a password file. After getting into an endless loop of fixes, compile tries and errors, I gave up on that program and tried again with a “Hello world” program. That one actually compiled.
So I copied the compiled program to another machine and ran it. But it died with the complaint that it needed the old perl library that it was compiled with.
I asked the creator of rperl about it, and he said he’d be happy to look into fixing it, and to please send a $2000 retainer up front, so he could start.
At that point, I decided to move to crystal. I’ve been replacing shell and perl scripts with compiled crystal versions.
In contrast the the clunky and fragile perl compiler, you can create a standalone executable from any working crystal program with the crystal build command, and get a 10x speedup.
I’ve deployed these programs to systems that don’t have crystal installed, and they work perfectly.
That’s my story