The week Anthropic's COBOL blog post vaporized $40 billion from IBM's market cap, I was debugging a PIC clause parser.
I spent the past six months building a COBOL migration tool called Easy COBOL Migrator. It's a desktop application that converts COBOL source code to C++ 17, Java 17, C# 12, Python 3, Rust and Go. Not using AI. Using a compiler.
That distinction matters, and here's why.
The COBOL migration market is broken
COBOL processes 95% of ATM transactions and runs 43% of banking systems globally. An estimated 800 billion lines are in production. The developers who maintain these systems are retiring. The average age is 59, and 92% will be gone by 2030.
The COBOL migration market is worth billions per year. But the options are polarised.
On one end you have free tools and AI-based conversion that produce inconsistent output you can't audit. On the other you have enterprise COBOL migration platforms that start at $500K and run into the millions.
Nobody is serving the developer who needs a reliable, affordable, offline COBOL migration tool that converts to Java or C++ or Python.
That's what I built.
Why a compiler for COBOL migration, not an LLM
The AI-based COBOL migration tools announced in February 2026 are impressive for analysis and documentation. For actual code conversion at scale, they have three structural problems.
Non-determinism. LLMs produce different output for the same input. When you're converting 500 COBOL files in a migration project, you need the same construct to produce the same output every time. Otherwise you can't review, diff or audit the results.
Decimal arithmetic. COBOL's PIC 9(7)V99 COMP-3 stores numbers as packed binary-coded decimal with exact precision. LLMs frequently map this to floating-point types like double or float, which introduces rounding errors that are catastrophic in financial systems. A deterministic compiler enforces correct type mapping every time. That means BigDecimal in Java, decimal in C#, decimal.Decimal in Python.
Project-level dependencies. Real COBOL codebases use COPY ... REPLACING to share data definitions across hundreds of programs. These copybooks can nest 10 levels deep with text substitutions at each level. An LLM processing files individually can't resolve these cross-file dependencies. A compiler can.
The COBOL migration pipeline
Easy COBOL Migrator uses a traditional multi-stage compiler pipeline.
The COPY Preprocessor expands COPY directives, applies REPLACING substitutions and handles nesting up to 10 levels with circular-include detection.
The Lexer tokenizes COBOL source with auto-detection of fixed-format (COBOL-85 columns) and free-format. It recognises 220+ COBOL keywords, handles column 7 indicators, continuation lines and string literals.
The Parser is a recursive descent parser that builds a complete AST. It covers 36 statement types, expression trees, conditions (relational, combined, negated, class, sign and condition-name) and hierarchical data structures with parent-child nesting from COBOL's level number system.
The Semantic Analyzer builds symbol tables, detects ambiguous names, validates PERFORM/GO TO targets, resolves level 88 condition names, type-checks arithmetic operations and validates STRING/UNSTRING/READ/WRITE targets.
The Code Generators (six of them) each produce idiomatic code for their target language. Each handles type mapping, naming conventions with reserved word collision avoidance, struct/class generation, file I/O with record packing/unpacking, and arithmetic with appropriate precision types.
Here's what the pipeline produces from a simple COBOL program:
What I learned building a COBOL migration tool
COBOL is better designed than you think. The language's verbosity is intentional. It makes programs readable by non-programmers, which matters when your codebase encodes banking regulations that business analysts need to verify. ADD MONTHLY-PREMIUM TO ACCOUNT-BALANCE GIVING NEW-BALANCE is genuinely clearer than b = a + p.
COBOL is worse designed than you'd hope. PERFORM THRU, ALTER (which dynamically changes GO TO targets at runtime) and the implicit fall-through between paragraphs create control flow that has no clean equivalent in structured programming. These aren't bugs. They're features from an era before Dijkstra's structured programming paper.
PIC clauses are a type system. They encode size, precision, sign, padding and display formatting in a single declaration. PIC S9(7)V99 COMP-3 is simultaneously a type declaration, a storage specification and a display format. Modern languages split these concerns across three or four different mechanisms.
Six languages, one AST
The key architectural decision was building the AST to be completely language-agnostic. The parser produces the same tree whether you're targeting Java or Rust. Only the code generators differ.
Adding a new target language is incremental. Roughly 3-4 weeks of work per language once the generator framework exists. The AST, semantic analysis and all COBOL parsing are shared.
Each generator handles language-specific concerns:
- C++: Namespace wrapping,
FixedString<N>template, customDecimaltype,std::fstreamwithstreamposfor REWRITE - Java: Class wrapping,
BigDecimalwithRoundingMode,BufferedReaderandRandomAccessFile - C#: Namespace plus class,
decimaltype,StreamReaderandStreamWriter - Python: Module-level with
globaldeclarations,decimal.Decimal,tell()andseek()for REWRITE - Rust: Variables in
main()with mutable references,f64/i64,BufReaderandBufWriter - Go:
package main, PascalCase exported struct fields,bufio.Scanner,float64
The numbers
- 36 COBOL statement types parsed
- 220+ COBOL keywords recognized
- 40+ intrinsic functions mapped
- 6 target languages
- 498 automated tests
- All major COBOL dialects supported (IBM Enterprise, Micro Focus, GnuCOBOL, COBOL-85/2002/2014)
- Validated against the NIST CCVS85 standard test suite
Try the COBOL migration tool
There's a free demo. Single files up to 500 lines, C++ output.
The full product costs $2,995 for a professional license (all 6 languages, perpetual) or $9,995 for enterprise (up to 5 users, CI/CD integration, project-wide reporting and more).
https://mecanik.dev/en/products/easy-cobol-migrator/
If you've got COBOL, throw it at the demo. I want to know what breaks.
I'm Norbert, a solo developer in London building tools at mecanik.dev. 20+ years of software development. This is the most technically challenging project I've shipped. Questions welcome.
