Your legacy code,
rewritten for today
CodeLeap transforms RPG, COBOL, Fortran, and CL source into clean, idiomatic Clojure — with complexity analysis and migration quotes built in.
See it in action
Legacy source goes in. Clean Clojure comes out. Every variable, loop, and subroutine preserved.
H F* Calculator program I DS I 7 0 PRICE I 5 0 QTY I 10 2 TOTAL C PRICE MULT QTY TOTAL C TOTAL COMP 1000 C DSPLY TOTAL C SETON LR
;; Generated by CodeLeap Transformer ;; Source: calc.rpg3 (ns calc) (def price 0) (def qty 0) (def total 0.0) (reset! total (* price qty)) ;; COMP total 1000 (println total) (System/exit 0)
IDENTIFICATION DIVISION. PROGRAM-ID. INVENTORY. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-ITEM-PRICE PIC 9(5)V99. 01 WS-QUANTITY PIC 9(4). 01 WS-TOTAL PIC 9(7)V99. 01 WS-DISCOUNT PIC 9(3)V99. PROCEDURE DIVISION. COMPUTE WS-TOTAL = WS-ITEM-PRICE * WS-QUANTITY. IF WS-TOTAL > 500 COMPUTE WS-DISCOUNT = WS-TOTAL * 0.10 END-IF. DISPLAY WS-TOTAL. STOP RUN.
;; Generated by CodeLeap Transformer ;; Source: inventory.cbl (ns inventory) (defn calculate-total [item-price quantity] (let [total (* item-price quantity) discount (if (> total 500) (* total 0.10) 0)] (println total) {:total total :discount discount}))
PROGRAM STATS IMPLICIT NONE INTEGER :: I, N REAL :: VALS(100), TOTAL, AVG N = 5 VALS = (/ 10.0, 20.0, 30.0, 40.0, 50.0 /) TOTAL = 0.0 DO I = 1, N TOTAL = TOTAL + VALS(I) END DO AVG = TOTAL / N PRINT *, 'Average:', AVG END PROGRAM STATS
;; Generated by CodeLeap Transformer ;; Source: stats.f90 (ns stats) (defn calculate-stats [] (let [vals [10.0 20.0 30.0 40.0 50.0] total (reduce + vals) avg (/ total (count vals))] (println "Average:" avg) {:total total :average avg}))
What CodeLeap does
Parse Any Legacy Source
Full-fidelity parsers for 7 legacy languages. Fixed-format column parsing, free-format RPG/LE, COBOL divisions, Fortran continuation lines — all handled.
Emit Idiomatic Clojure
Variables become defs. Subroutines become functions. Data structures become records. PERFORM loops become doseq. The output reads like Clojure, not a line-by-line transliteration.
Complexity Analysis
Every transformation includes a complexity breakdown: line counts, branching depth, procedure count, cyclomatic complexity, and a risk score for manual review areas.
Migration Quotes
Get token-based cost estimates before committing. Three tiers — literal, structural, and idiomatic — so you can match the budget to the transformation depth you need.
Embedded SQL Preserved
Embedded SQL/400 and EXEC SQL blocks are extracted and emitted as jdbc/execute! calls with proper host variable binding. Your database operations come through intact.
API-First Architecture
REST API endpoints for analyze, transform, and quote. Integrate into your CI/CD pipeline, batch-process an entire AS/400 library, or call from your own tooling.
Documentation Generation
Auto-generate readable markdown documentation describing what your legacy program does — business logic, data flow, and dependencies — before you decide to migrate.
Dependency Visualization
See call graphs, COPY/INCLUDE chains, and cross-program dependencies rendered as interactive diagrams. Know your blast radius before touching a line of code.
Bug Detection
Static analysis flags common legacy pitfalls: uninitialized variables, dead code paths, unreachable branches, and numeric overflow risks — surfaced before transformation.
Your source code stays yours
Enterprise source code is sensitive. CodeLeap is built with zero-retention architecture from the ground up.
Zero Data Retention
Source code is processed in memory and immediately discarded. Nothing is stored, logged, or cached after your transformation completes.
TLS Encryption
All data in transit is encrypted via TLS. Your code never travels over an unencrypted connection.
No Training Data
Your code is never used to train AI models. Your proprietary business logic stays proprietary.
Why Clojure?
Legacy business logic maps naturally to Clojure's functional model. Your code lands on the JVM — same enterprise ecosystem, modern language.
JVM-native
Runs on the same infrastructure your enterprise already operates. No new runtime to deploy.
Concise output
Clojure is dramatically more concise than the source languages. A 500-line RPG program typically becomes 80 lines of Clojure.
Data-oriented
Legacy programs are fundamentally about moving data through business rules. Clojure's immutable data pipelines model this naturally.
REPL-driven development
Explore and validate the transformed code interactively. Faster feedback loop than compile-deploy-test on the mainframe.
How it works
Submit your source
Send RPG, COBOL, Fortran, or CL source code via API or upload.
We parse and analyze
Full AST extraction with complexity scoring and risk flagging.
Get your Clojure
Clean, namespaced Clojure source with deps.edn project scaffold.
Review and ship
Comments mark manual review areas. Run tests, refine, deploy.
How CodeLeap compares
Most modernization paths are slow, expensive, or generic. CodeLeap is purpose-built for legacy-to-Clojure transformation.
| Manual Rewrite | IBM watsonx | Generic AI | CodeLeap | |
|---|---|---|---|---|
| Legacy parser | N/A | COBOL only | None | 7 languages, full AST |
| Output quality | Depends on team | Java (verbose) | Unpredictable | Idiomatic Clojure |
| Complexity analysis | Manual | Limited | None | Built-in with risk scoring |
| Cost | $150k+ per app | $50,000+/yr | Token-based, unknown | Free analysis, affordable quotes |
| Vendor lock-in | None | IBM infrastructure | None | None — open JVM target |
| Time to first result | Months | Weeks | Minutes (low quality) | Minutes (high quality) |
Get a Free Complexity Analysis
Send us your source and we'll deliver a full complexity breakdown — line counts, branching depth, risk scores, and a transformation quote — at no cost. No commitment required.
Request received. We will be in touch within 24 hours.
Frequently Asked Questions
What languages are supported?
RPG/LE, RPG II, RPG III, COBOL-85, Fortran 77/90, CL (Control Language), and CL/LE. Additional languages — including PL/I, MUMPS, and BASIC — are on the roadmap.
Why Clojure as the target?
Clojure runs on the JVM (same enterprise infrastructure), has excellent data processing capabilities, and its functional paradigm maps cleanly to legacy business logic. The result is concise, maintainable code that your team can extend.
Is my source code secure?
All source code is processed in memory and never stored. The API uses TLS encryption in transit and retains zero data after processing completes.
How accurate is the transformation?
CodeLeap produces a faithful structural translation — variables, control flow, procedures, data structures, and SQL operations are all preserved. The output includes comments marking areas that need manual review, like GOTO restructuring or unresolved COPY statements.
How does CodeLeap handle COPY and INCLUDE statements?
Copybooks and INCLUDE files are resolved during parsing when provided. If a referenced copy member isn't included in the submission, CodeLeap flags it in the output with a comment and preserves the data structure signature so you can wire it up manually.
What about CICS transactions and embedded DB2 SQL?
CICS EXEC commands are mapped to equivalent HTTP/REST call patterns in Clojure. Embedded SQL (EXEC SQL) blocks are extracted and emitted as jdbc/execute! calls with proper host variable binding. IMS DL/I calls are documented with suggested replacement patterns.
Can I convert an entire AS/400 library at once?
Yes. The REST API supports batch processing — submit an entire library of source members and get back a complete Clojure project with deps.edn, namespaces, and cross-program references resolved. Ideal for CI/CD integration.
What does the free complexity analysis include?
You get a full breakdown: total line count, procedure/paragraph count, cyclomatic complexity per module, branching depth, embedded SQL density, and a risk score for areas that need manual attention — plus a transformation cost estimate across three tiers.