GSET
Write in any language syntax, compile to any language.
Write in any syntax. Compile to any language.
GSET (Generic Syntax Extension Tool) is a Rust transpiler built on tree-sitter. It parses real languages into a shared, typed IR and emits complete runnable source for a target backend.
- Any-language input — frontends parse Python today, with JavaScript/TypeScript next and more planned.
- Any-language output — the Go backend works today; Python, JavaScript, Java, and Ruby backends arrive with M2.
- Honest by design — backends declare a capability matrix instead of silently dropping constructs, and each milestone vehicle is the target language's own syntax checker.
The 30-second example
Write fib.py:
def fib(n: int) -> int:
if n < 2:
return n
return fib(n - 1) + fib(n - 2)
print(fib(10))Transpile it to Go:
$ gset transpile fib.py -t go -o fib.go
$ go run fib.go
55Or let gset run do both:
$ gset run fib.py -t go
55Target status
| Backend | Status |
|---|---|
| Go | Implemented |
| Python | Implemented |
| JavaScript | Implemented |
| Java | Implemented |
| Ruby | Implemented |
| C, C++, Rust, C#, … | Planned |
An Implemented / Planned legend explains what each badge means.
Why GSET?
| Benefit | |
|---|---|
| 💻 Read, debug, keep the output | Real source in the target language — no VM layer |
| ⚙️ Mechanised correctness | Corpus output must pass each target's own syntax checker |
| 🔧 Honest limits | The capability matrix turns "silently wrong output" into typed errors |
| 🚀 Fast by design | Readiness optimised: a gset invocation that only transpiles never loads an unused grammar |
Ready to try it? Start with the Quick Start.