Skip to content

Repository files navigation

Forge

Advanced Code Transformation & Analysis Platform — Rust-Powered

Static Analysis · Multi-Language Parsing · LLM-Assisted Migration · 50+ Crates · 25+ Language Parsers

RustTypeScriptTurboLicenseTestsCode style: prettier

Multi-Language Parser | Code Migration SDK | Web Dashboard | VS Code Extension | LLM Integration


Overview

Forge is a powerful, Rust-based code transformation and static analysis platform designed for large-scale code migration, refactoring, and intelligence. Built with a polyglot parser architecture supporting 25+ programming languages, Forge enables automated code conversions, semantic analysis, and LLM-assisted modernization across your entire codebase.

From COBOL legacy modernization to cross-language transpilation, Forge provides the SDK, CLI, web dashboard, and IDE integration needed to understand and transform code at scale.


Features

Core Engine

  • Multi-Language Parsing — 25+ language parsers powered by Tree-sitter: Rust, Python, TypeScript, Java, Go, C++, C#, Kotlin, Swift, PHP, Ruby, Scala, COBOL, Assembly, BASIC, Pascal, Prolog, Lisp, V, and more
  • Intermediate Representation (IR) — Language-agnostic IR for cross-language transformations
  • Semantic Analysis — Deep code understanding with type inference and scope resolution
  • Verification Engine — Validate transformations with correctness guarantees
  • Incremental Processing — Only re-analyze changed code for fast iteration

Transformation & Migration

  • SDK for Custom Rules — Write migration rules in TypeScript with a fluent API
  • Pre-built Targets — Transpile to C++, Go, Java, Kotlin, Python, TypeScript, Ruby, C#, PHP, Swift, Scala, Dart, Lua, Perl, R, Julia, Haskell, Elixir, Clojure, OCaml, Fortran
  • LLM-Assisted Migration — AI-powered code generation and suggestions via forge-llm crates
  • Rule Engine — Declarative transformation rules with pattern matching
  • Code Generation — Target-native codegen with formatting and idioms

Platform & Tooling

  • Web Dashboard — Visual interface for managing migration projects, tracking progress
  • VS Code Extension — IDE integration with real-time analysis and quick fixes
  • CLI Tool — Command-line interface for CI/CD and scripting
  • Cloud Infrastructure — Kubernetes & Terraform deployment support
  • Plugin System — Extensible architecture for custom parsers and transforms
  • Analytics & Metrics — Track migration progress, code quality metrics
  • DAP Support — Debug Adapter Protocol for transformation debugging
  • LSP Server — Language Server Protocol for editor integration
  • GraphQL API — Flexible API for dashboard and integrations
  • Property Testing & Fuzzing — Robust test infrastructure

Tech Stack

CategoryTechnology
Core LanguageRust (stable)
Frontend/SDKTypeScript 5.3, React
Build SystemCargo (Rust), Turbo (TS)
TestingRust test, Vitest, Property Tests, Fuzzing
ParsingTree-sitter
Code QualityESLint, Prettier
IDE SupportLSP, DAP, VS Code Extension
DeploymentDocker, Kubernetes, Terraform
LicenseMIT

Quick Start

Prerequisites

  • Rust (stable toolchain)
  • Node.js >= 18
  • npm >= 10

Build from Source

git clone https://github.com/yethikrishna/forge.git
cd forge
# Build Rust crates
cargo build --release
# Install TypeScript dependencies
npm install
# Build all packages
npm run build

Use the SDK

import{Forge}from'@forge/sdk';constforge=newForge({source: 'java',target: 'python',});constresult=awaitforge.migrate('./legacy-codebase');console.log(`Migrated ${result.filesProcessed} files`);

CLI Usage

# Analyze a codebase
forge analyze ./src --language java
# Run a migration
forge migrate ./src --from java --to typescript --output ./migrated
# Start the dashboard
forge dashboard --port 3000

Project Structure

