GSET
Targets

Python Target

Implemented backend — the closest match to dynamic semantics and the semantic round-trip anchor.

Implemented

The Python backend is implemented — gset transpile fib.py -t python currently errors with no backend for target 'python'; supported: go.

Why Python matters

Python is the semantic round-trip anchor of the rewrite. Because IR → Python → IR is structural enough to re-parse and compare, the property test that protects the whole pipeline is written in it: emit Python, re-parse it, and assert the re-parsed IR matches the original under normalisation.

What the backend will emit

For the shared subset (based on the verified Go-era backend):

ConstructImplemented output
print(...)print(...)
true / false / nullTrue / False / None
if / elif / elseif / elif / else: indentation blocks
&& / || / !and / or / not

The M2 gate

Generated Python must pass python3 -m py_compile, gated on toolchain presence in CI.

Runtime

Requires python3 on PATH to run emitted output.

On this page