Flávio S. Glocktag:blogs.perl.org,2009-11-03:/users/flavio_s_glock//5242017-11-24T11:25:44ZA blog about the Perl programming languageMovable Type Pro 4.38Perl5 as a first-class script engine in Java - part 2tag:blogs.perl.org,2017:/users/flavio_s_glock//524.83252017-11-24T11:20:43Z2017-11-24T11:25:44ZFlávio S. GlockPerlito5 is an implementation of the Perl5 language that runs in the Java / JVM platform.

]]>
Perl5 as a first-class script engine in Javatag:blogs.perl.org,2017:/users/flavio_s_glock//524.83232017-11-23T13:14:52Z2017-11-23T13:29:03ZPerlito5 is an implementation of the Perl5 language that runs in the Java / JVM platform. Perl scripts can now be run from inside Java applications using the standard javax.script API: // $ javac -cp .:perlito5.jar Script.java // $ java...Flávio S. GlockPerlito5 is an implementation of the Perl5 language that runs in the Java / JVM platform.

Perl scripts can now be run from inside Java applications using the standard javax.script API:

About 40 core modules have been ported to this distribution, and it passes about 23,000 tests.

]]>
Perl5 to Java compiler - symbol tables, typeglobs, and call stacktag:blogs.perl.org,2017:/users/flavio_s_glock//524.82322017-09-26T15:24:10Z2017-09-26T15:52:15ZPerlito5 is an implementation of the Perl5 language that runs in the Java / JVM platform. As part of the work for porting the core Perl modules, we had to implement better support for Perl symbol tables, typeglobs, and call...Flávio S. GlockPerlito5 is an implementation of the Perl5 language that runs in the Java / JVM platform.

As part of the work for porting the core Perl modules, we had to implement better support for Perl symbol tables, typeglobs, and call stack.

The call stack (the caller() function) now works "natively", decoding the internal Java stack trace. This means that there is no logging overhead for calling Perl subs, and no additional work needs to be done to support Perl stack traces in JVM threads.

Symbol tables (like %::) and typeglobs also work like in Perl, even if the internal data structures are actually flattened into a java HashMap. The symbol table / typeglob / filehandle emulation doesn't add any overhead for normal hash variable access.

With these changes, the core module lib/Symbol.pm now works without modifications.

]]>
Perl5 to Java compiler - first releasetag:blogs.perl.org,2017:/users/flavio_s_glock//524.80552017-05-13T16:01:50Z2017-05-14T19:36:50ZThis is the first release of the Perl5 to Java compiler. https://github.com/fglock/Perlito/releases In the github page there is a link to the "jar" file and the lib directories for JVM-specific Perl modules. The "perlito5.jar" file provides a perl-like command line:...Flávio S. Glock
This is the first release of the Perl5 to Java compiler.

In the github page there is a link to the "jar" file and the lib directories for JVM-specific Perl modules.

The "perlito5.jar" file provides a perl-like command line:

java -jar perlito5.jar -I src5/lib -e ' print "hello, World!\n" '

Note that you don't need to compile a Java file. Perlito5 now compiles the Perl code to JVM bytecode in memory and executes it. Also eval-string is executed as JVM bytecode - there is no interpreter.

Perlito5 is an implementation of the Perl5 language. It is work-in-progress. It provides an impressive coverage of Perl features, but it will not run most existing Perl programs due to platform differences.

The "--bootstrapping" flag tells the compiler that eval-string is not available. Eval-string is not yet implemented.

]]>
Android App with the Perl5 to Java compilertag:blogs.perl.org,2016:/users/flavio_s_glock//524.74692016-04-29T16:40:06Z2016-04-29T17:23:27ZWe've had another hackathon at work. Yati, Bas, Luca and I hacked on the Perlito Perl5-to-Java compiler and also a bit of Perl5-to-JavaScript. The changes are in GitHub and will be published in the next CPAN release. The latest cool...Flávio S. Glock
We've had another hackathon at work.

Yati, Bas, Luca and I hacked on the Perlito Perl5-to-Java compiler and also a bit of Perl5-to-JavaScript.

]]>
Perl5 to Java compiler - first little scripttag:blogs.perl.org,2015:/users/flavio_s_glock//524.70932015-10-16T20:05:56Z2015-10-17T12:10:34ZFor the first time, Perlito5-Java can now run an unmodified script - "rc-forest-fire" from the perl6-bench project. I've experimented running the benchmark on the several Perlito5 platforms, and on perl itself: # Perl5-in-Java - including compilation time time ( touch...Flávio S. Glock
For the first time, Perlito5-Java can now run an unmodified script - "rc-forest-fire" from the perl6-bench project.

I've experimented running the benchmark on the several Perlito5 platforms, and on perl itself:

]]>
Perl5 to Java compiler - 2nd hackathontag:blogs.perl.org,2015:/users/flavio_s_glock//524.70332015-09-08T15:48:58Z2015-09-08T16:10:52ZWe've had another hackathon at work. This time Bosko, Bruno, Frederico, Yati, and I hacked on the Perlito Perl5-to-Java compiler. We started adding unit tests - so that we can automatically extract a list of implemented features; the existing Perl...Flávio S. Glock
We've had another hackathon at work. This time Bosko, Bruno, Frederico, Yati, and I hacked on the Perlito Perl5-to-Java compiler.

We started adding unit tests - so that we can automatically extract a list of implemented features; the existing Perl tests are not properly organized "by feature".

]]>
Perlito - reviewing some older codetag:blogs.perl.org,2015:/users/flavio_s_glock//524.69852015-08-17T20:12:01Z2015-08-17T20:46:45ZToday I've finally updated the Perlito compiler ChangeLog, this covers a little more than a year of commits. The most significant update was the new Perlito5-to-Java backend, which is work-in-progress. It covers a lot of ground, but there is a...Flávio S. Glock
Today I've finally updated the Perlito compiler ChangeLog, this covers a little more than a year of commits.

The most significant update was the new Perlito5-to-Java backend, which is work-in-progress. It covers a lot of ground, but there is a lot more.

There were also some interesting new Perlito5-to-Javascript features, such as regex /e modifier, and file operators support in nodejs.

The Perl6 backends have not been updated, but things still work.

While reviewing the README-perlito6 file, I've found some interesting stuff that I haven't touched in a while - here is a piece of generated code that goes through 3 different languages:

]]>
This is a snippet generated by "make build-6py" - it is the bootstrapped Perlito6-to-Python code that compiles Perlito6-to-Lisp. The source code for this is here.

Perlito6 needs some serious update work - the Perl6 specification changed in significant ways since this code was written.

]]>
Perl5 to Java compiler is 1 month old, and we have a hackathontag:blogs.perl.org,2015:/users/flavio_s_glock//524.69472015-07-30T15:59:39Z2015-07-30T16:32:02ZWe are having a hackathon at work, and Bosko, John and I have hacked together a working Perl script that executes in a Java environment (HBase)....Flávio S. Glock
We are having a hackathon at work, and Bosko, John and I have hacked together a working Perl script that executes in a Java environment (HBase).]]>