Skip to main content

Migration Guide

Step 1: Analyze

Before transpiling, analyze your codebase:
brikc lift ./src/ -o ./analysis/
Review the liftability report for each file:
  • CORE certified (Φ_c = 1): Pure functions — will transpile perfectly
  • CONTRACT certified: Functions with I/O or side effects — will transpile with runtime adapters
  • Unliftable: Functions that can’t be represented in PCD — require manual review

Step 2: Transpile

brikc transpile ./src/ --to rust --output ./dist/

Step 3: Verify

Check the generated code:
# For Rust
cd dist && cargo build && cargo test

# For Python
cd dist && python -m pytest

# For JavaScript
cd dist && node index.js

Step 4: Iterate

For functions that didn’t transpile:
  1. Simplify the source function
  2. Extract pure logic from side effects
  3. Re-run brikc transpile

Use Cases

COBOL → Go (Banking)

brikc transpile ./mainframe/ --from cobol --to go --output ./microservices/

JavaScript → Rust (Performance)

brikc transpile ./node-api/ --to rust --output ./rust-api/

Python → JavaScript (Frontend)

brikc transpile ./backend/ --from python --to js --output ./frontend/

Any → Multiple (Cross-platform)

for target in rust js python go; do
  brikc transpile ./src/ --to $target --output ./dist/$target/
done