Basic Usage
The Lifter auto-detects the language from the file extension and outputs PCD to stdout.
Flags
| Flag | Description | Default |
|---|
--language <lang> | Override language detection (js, ts, tsx, jsx, python, rust, c, go, cobol, php, java) | Auto-detect |
--output <file> | Write output to file instead of stdout | stdout |
--format <fmt> | Output format: text (PCD source) or json (structured) | text |
--min-liftability <0.0-1.0> | Only output if liftability score meets threshold | 0.0 |
--domains | Include closure domain annotations in output | Off |
Examples
JavaScript
# Input: app.js
function add(a, b) {
return a + b;
}
console.log(add(10, 20));
# Output
PC app {
let result = MC_00.ADD8(10, 20);
let _ = MC_58.WRITE(result);
OUTPUT result;
}
Python
brikc lift script.py --output script.pcd
# Input: script.py
x = 10
y = 20
total = x + y
print(total)
# Output: script.pcd
PC script {
let x = MC_16.STORE(10);
let y = MC_16.STORE(20);
let total = MC_00.ADD8(x, y);
let _ = MC_58.WRITE(total);
OUTPUT total;
}
Rust
brikc lift lib.rs --format json
JSON output includes metadata about the lift:
{
"source": "lib.rs",
"language": "rust",
"liftability": 0.85,
"monomers_used": ["MC_00", "MC_01", "MC_08", "MC_16", "MC_58"],
"pcd": "PC lib {\n ...\n}",
"unmapped": [
{ "line": 12, "reason": "async block not supported" }
]
}
C with minimum liftability
brikc lift main.c --min-liftability 0.6
If the liftability score is below 0.6, the command exits with code 1 and no output.
brikc lift server.go --language go --output server.pcd
COBOL
brikc lift PAYROLL.cob --domains --output payroll.pcd
The --domains flag adds closure domain annotations derived from COBOL PIC clauses:
PC payroll {
domain salary: Range [0, 999999];
domain hours: Range [0, 168];
...
}
Batch lifting
Combine with standard shell tools for batch operations:
# Lift all Python files in a directory
for f in src/*.py; do
brikc lift "$f" --output "pcd/$(basename "$f" .py).pcd"
done
# Only lift files with high liftability
find . -name "*.js" -exec brikc lift {} --min-liftability 0.7 --output {}.pcd \;
The Lifter handles variable reassignment via SSA transform:
# Input: calcPrice.js
function calcPrice(base, tax, discount) {
let total = base;
total = total + tax;
total = total - discount;
return total;
}
# Output — SSA-transformed
PC calcPrice {
let total = base;
let total_1 = total + tax;
let total_2 = total_1 - discount;
OUTPUT total_2;
}
TSX / JSX Support
brikc lift App.tsx
brikc lift Component.jsx
The Lifter extracts liftable logic from TSX/JSX files, ignoring JSX markup and focusing on computational functions.
Full Roundtrip: Lift, Check, Build, Execute
# 1. Lift existing JS to PCD
brikc lift calcPrice.js -o calcPrice.pcd
# 2. Verify circuit closure
brikc check calcPrice.pcd
# ✓ Circuit closed: Φ_c = 1.000
# 3. Build to any target
brikc build calcPrice.pcd -t python -o dist/
# 4. Execute the certified output
python3 dist/calcPrice.py
This roundtrip is fully verified — the output carries the same formal guarantees as the PCD source.
The Lifter produces PCD that may need manual refinement. Always review the output and run brikc check to verify circuit closure before using in production.