Skip to content

Commit d4ab914

Browse files
committed
slides review
1 parent 746b958 commit d4ab914

2 files changed

Lines changed: 234 additions & 239 deletions

File tree

dev/presentations/German_Perl_Raku_Workshop_2026/slides-part1-intro.md

Lines changed: 83 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -10,106 +10,107 @@ Flavio Glock
1010

1111
---
1212

13-
## What is Perl?
13+
## The Problem
1414

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.
2025

2126
---
2227

23-
## What is PerlOnJava?
28+
## PerlOnJava: The Third Option
2429

2530
<span class="metric">A Perl compiler and runtime for the JVM</span>
2631

27-
- Compiles Perl to **native JVM bytecode** — same format as Java, Kotlin, Scala
32+
- Compiles Perl to **native JVM bytecode**
33+
- Same format as Java, Kotlin, Scala
2834
- Not an interpreter wrapping a Perl binary
2935
- Targets Perl 5.42+ semantics
30-
- Gains JVM benefits: cross-platform, Java library access, JVM tooling
3136

32-
**Targets:** Java 21+ (any JDK)
37+
**Requires:** Java 21+ (any JDK)
3338

34-
---
39+
Note:
40+
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.
3541

36-
## Historical Context
42+
---
3743

38-
**25+ years of Perl-on-JVM research:**
44+
## What You Get
3945

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)
44-
- **2024**: PerlOnJava — production-oriented compiler (active development)
46+
- 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**
4550

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.
4753

4854
---
4955

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
5163

52-
You have **50,000 lines of Perl**. Your company is moving to Java/Kubernetes.
64+
**2013–2023** — Perlito5: Perl to Java/JS compiler
5365

54-
**Without PerlOnJava:** Rewrite everything, or maintain a separate Perl runtime.
66+
**2024**PerlOnJava: lessons learned, production focus
5567

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.
6170

6271
---
6372

64-
## Key Achievements
73+
## By the Numbers
6574

6675
- <span class="metric">~260,000 tests</span> in the suite
6776
- <span class="metric">392 Java source files</span>
68-
- <span class="metric">341 bundled Perl modules</span>
6977
- <span class="metric">5,741 commits</span> since June 2024
7078
- <span class="metric">2.2× faster</span> than Perl 5 on loop benchmarks
7179

72-
**Bundled:** DBI, HTTP::Tiny, JSON, YAML, Text::CSV, Digest::MD5, MIME::Base64…
73-
74-
No formal Perl spec exists — the test suite is the de facto specification.
80+
No formal Perl spec exists — the test suite **is** the specification.
7581

7682
---
7783

78-
## Recent Milestones
84+
## Bundled Ecosystem
85+
86+
<span class="metric">341 Perl modules</span> ship inside the JAR
7987

80-
- Latest Perl `class` features (modern OOP)
81-
- Dual execution backend (JVM compiler + Internal VM)
82-
- System V IPC and socket operations
83-
- 260,000+ tests in the suite
88+
DBI, HTTP::Tiny, JSON, YAML, Text::CSV, Digest::MD5, MIME::Base64…
89+
90+
- **Pure-Perl CPAN modules** work as-is
91+
- **XS modules** use Java equivalents (many bundled)
92+
- Modern Perl `class` features (OOP)
93+
- Dual execution backend (JVM + Internal VM)
8494

8595
---
8696

8797
## Getting Started
8898

89-
**Requirements:** Java 21+ (any JDK)
90-
9199
```bash
92100
git clone https://github.com/fglock/PerlOnJava
93101
cd PerlOnJava
94102
make # Build and run tests (~5 minutes)
95103
./jperl -E 'say "Hello from PerlOnJava!"'
96104
```
97105

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.
104108

105109
---
106110

107111
## Live Demo
108112

109113
```bash
110-
# Simple hello world
111-
./jperl -E 'say "Hello from PerlOnJava!"'
112-
113114
# Conway's Game of Life
114115
./jperl examples/life.pl
115116

@@ -124,7 +125,7 @@ make # Build and run tests (~5 minutes)
124125

125126
## Live Demo: Database Integration
126127

127-
**DBI with JDBC — no C-based DBD::* adapters needed:**
128+
**DBI with JDBC — no C-based DBD adapters needed:**
128129

129130
```perl
130131
use DBI;
@@ -139,34 +140,56 @@ while (my $row = $sth->fetchrow_hashref) {
139140
}
140141
```
141142

142-
**Supports:** PostgreSQL, MySQL, Oracle, SQLite, H2, any JDBC driver
143+
Note:
144+
Supports PostgreSQL, MySQL, Oracle, SQLite, H2 — any JDBC driver.
143145

144146
---
145147

146-
## How It Works: Key Concepts
148+
## How It Works: AST
147149

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
149151

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+
```
151157

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.
153159

154160
---
155161

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.
170+
171+
---
172+
173+
## The Compilation Pipeline
157174

158175
```
159176
Perl Source → Compiler → JVM Bytecode → JVM Execution
160177
↘ Custom Bytecode → Internal VM
161178
```
162179

163-
**Five stages:** Lexer → Parser → StringParser (DSLs) → EmitterVisitor (bytecode) → ClassLoader
180+
**Five stages:** Lexer → Parser → StringParser → EmitterVisitor → ClassLoader
181+
182+
---
183+
184+
## Two Backends, One Runtime
164185

165-
**Two execution backends sharing 100% of the runtime:**
166186
- **JVM backend** — maximum performance via JIT optimization
167187
- **Internal VM** — compact, no size limits, fast `eval STRING`
168188

169-
User code doesn't know which backend is running.
189+
Both share **100% of the runtime**. User code doesn't know which backend is running.
190+
191+
Note:
192+
The dual backend is a common VM design pattern. HotSpot, V8, SpiderMonkey, and CRuby all use tiered execution for similar reasons.
170193

171194
---
172195

@@ -191,6 +214,7 @@ INVOKEVIRTUAL RuntimeBase.addToScalar(RuntimeScalar)
191214
INVOKESTATIC IOOperator.say(RuntimeList;RuntimeScalar)
192215
```
193216

217+
Note:
194218
Standard JVM bytecode — optimized by the JVM's JIT compiler at runtime.
195219

196220
---
@@ -214,7 +238,7 @@ Bytecode length: 26 shorts
214238
24: RETURN r8
215239
```
216240

217-
Register-based, ~200 opcodes. Much more compact than JVM bytecode.
241+
Register-based, ~200 opcodes — much more compact.
218242

219243
---
220244

0 commit comments

Comments
 (0)