Skip to content

Commit dcf213e

Browse files
committed
slides review
1 parent 4b0f138 commit dcf213e

3 files changed

Lines changed: 55 additions & 162 deletions

File tree

dev/presentations/German_Perl_Raku_Workshop_2026/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help serve open clean slides part1 part2
1+
.PHONY: help serve open clean slides part1 part2 part3
22

33
# Which slides file to present (default: original combined deck)
44
SLIDES ?= slides.md
@@ -10,6 +10,7 @@ help:
1010
@echo " make slides - Present original combined deck (slides.md)"
1111
@echo " make part1 - Present Part 1: Introduction & Demo (20 min)"
1212
@echo " make part2 - Present Part 2: Technical Deep-Dive (40 min)"
13+
@echo " make part3 - Present Part 3: Integration & Future"
1314
@echo " make serve - Present with custom file: make serve SLIDES=myfile.md"
1415
@echo " make open - Just open browser (server must be running)"
1516
@echo " make stats - Collect statistics and benchmarks for slide numbers"
@@ -27,6 +28,9 @@ part1:
2728
part2:
2829
@$(MAKE) serve SLIDES=slides-part2-technical.md
2930

31+
part3:
32+
@$(MAKE) serve SLIDES=slides-part3-integration.md
33+
3034
# Start web server and open browser (use SLIDES variable to choose deck)
3135
serve:
3236
@echo "Presenting: $(SLIDES)"

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

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ Each prior attempt informed this implementation. JPL showed embedding was possib
107107
## By the Numbers
108108

109109
- <span class="metric">~200,000 tests</span> in the suite
110-
- <span class="metric">392 Java source files</span>
111-
- <span class="metric">5,741 commits</span> since June 2024
112-
- <span class="metric">2x faster</span> than Perl 5 on loop benchmarks
110+
- <span class="metric">~400 Java source files</span>
111+
- <span class="metric">~6,000 commits</span> since June 2024
112+
- <span class="metric">JIT-optimized</span> hot paths via HotSpot
113113

114114
No formal Perl spec exists — the test suite **is** the specification.
115115

@@ -128,22 +128,6 @@ DBI, HTTP::Tiny, JSON, YAML, Text::CSV, Digest::MD5, MIME::Base64…
128128

129129
---
130130

131-
## Real-World Validation: Image::ExifTool
132-
133-
The most widely-used Perl photo metadata library — running on PerlOnJava **unmodified**.
134-
135-
- <span class="metric">239 Perl source files</span> · <span class="metric">296,000 lines of code</span>
136-
- Largest modules exceed **10,000 lines** (Nikon.pm, Sony.pm, Canon.pm)
137-
- Subroutines over **1,000 lines** (SetNewValue, WriteInfo, ExtractInfo)
138-
- <span class="metric">600 tests</span> in 113 files — **all pass**
139-
140-
**Why this matters:** Large methods exceed the JVM's 64KB bytecode limit — the compiler automatically falls back to the Internal VM. ExifTool proves PerlOnJava handles production-scale Perl reliably, not just toy examples.
141-
142-
Note:
143-
Image::ExifTool 13.44 by Phil Harvey. Modules like TagLookup.pm (13,840 LOC), Nikon.pm (12,843 LOC), and Writer.pl (5,849 LOC) stress-test every part of the compilation pipeline. The automatic dual-backend fallback is transparent — ExifTool doesn't know which backend runs each method.
144-
145-
---
146-
147131
## Getting Started
148132