forge/
├── crates/ # Rust core crates (50+)
│ ├── forge-core/ # Core engine & types
│ ├── forge-ir/ # Intermediate representation
│ ├── forge-parser/ # Parser framework
│ ├── forge-transform/ # Transformation engine
│ ├── forge-semantic/ # Semantic analysis
│ ├── forge-verify/ # Verification engine
│ ├── forge-llm/ # LLM integration
│ ├── forge-llm-advanced/ # Advanced AI features
│ ├── forge-cli/ # CLI binary
│ ├── forge-codegen/ # Code generation
│ ├── forge-plugin-system/ # Plugin framework
│ ├── forge-execution/ # Execution runtime
│ ├── forge-rule-engine/ # Rule processing
│ ├── forge-analytics/ # Metrics & analytics
│ ├── forge-config/ # Configuration
│ ├── forge-security/ # Security features
│ ├── forge-auth/ # Authentication
│ ├── forge-authz/ # Authorization
│ ├── forge-billing/ # Billing
│ ├── forge-tenant/ # Multi-tenancy
│ ├── forge-collab/ # Collaboration
│ ├── forge-optimizer/ # Optimization passes
│ ├── forge-parallel/ # Parallel processing
│ ├── forge-incremental/ # Incremental analysis
│ ├── forge-batch/ # Batch processing
│ ├── forge-profiler/ # Performance profiling
│ ├── forge-metrics/ # Metrics collection
│ ├── forge-telemetry/ # Telemetry
│ ├── forge-query/ # Query engine
│ ├── forge-audit/ # Audit logging
│ ├── forge-crypto/ # Cryptography
│ ├── forge-vcs/ # Version control integration
│ ├── forge-dr/ # Disaster recovery
│ ├── forge-cloud/ # Cloud services
│ ├── forge-marketplace/ # Plugin marketplace
│ ├── forge-whitelabel/ # White-label support
│ ├── forge-ai-analysis/ # AI-powered analysis
│ ├── forge-ai-constraints/ # AI constraints
│ ├── forge-ai-context/ # AI context management
│ ├── forge-ai-pipeline/ # AI processing pipeline
│ └── forge-ai-planner/ # AI planning
├── parsers/ # Language parsers
│ ├── cobol/, cpp/, csharp/, go/, java/, kotlin/
│ ├── php/, python/, ruby/, rust/, typescript/
│ ├── scala/, swift/, v/, assembly/, basic/
│ ├── pascal/, prolog/, lisp/
├── targets/ # Target language generators
│ ├── cpp/, go/, java/, kotlin/, python/
│ ├── typescript/, ruby/, csharp/, php/, swift/
│ ├── scala/, dart/, lua/, perl/, r/, julia/
│ ├── haskell/, elixir/, clojure/, ocaml/, fortran/
├── packages/ # TypeScript packages
│ └── sdk/ # Forge TS SDK
├── cli/ # CLI implementation
├── web/ # Web dashboard
├── ide/ # VS Code extension
├── lsp/ # Language Server Protocol
├── dap/ # Debug Adapter Protocol
├── graphql/ # GraphQL API
├── api/ # REST API
├── dashboard/ # Dashboard frontend
├── sdk/ # SDK packages
├── mobile/ # Mobile support
├── infra/ # Infrastructure configs
├── k8s/ # Kubernetes manifests
├── terraform/ # Terraform configs
├── fuzz/ # Fuzz testing
├── property-tests/ # Property-based tests
├── benches/ # Benchmarks
├── examples/ # Example migrations
├── tests/ # Integration tests
├── scripts/ # Build & utility scripts
└── docs/ # Documentation

Supported Languages

Source Parsers: COBOL, C++, C#, Go, Java, Kotlin, PHP, Python, Ruby, Rust, TypeScript, Scala, Swift, V, Assembly, BASIC, Pascal, Prolog, Lisp

Target Generators: C++, Go, Java, Kotlin, Python, TypeScript, Ruby, C#, PHP, Swift, Scala, Dart, Lua, Perl, R, Julia, Haskell, Elixir, Clojure, OCaml, Fortran


Deployment

Docker

docker build -t forge .
docker run -p 3000:3000 forge

Kubernetes

cd k8s
kubectl apply -f .

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure cargo test and npm test pass
  5. Submit a pull request

License

This project is licensed under the MIT License — see the LICENSE file for details.


Forge — Transform code at scale, powered by Rust.

Get Started · Report Bug · Request Feature

About

Forge — Advanced code transformation and analysis platform. Rust-powered engine for code analysis, refactoring, and transformation pipelines.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages