Skip to content

Quick start

Install Goalchemy first. This walkthrough uses Python 3.10+ and Node.js 22.6+ for the corresponding run commands.

Terminal window
mkdir hello && cd hello
go mod init example.com/hello
go mod edit -go=1.25
go get github.com/eugenioenko/goalchemy@latest

Create main.go:

package main
func main() {
println("Hello from Goalchemy")
}

The source runs with ordinary Go:

Terminal window
go run .
Terminal window
goalchemy check .
goalchemy run -target python .
goalchemy run -target typescript .

Each run prints Hello from Goalchemy. Go’s print and println builtins write to standard error. run compiles into a temporary directory, invokes the target runner, and removes the directory afterward. Add -keep to retain it for inspection.

Terminal window
goalchemy compile -target python -out out/python .
python3 out/python/main.py

The output includes generated source, runtime files, a README.md, line mappings, and goalchemy.manifest.json. Private generated names are readable by default. The commands and output guide explains each target’s layout.

Create goalchemy.yaml beside main.go:

schema_version: 1
packages: [.]
gate: sequential
targets:
go: {out: out/go}
typescript: {out: out/typescript}
python: {out: out/python}
Terminal window
goalchemy build

build emits all configured targets; it does not execute them. Run TypeScript with node out/typescript/main.ts, Python with python3 out/python/main.py, or Go from its output directory with go run ..

Continue with project configuration, portable source, or building an SDK.