How aardappel/goose works
Goose is a memory-safe systems programming language and compiler. Its main workflow takes source files through parsing, semantic checks and optimization, then generates C or runs programs through its bundled runtime/JIT. The repository also provides a language server, a VS Code extension and a Tree-sitter grammar. The graph reflects documented capabilities and the sampled driver/editor wiring; several compiler-phase links rely on the driver’s indexed references, while unsampled subsystem internals are left unconnected where their callers are not shown.
Main entry points: main.cpp Compiler driver · typecheck.h Type checker · codegen.h Code generator · extension.js VS Code extension
Components 26
Compiler workflow
- Compiler driver
src/main.cpp - Lexer
src/lexer.h - Parser
src/parser.h - AST model
src/ast.h
Static analysis
- Type checker
src/typecheck.h - Builtin checks
src/typecheck_builtins.h - Call checks
src/typecheck_calls.h - Expression checks
src/typecheck_exprs.h - Flow checks
src/typecheck_flow.h - Type rules
src/typecheck_types.h - Bounds analysis
src/bce.h - Optimizer
src/optimize.h
Code generation and runtime
- Code generator
src/codegen.h - Builtin emission
src/codegen_builtins.h - Type emission
src/codegen_types.h - Value emission
src/codegen_values.h - Inline runtime
src/runtime_inline.h - Runtime implementation
src/runtime/runtime_impl.h
Editor tooling
- Language server
src/lsp.h - VS Code extension
vscode/src/extension.js - Editor configuration
vscode/src/config.js - Server client
vscode/src/client.js - Diagnostics
vscode/src/diagnostics.js
Syntax tooling
- Tree-sitter grammar
tree-sitter/grammar.js - Comment scanner
tree-sitter/src/scanner.c
Other components
- Goose developer
Connections 25
- Goose developer → Compiler driver: invokes
src/main.cpp - Compiler driver → Lexer: uses
src/main.cpp - Compiler driver → Parser: uses
src/main.cpp - Parser → AST model: builds
src/parser.h - Compiler driver → Type checker: runs checks
src/main.cpp - Compiler driver → Bounds analysis: runs analysis
src/main.cpp - Compiler driver → Optimizer: optimizes
src/main.cpp - Type checker → Builtin checks: delegates to
src/typecheck_builtins.h - Type checker → Call checks: delegates to
src/typecheck_calls.h - Type checker → Expression checks: delegates to
src/typecheck_exprs.h - Type checker → Flow checks: delegates to
src/typecheck_flow.h - Type checker → Type rules: delegates to
- Compiler driver → Code generator: generates code
src/main.cpp - Code generator → Builtin emission: delegates to
- Code generator → Type emission: delegates to
- Code generator → Value emission: delegates to
- Compiler driver → Inline runtime: embeds runtime
src/main.cpp - Inline runtime → Runtime implementation: includes implementation
- Goose developer → VS Code extension: uses editor
vscode/src/extension.js - VS Code extension → Editor configuration: loads settings
vscode/src/extension.js - VS Code extension → Diagnostics: parses results
vscode/src/extension.js - VS Code extension → Server client: starts client
vscode/src/extension.js - Server client → Language server: starts server
vscode/src/client.js - Goose developer → Tree-sitter grammar: edits source
- Tree-sitter grammar → Comment scanner: uses scanner
tree-sitter/src/scanner.c