A collection of example programs demonstrating the Bowie language.
bowie <file.bow>A tour of the core language: variables, functions, control flow, loops, arrays, hash maps, and closures.
bowie hello_world.bowA reusable module that exports constants and functions (PI, add, multiply, circle_area, factorial). Intended to be imported by other programs, not run directly.
Shows the three import styles Bowie supports:
| Style | Syntax |
|---|---|
| Namespace | import "math_utils.bow" as math |
| Selective | import "math_utils.bow" use multiply, factorial |
| Wildcard | import "math_utils.bow" |
bowie import_demo.bowDemonstrates JSON encoding/decoding, string manipulation (trim, upper, lower, split, replace), environment variables, and math built-ins.
bowie json_demo.bowA multi-file REST API server structured with controllers, routes, and services.
rest-api/
├── server.bow # Entry point — calls serve()
└── app/
├── index.bow # Creates the server, mounts all routes
├── controllers/ # Request handlers
├── routes/ # Route registration
└── services/ # Business logic
cd rest-api
PORT=4000 bowie server.bowThe server starts on http://127.0.0.1:4000 (override with the PORT env var).