Examples
The repository’s examples directory contains complete source programs with multi-target configurations. Run these commands from a checkout:
go run ./cmd/goalchemy run -target python ./examples/calccd examples/bankgo run ../../cmd/goalchemy buildThe first command uses the local compiler directly. The second compiles every target listed in the bank example’s goalchemy.yaml.
| Example | What to study |
|---|---|
| calc | An integer expression parser and evaluator. |
| bank | Typed errors, interfaces, and deferred audit logging. |
| wordfreq | Word counting, maps, sorting, and string operations. |
| life | Conway’s Game of Life on a toroidal board. |
| jwt | Signing and verifying HS256 JSON Web Tokens. |
| fetch | Fetching a CSV over HTTPS and summarizing it. |
| pipeline | Workers, channels, select, and per-job deadlines. |
The pipeline example requires the cooperative gate:
go run ./cmd/goalchemy run -gate cooperative -target python ./examples/pipelineHTTP and crypto examples may need native libraries or target packages. Read the generated output’s README.md and the relevant target guide before running them.