You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dev/presentations/German_Perl_Raku_Workshop_2026/slides-part1-intro.md
+83-59Lines changed: 83 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,106 +10,107 @@ Flavio Glock
10
10
11
11
---
12
12
13
-
## What is Perl?
13
+
## The Problem
14
14
15
-
- High-level language created by Larry Wall in 1987
16
-
- Text processing, sysadmin, web, databases
17
-
- Comprehensive module ecosystem (CPAN)
18
-
- "Makes easy things easy and hard things possible"
19
-
- Still widely used in enterprise, bioinformatics, finance, DevOps
15
+
Imagine **50,000 lines of Perl** — and a mandate to move to Java or Kubernetes.
16
+
17
+
**Your options today:**
18
+
- Rewrite everything in Java
19
+
- Maintain a separate Perl runtime forever
20
+
21
+
**What if there were a third option?**
22
+
23
+
Note:
24
+
This is a common scenario in enterprise environments. Many companies have large Perl codebases that work well but don't fit into modern Java-based infrastructure.
20
25
21
26
---
22
27
23
-
## What is PerlOnJava?
28
+
## PerlOnJava: The Third Option
24
29
25
30
<spanclass="metric">A Perl compiler and runtime for the JVM</span>
26
31
27
-
- Compiles Perl to **native JVM bytecode** — same format as Java, Kotlin, Scala
PerlOnJava generates real JVM bytecode — the same kind of instructions that javac produces. This means Perl code gets all the JVM benefits: cross-platform, Java library access, JVM tooling.
35
41
36
-
## Historical Context
42
+
---
37
43
38
-
**25+ years of Perl-on-JVM research:**
44
+
## What You Get
39
45
40
-
-**1997**: JPL (Java-Perl Library) — Brian Jepson
41
-
-**2001**: Bradley Kuhn's MS thesis on porting Perl to JVM
42
-
-**2002**: perljvm prototype using Perl's B compiler
43
-
-**2013–2023**: Perlito5 — Perl to Java/JavaScript compiler (same author)
- Run existing Perl scripts **unchanged** on the JVM
47
+
- Access any **JDBC database** — no C drivers needed
48
+
- Embed Perl in Java apps via **JSR-223** scripting API
49
+
- Deploy to Docker, Kubernetes — **anywhere Java runs**
45
50
46
-
Each prior attempt informed this implementation. PerlOnJava is the culmination of lessons learned.
51
+
Note:
52
+
JSR-223 is the standard Java scripting API, available since Java 6. It allows bidirectional Java ↔ Perl communication.
47
53
48
54
---
49
55
50
-
## Why Does This Matter?
56
+
## 25 Years in the Making
57
+
58
+
**1997** — JPL (Java-Perl Library)
59
+
60
+
**2001** — Bradley Kuhn's MS thesis on Perl-to-JVM
61
+
62
+
**2002** — perljvm prototype
51
63
52
-
You have **50,000 lines of Perl**. Your company is moving to Java/Kubernetes.
64
+
**2013–2023** — Perlito5: Perl to Java/JS compiler
53
65
54
-
**Without PerlOnJava:** Rewrite everything, or maintain a separate Perl runtime.
66
+
**2024** — PerlOnJava: lessons learned, production focus
55
67
56
-
**With PerlOnJava:**
57
-
- Run existing Perl scripts unchanged on the JVM
58
-
- Access any JDBC database — no C drivers needed
59
-
- Embed Perl in Java apps via the standard JSR-223 scripting API
60
-
- Deploy to Docker, Kubernetes — anywhere Java runs
68
+
Note:
69
+
Each prior attempt informed this implementation. JPL showed embedding was possible. Kuhn mapped the type system challenges. Perlito5 proved compilation works but revealed startup and eval limitations. PerlOnJava addresses all of these.
61
70
62
71
---
63
72
64
-
## Key Achievements
73
+
## By the Numbers
65
74
66
75
- <spanclass="metric">~260,000 tests</span> in the suite
-**XS modules** use Java equivalents (many bundled)
92
+
- Modern Perl `class` features (OOP)
93
+
- Dual execution backend (JVM + Internal VM)
84
94
85
95
---
86
96
87
97
## Getting Started
88
98
89
-
**Requirements:** Java 21+ (any JDK)
90
-
91
99
```bash
92
100
git clone https://github.com/fglock/PerlOnJava
93
101
cd PerlOnJava
94
102
make # Build and run tests (~5 minutes)
95
103
./jperl -E 'say "Hello from PerlOnJava!"'
96
104
```
97
105
98
-
**Add Maven dependencies (e.g. a JDBC driver):**
99
-
```bash
100
-
./Configure.pl --search mysql-connector-java
101
-
```
102
-
103
-
**Pure-Perl CPAN modules** work as-is. **XS modules** need Java equivalents (many bundled).
106
+
Note:
107
+
Add Maven dependencies with: `./Configure.pl --search mysql-connector-java`. Pure-Perl CPAN modules work as-is. XS modules need Java equivalents — many are already bundled.
104
108
105
109
---
106
110
107
111
## Live Demo
108
112
109
113
```bash
110
-
# Simple hello world
111
-
./jperl -E 'say "Hello from PerlOnJava!"'
112
-
113
114
# Conway's Game of Life
114
115
./jperl examples/life.pl
115
116
@@ -124,7 +125,7 @@ make # Build and run tests (~5 minutes)
124
125
125
126
## Live Demo: Database Integration
126
127
127
-
**DBI with JDBC — no C-based DBD::* adapters needed:**
128
+
**DBI with JDBC — no C-based DBD adapters needed:**
128
129
129
130
```perl
130
131
use DBI;
@@ -139,34 +140,56 @@ while (my $row = $sth->fetchrow_hashref) {
139
140
}
140
141
```
141
142
142
-
**Supports:** PostgreSQL, MySQL, Oracle, SQLite, H2, any JDBC driver
143
+
Note:
144
+
Supports PostgreSQL, MySQL, Oracle, SQLite, H2 — any JDBC driver.
143
145
144
146
---
145
147
146
-
## How It Works: Key Concepts
148
+
## How It Works: AST
147
149
148
-
**AST (Abstract Syntax Tree):**Tree representation of source code. `my $x = 1 + 2` becomes assignment → addition → operands. The compiler walks this tree to generate code.
150
+
**Abstract Syntax Tree**— tree representation of source code
149
151
150
-
**JVM Bytecode:** Low-level instructions for the Java Virtual Machine — same format as Java, Kotlin, Scala. The JVM's JIT compiler turns hot bytecode into native machine code at runtime.
152
+
`my $x = 1 + 2` becomes:
153
+
154
+
```
155
+
assignment → addition → operands
156
+
```
151
157
152
-
**ASM library:** A Java library for generating JVM bytecode programmatically. PerlOnJava emits bytecode directly, without going through Java source.
158
+
The compiler walks this tree to generate bytecode.
153
159
154
160
---
155
161
156
-
## How It Works: The Pipeline
162
+
## How It Works: JVM Bytecode
163
+
164
+
Low-level instructions for the Java Virtual Machine
165
+
166
+
- Same format as Java, Kotlin, Scala
167
+
- The JVM's **JIT compiler** turns hot bytecode into native machine code
168
+
169
+
PerlOnJava emits bytecode directly via the **ASM library** — no Java source intermediate step.
0 commit comments