Transform Perl/Mason enterprise codebases to modern TypeScript/React/Node.js using LLMs and deterministic parsing. Built as a proof-of-concept for the $250B+ legacy software modernization market.
Enterprises spend years and millions modernizing legacy systems. Request Tracker (RT)—a widely-used Perl/Mason ticketing system—exemplifies the challenge: declining Perl expertise, integration hurdles, and maintenance costs. This project demonstrates how generative AI can turn multi-year migrations into weeks.
Relevant to: AI Migrations (Snowflake), Code Generation (Cohere), Developer Tools (Databricks), Agent Platforms (GitLab).
Perl/Mason Code → Parser → AST → Transformer → TypeScript/React/Node.js
↓
LLM (Claude/GPT/Gemini) for complex patterns
- Analyzes RT Perl modules and Mason templates
- Transforms to production-ready TypeScript: models, controllers, routes, React components
- Validates API compatibility and business logic preservation
- Optional LLM mode for complex patterns (multi-provider, consensus mode)
# Install
npm install
# Analyze a Perl module
npx tsx src/cli.ts analyze examples/input/User.pm
# Transform to TypeScript (no LLM required)
npx tsx src/cli.ts transform examples/input/User.pm -o ./output
# With LLM for complex transformations (add API keys to .env)
cp .env.example .env # then add your keys
npx tsx src/cli.ts transform examples/input/User.pm -o ./output --llm best| Feature | Description |
|---|---|
| Multi-LLM Support | Claude, GPT-4, Gemini with consensus mode for accuracy |
| RT Pattern Recognition | Error tuples, SUPER:: calls, localization, ACL checks |
| Production Ready | Error recovery, circuit breaker, metrics, code optimization |
| Validation | Method coverage, API compatibility, behavioral checks |
Input (Perl):
sub Create {
my $self = shift;
my %args = (Name => '', EmailAddress => '', @_);
return (0, $self->loc("No name provided")) unless $args{Name};
# ... database insert
}Output (TypeScript):
async Create(args: UserCreateArgs): Promise<[boolean, string]> {
if (!args.name) return [false, this.loc("No name provided")];
// Type-safe implementation with RT semantics preserved
}src/
├── parser/ # Perl & Mason parsing
├── transformer/ # AST → TypeScript generation
├── llm/ # Multi-provider LLM orchestration
├── validator/ # Compatibility validation
├── optimization/ # Dead code elimination, memoization
└── error-recovery/ # Circuit breaker, retry, fallbacks
- Runtime: Node.js 18+, TypeScript 5
- LLMs: Anthropic Claude, OpenAI GPT-4, Google Gemini
- Output: React, Express, Prisma/Sequelize
- Transformation: ~33,600 lines/second
- Size reduction: ~38% after optimization
- Accuracy: 85%+ on real RT::User (3,309 lines)
Himanshu Tayal — hanutayal@gmail.com
Ex-AWS Principal PM (Developer Tools, GenAI), Microsoft Teams, ReRite founder. Building tools to modernize legacy software at scale.
MIT