149133
```bash
@@ -180,13 +164,16 @@ Add Maven dependencies with: `./Configure.pl --search mysql-connector-java`. Pur
180164
```perl
181165
use DBI;
182166
my $dbh = DBI->connect(
183-
"dbi:SQLite:dbname=test.db", "", "",
167+
"jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1",
168+
"sa", "",
184169
{ RaiseError => 1 }
185170
);
186-
my $sth = $dbh->prepare("SELECT * FROM users");
187-
$sth->execute();
171+
$dbh->do("INSERT INTO users (name, age) VALUES (?, ?)",
172+
undef, "Alice", 30);
173+
my $sth = $dbh->prepare("SELECT * FROM users WHERE age > ?");
174+
$sth->execute(20);
188175
while (my $row = $sth->fetchrow_hashref) {
189-
say "User: $row->{name}";
176+
say "$row->{name}, age $row->{age}";
190177
}
191178
```
192179

@@ -195,6 +182,22 @@ Supports PostgreSQL, MySQL, Oracle, SQLite, H2 — any JDBC driver.
195182

196183
---
197184

185+
## Live Demo: Image::ExifTool
186+
187+
The most widely-used Perl photo metadata library — running on PerlOnJava **unmodified**.
188+
189+
- <span class="metric">239 Perl source files</span> · <span class="metric">296,000 lines of code</span>
190+
- Largest modules exceed **10,000 lines** (Nikon.pm, Sony.pm, Canon.pm)
191+
- Subroutines over **1,000 lines** (SetNewValue, WriteInfo, ExtractInfo)
192+
- <span class="metric">600 tests</span> in 113 files — **all pass**
193+
194+
**Why this matters:** Large methods exceed the JVM's 64KB bytecode limit — the compiler automatically falls back to the Internal VM.
195+
196+
Note:
197+
Image::ExifTool 13.44 by Phil Harvey. Modules like TagLookup.pm (13,840 LOC), Nikon.pm (12,843 LOC), and Writer.pl (5,849 LOC) stress-test every part of the compilation pipeline. The automatic dual-backend fallback is transparent — ExifTool doesn't know which backend runs each method.
198+
199+
---
200+
198201
## How It Works: AST
199202

200203
**Abstract Syntax Tree** — tree representation of source code
@@ -292,14 +295,24 @@ Register-based, ~300 opcodes — much more compact.
292295

293296
---
294297

298+
## Key Takeaways
299+
300+
- **One JAR, zero dependencies** — drop-in Perl runtime for the JVM
301+
- **Run existing Perl unchanged** — 200,000+ tests, ExifTool passes unmodified
302+
- **Full JVM integration** — JDBC, JSR-223, Docker/Kubernetes ready
303+
- **Two backends, one runtime** — performance where it matters, flexibility where it's needed
304+
305+
---
306+
295307
## What's Next: Part 2
296308

297-
**Technical deep-dive (40 minutes):**
309+
**Technical deep-dive (40 minutes)**
298310

299311
- The compilation pipeline in detail
300312
- Why two backends — and when each one wins
301313
- JVM optimization techniques applied to Perl
302314
- Implementing complex Perl semantics on the JVM
303-
- Integration and future plans
315+
316+
**Integration and future plans**
304317

305318
---

dev/presentations/German_Perl_Raku_Workshop_2026/slides-part2-technical.md

Lines changed: 12 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -577,148 +577,24 @@ Also: globalIORefs → IO, globalFormatRefs → FORMAT. Slot access: *foo{CODE}
577577

578578
---
579579

580-
## Module Loading
580+
## Key Takeaways
581581

582-
`require` converts `Module::Name``Module/Name.pm`, searches `@INC`, caches in `%INC`.
582+
- **Dual backend** — JVM for performance, Internal VM for flexibility
583+
- **Shared runtime** — both backends use the same data structures
584+
- **JVM-friendly design** — fast/slow path splits enable JIT inlining
585+
- **Perl's complexity mapped to JVM** — closures, dynamic scoping, non-local jumps, `eval`
583586

584-
**300+ modules bundled inside the JAR:**
585-
```text
586-
%INC: 'Data/Dumper.pm' =>
587-
'file:/path/to/perlonjava.jar!/lib/Data/Dumper.pm'
588-
```
589-
590-
---
591-
592-
## XSLoader: Java Instead of C
593-
594-
- Loads **Java extensions** instead of C shared libraries
595-
- **jnr-posix** replaces XS for native POSIX calls
596-
- No C compiler needed
597-
598-
Note:
599-
Java equivalents are easier to write and maintain than C/XS. The same API surface is exposed to Perl code.
600-
601-
---
602-
603-
# Section 4: Integration & Future
604-
605-
---
606-
607-
## JSR-223: Embed Perl in Java
608-
609-
JSR-223 is the standard Java scripting API (JDK since Java 6).
610-
611-
```java
612-
ScriptEngineManager manager = new ScriptEngineManager();
613-
ScriptEngine perl = manager.getEngineByName("perl");
614-
615-
perl.put("data", myJavaObject);
616-
Object result = perl.eval("process_data($data)");
617-
```
618-
619-
**Bidirectional:** Java ↔ Perl seamlessly.
620-
621-
**Use case:** Embed legacy Perl scripts in a modern Java application without rewriting them.
587+
Perl was never designed for the JVM — but careful engineering makes it work.
622588

623589
---
624590

625-
## Future Targets
626-
627-
**Current:** Standard JVM (HotSpot)
628-
629-
1. **GraalVM** — native executables, instant startup
630-
2. **Android DEX** — Perl on mobile devices
631-
632-
The Internal VM is key — custom bytecode is portable to any JVM derivative.
633-
634-
Note:
635-
Dual backend matters beyond performance. GraalVM gives standalone executables. Android DEX converts JVM to Dalvik bytecode.
636-
637-
---
638-
639-
## Interactive Debugger
640-
641-
**Invoke with `-d` flag:** `./jperl -d script.pl`
642-
643-
| Command | Action |
644-
|---------|--------|
645-
| `n` | Step over (next line) |
646-
| `s` | Step into subroutine |
647-
| `r` | Step out (return) |
648-
| `c` | Continue to breakpoint |
649-
| `b 42` | Set breakpoint at line 42 |
650-
| `l` | List source around current line |
651-
| `T` | Stack trace |
652-
| `p $var` | Print variable value |
653-
654-
Supports `$DB::single`, `%DB::sub`, custom `DB::DB` — compatible with Perl's debugger API.
655-
656-
Note:
657-
Debugger uses Internal VM (forced with -d). DEBUG opcodes inserted at each statement. DebugHooks handles breakpoints, command parsing, and eval in current scope. PERL5DB supported for custom debuggers.
658-
659-
---
660-
661-
## Current Limitations
662-
663-
**JVM-incompatible:**
664-
- `fork` — not available on JVM
665-
- `DESTROY` — JVM uses non-deterministic GC
666-
- Threading — not yet implemented
667-
668-
**Partially implemented:**
669-
- Some regex features, taint checks
670-
671-
Note:
672-
Workarounds: jnr-posix for native access, Java threading APIs, file auto-close at exit. XS modules use Java equivalents.
673-
674-
---
675-
676-
## Roadmap
677-
678-
**Stable now:** JVM backend, Perl class features, IPC, sockets, interactive debugger
679-
680-
**In progress:** Internal VM optimization, eval STRING performance
681-
682-
**Next:** More compatible regex engine, additional debugger features
683-
684-
---
685-
686-
# Closing
687-
688-
---
689-
690-
## Perl Was Never Designed to Run on the JVM
691-
692-
We made it work anyway — and made it **fast**.
693-
694-
<span class="metric">~200,000 tests</span> · <span class="metric">392 files</span> · <span class="metric">5,741 commits</span>
695-
696-
No formal spec exists. The tests **are** the specification.
697-
698-
Note:
699-
This is test-driven development at its most extreme — tests define the language behavior.
700-
701-
---
702-
703-
## Get Involved
704-
705-
**GitHub:** github.com/fglock/PerlOnJava · **License:** Artistic 2.0
706-
707-
- **Test** your scripts and report issues
708-
- **Port** CPAN modules
709-
- **Contribute** to core development
710-
711-
---
712-
713-
## Thank You!
714-
715-
**Special thanks to:**
591+
## What's Next: Part 3
716592

717-
- **Larry Wall** — for creating Perl
718-
- **Perl test writers** — tests that define Perl's behavior
719-
- **Perl community** — for decades of innovation
720-
- **Prior pioneers** — JPL, perljvm, Perlito5
593+
**Integration, tooling, and roadmap:**
721594

722-
**Questions?** → github.com/fglock/PerlOnJava/issues
595+
- Module loading and XSLoader
596+
- JSR-223: embedding Perl in Java
597+
- Interactive debugger
598+
- Future targets and roadmap
723599

724600
---

0 commit comments

Comments
 (0)