Examples
The examples are generated from runnable .gb files under docs/examples. Each page includes the example summary and source code.
Multi-file Examples
Async
CLI Tools
Data Processing
JSON Config Loader
data/json_config.gb
Loads JSON configuration with validation-friendly typed access.
Sales Report
data/sales_report.gb
Groups order rows into a simple revenue report.
Database
Language
Class Serialization
language/class_serialization.gb
`json.stringify` accepts class instances; the default
Context Managers
language/context_managers.gb
`with (...) { ... }` invokes `__enter__()` on entry and
Destructors
language/destructors.gb
`func ~ClassName()` declares an end-of-lifetime hook. The
Overloaded Functions
language/overloaded_functions.gb
Uses overloads to keep one public function name while accepting different typed inputs.
Order Service
Order Domain
order_service/src/domain.gb
Defines the domain object for the order service example.
Order Service Entrypoint
order_service/src/main.gb
Wires the order service modules together and prints a report.
Order Repository
order_service/src/repository.gb
Provides a small in-memory repository for the order service example.
Order Service
order_service/src/service.gb
Contains application logic for recording and reporting orders.