{"slug": "goose-lang-101-install-the-compiler-and-print-one-line", "title": "Goose Lang 101: Install the Compiler and Print One Line", "summary": "A developer walkthrough shows how to install the Goose whole-program compiler from its prebuilt release archives and run a one-line program without a package manager or go.mod. The compiler emits a single C file and can execute it in-process via TinyCC, with `goose build` requiring a separate system C compiler and `goose lsp` providing language-server features. The guide warns that the compiler shares its name with the AI-agent Goose, so users should verify `which goose` points to the compiler.", "body_md": "Part 2 of Goose lang and Flisk.sh 101. The Flisk CLI stays closed.\n\nGoose is a whole-program compiler. It writes one C file and can run that C inside its own process through TinyCC. There is no package manager step and no `go.mod`.\n\nPrebuilt compilers are on the [releases page](https://github.com/aardappel/goose/releases). Unpack one and put that directory on `PATH`. The compiler finds its standard library beside itself. Build cache goes under `~/.goose`, or `GOOSE_HOME` if you set it.\n\nOn macOS, a downloaded archive will not run until you clear quarantine on the unpacked directory:\n\n```\nxattr -dr com.apple.quarantine /path/to/unpacked-goose\n```\n\nCheck you got the language, not the agent:\n\n```\nwhich goose\ngoose 2>&1 | head -n 20\n```\n\nYou want a compiler that accepts a `.goose` file. If the help text is about LLM providers, rename or remove that binary from `PATH` and open a new shell.\n\nLinux, before the first run:\n\n```\nsudo apt-get install -y libc6-dev\n# or: sudo dnf install glibc-devel\n```\n\nmacOS:\n\n```\nxcode-select --install\n```\n\n`goose build` also needs a C compiler: gcc or clang on Linux and macOS, Visual Studio 2022 or clang on Windows. Threads cannot use the in-process TinyCC path. This part has no threads, so `goose hello.goose` is enough.\n\n```\nmkdir -p ~/src/goose-flisk-101 && cd ~/src/goose-flisk-101\n```\n\n`hello.goose`:\n\n```\nfn main() {\n    print(\"hello, goose\");\n}\n```\n\nRun it in-process. No verb, or `goose run`, does the same thing. `goose check` only typechecks.\n\n```\ngoose hello.goose\ngoose check hello.goose\n```\n\nExpected:\n\n```\nhello, goose\n```\n\n`print` takes any number of arguments, renders each, and writes one line. There is no format string.\n\n```\nfn main() {\n    print(\"answer=\", 42, \" ratio=\", 0.75, \" yes=\", 3 > 2);\n}\n```\n\nThe compiler is already called `goose`. Name the program something else or the next part will call the compiler by accident.\n\n```\ngoose build -o ./total hello.goose\n./total\n```\n\n`goose build --dry-run hello.goose` prints the C compile it would run. `goose toolchain` says which C compiler it found. Intermediates live under `~/.goose`.\n\nIf `goose build` cannot find a C compiler, stop and install one. Do not switch to the AI-agent Goose to \"fix the build.\"\n\nThe release archive includes a VS Code extension. With the compiler on `PATH`:\n\n```\ncode --install-extension vscode/goose-language.vsix\n```\n\n`goose lsp` is the language server: diagnostics, hover, go to definition, completion, rename. Skip this if you are in a hurry. The terminal loop above is the 101.\n\nIt did not listen on a port. It did not read `PORT`. It did not answer `GET /health`. Flisk cannot route a process that exits after one print. That is fine. Part 3 stays in the language. Part 4 starts a real HTTP service in a language Flisk already knows.\n\nOfficial tour, when you want the long version: `docs/tutorial.md` in the [Goose repo](https://github.com/aardappel/goose/blob/master/docs/tutorial.md), and `samples/01_tour.goose`.", "url": "https://wpnews.pro/news/goose-lang-101-install-the-compiler-and-print-one-line", "canonical_source": "https://dev.to/flisk/goose-lang-101-install-the-compiler-and-print-one-line-5e04", "published_at": "2026-10-22 21:34:41+00:00", "updated_at": "2026-10-22 21:40:48.279550+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools"], "entities": ["Goose", "TinyCC", "Visual Studio 2022", "GitHub", "VS Code"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/goose-lang-101-install-the-compiler-and-print-one-line", "markdown": "https://wpnews.pro/news/goose-lang-101-install-the-compiler-and-print-one-line.md", "text": "https://wpnews.pro/news/goose-lang-101-install-the-compiler-and-print-one-line.txt", "jsonld": "https://wpnews.pro/news/goose-lang-101-install-the-compiler-and-print-one-line.jsonld"}}