Targets
Targets Overview
Which backends exist, how target selection works, and what M2 will add.
GSET currently ships one working backend — go — and plans five plus more. The M2 milestone delivers the full set.
How the target is chosen
- The target is chosen with
-t/--to(defaultgo);--targetis accepted as an alias. - The source language is inferred from the file extension, and overridden with
-f/--from.
| Flag | Values |
|---|---|
-t, --to | go, python, js/javascript, java, ruby |
Unknown targets are rejected with a clear message. Backends that exist only in the plan produce gset: no backend for target \X`; supported: go` rather than wrong output.
Backend table
| Target | Status | run needs installed |
|---|---|---|
| Go | Implemented | go |
| Python | Implemented | python3 |
| JavaScript | Implemented | node |
| Java | Implemented | java + javac |
| Ruby | Implemented | ruby |
| C, C++, Rust, C#, PHP, Swift, Kotlin, TypeScript | Planned | — |
What "a working backend" means
gset run fib.py -t go does five things, all verified:
- Parses the Python source with a tree-sitter grammar.
- Lowers it to the typed IR and runs the semantic pass.
- Emits a complete, runnable file — wrapper and imports included.
- Writes it to a per-invocation temp directory.
- Executes the target runtime (
go run) and propagates its exit code.
gset transpile does steps 1–3 and prints the file to stdout, or saves it with -o file.
The M2 acceptance criterion
When all five backends land, generated output for every corpus case must pass the target's own syntax checker — gofmt/go vet, python -m py_compile, node --check, javac, ruby -c — gated on toolchain presence in CI.