Is there a tool available which will convert source code in Perl to source code in C? Any platform is fine.
+6
A:
The answer is going to be pretty much "No". Perl is an extremely dynamic language. C is a language for statically-sized data types. Any translation of Perl to C will likely be pretty much "execute this subroutine call to simulate what Perl does" repeatedly. And there's little point in building such a translator, as it is unlikely to execute Perl much faster than Perl does.
Ira Baxter
2009-07-11 22:21:17
Well, Perl has fixed data types, just not that many of them. The problem is that Perl is dynamic. It may compile differently depending on any number of factors, and that may change how the compiler acts for upcoming source code.
brian d foy
2009-07-13 21:39:07
+9
A:
There is perlcc which "translates" Perl to C.
It's not really a Perl to C compiler; its output is simply a bundle of the Perl interpreter and the parsed bytecode of your program.
ephemient
2009-07-11 22:26:40
perlcc and corresponding B:: modules are maintained separately on CPAN by Reini Urban.
Alexandr Ciornii
2009-07-12 08:03:12
+16
A:
The canonical answer to this is MJD's "Why Not Translate Perl to C?".
Sinan Ünür
2009-07-11 23:21:45