GSET
Getting Started

Quick Start

Transpile a Python file to Go and run it — the working path today.

This page is a task-oriented tour of the current pipeline. If you expected five targets or the retired .gset language first, see Introduction — the Rust rewrite is intentionally front-and-center about what exists today.

1. Install

Install GSET, then confirm:

gset version
gset --help

2. Create a file

Create fib.py:

def fib(n: int) -> int:
    if n < 2:
        return n
    return fib(n - 1) + fib(n - 2)

print(fib(10))

GSET currently ships one frontend (Python) and one backend (Go).

3. Transpile

See the generated Go without running it:

$ gset transpile fib.py -t go
warning: 5 expression(s) have no inferred type; backends will pick a default [gset-untyped] at fib.py:1:1
package main

import "fmt"

func fib(n int) int {
	if n < 2 {
		return n
	}
	return (fib((n - 1)) + fib((n - 2)))
}

func main() {
	fmt.Println(fib(10))
}

The gset-untyped warning is normal for annotated sources whose parameters aren't inferred yet — the Go backend still emits sensible defaults. -t/--to selects the target (default go). Save with -o:

gset transpile fib.py -t go -o fib.go

4. Run

$ gset run fib.py -t go
55

gset run transpiles, writes the generated file to a per-invocation temp directory, invokes the target runtime (go run), propagates its exit code, and cleans up. --keep keeps the generated file for inspection.

5. Where things stand

PieceStatus
Python frontend (tree-sitter)Implemented
Go backendImplemented
Python / JS / Java / Ruby backendsImplemented
JS / TS frontendImplemented

The M2 gate will require every corpus program to transpile to output that passes each target language's own syntax checker (gofmt/go vet, python -m py_compile, node --check, javac, ruby -c), gated on toolchain presence in CI.

What if something fails?

  • gset: no backend for target \python`; supported: go` — you asked for a backend that isn't implemented yet.
  • Parse / lowering error — GSET prints the offending spans before emitting anything.
  • Execution error — the target toolchain rejected the generated code, or the runtime isn't installed. Use gset transpile ... -o to inspect the generated file, or --verbose for diagnostics.

Next steps

On this page