Initial Brainstorming Session
Session Notes: From RPG/400 to Zig
Date: November 29, 2025 User: Wesley
1. The Search for the “Blue Book”
Goal: Identify a specific RPG programming textbook from the user’s early career at a textile mill.
- Identified Book: Programming in RPG/400 (2nd Edition, approx. 1995)
- Author: Judy Yaeger
- Publisher: Duke Press / 29th Street Press
- Context: This was the definitive guide for the “Original Program Model” (OPM) before the industry shifted to ILE RPG.
- Action: User confirmed this was the correct book (teal/black cover) and discussed finding a used copy for nostalgia/reference.
2. Project A: The RPG Interpreter (The “Homunculus”)
Concept: A hobby project to write an interpreter for the RPG language using Zig.
- The Architecture:
- Backend: Use MariaDB/Postgres to simulate the AS/400’s “Single Level Store” and ISAM filesystem.
- The Cycle: Implement the “Logic Cycle” (implicit read/process/write loop) by mapping F-Specs to SQL cursors.
- Parsing: Use Zig’s fixed-format string slicing (e.g.,
line[6..15]) to handle the column-strict syntax of RPG/400.
- Key Insight: RPG was effectively “Proto-Spark”—a data warehouse in a box where schemas (F-specs) and transformations (The Cycle) were tightly coupled to the OS.
3. The Tool: Zig
Why Zig?
- Vs. Rust: Avoids the “Borrow Checker” complexity that frustrated the user previously.
- Vs. Java: No hidden allocations or Garbage Collection pauses. Memory is treated as a flat buffer (perfect for fixed-width text parsing).
- Key Features for this Project:
- Slices:
line[10..20]references original memory (zero-copy) rather than creating new String objects like Java. - Arenas: Use
ArenaAllocatorto dump all memory at the end of a cycle, simulating a “batch job” cleanup. - Comptime: Validate column specs at compile time.
- Slices:
Corporate “Superpower”:
- Zero-Install: Zig compiles to a single static binary. It does not require Admin Rights, Visual Studio Build Tools, or complex environment variables.
- Cross-Compilation: Can compile a Linux binary from a locked-down Windows laptop (
zig build-exe -target x86_64-linux).
4. Project B: The Pivot to “Momentum”
Observation: The RPG interpreter is a massive undertaking. To build momentum, we pivoted to smaller, finishable “weekend projects.”
The Shortlist:
- Conway’s Game of Life (Selected)
- Core Concepts: Double-buffering memory (Current Frame vs. Next Frame), 2D Array manipulation, ANSI terminal rendering.
- Why: Immediate visual feedback; teaches stack vs. heap allocation.
- Ad-Hoc CSV ETL Tool (Work Utility)
- Core Concepts: Stream processing (
stdintostdout), buffered reading, cross-compiling for Linux servers. - Why: Solves the “Python is too slow/hard to deploy” problem at work.
- Core Concepts: Stream processing (
- Factorio Blueprint Decoder
- Core Concepts: Base64 decoding, Zlib decompression, JSON parsing.
5. Next Steps
- Immediate: Implement “Game of Life” in Zig to learn the syntax and memory model.
- Work: Attempt to rewrite a slow Python utility in Zig to test the “no-admin” deployment workflow.