Capabilities
Which high-level features a Program can use when it renders to Go — aimed at back-end services and command-line tools rather than rich graphical apps.
Contents
How a Program becomes Go, in parts. Start with the introduction, then follow each part into the rendered output and the runtime it links against.
- Introduction — what the Go target is, and how to read the rest of this section.
- Capabilities — which high-level features are possible, built in or through a library.
- Example — a full program using every keyword, and the Go it renders to.
- Naming considerations — how Program's dotted names are carried into Go.
- Entry point — starting a program from
mainwith its drivers. - Drivers — the native drivers that provide the interface, console and network.
- Runtime — the Reactive and Context machinery the rendered code links against.
- Native modules — the hand-written Go behind
NATIVEfunctions. - Keywords — how each of Program's keywords renders to Go.
- Project setup — the files and commands to build and run the rendered program.
- Reserved words — the words Go keeps for itself, and how a colliding name is escaped.
What Go is good for
Go targets the server and the command line. It has no native graphical toolkit, so the interface is a terminal; everything that suits a back-end — networking, concurrency, files — is built in and strong. The reactive core and the drivers are the same as any target; only the driver set differs.
| Feature | Status | How |
|---|---|---|
| User interface | Terminal | The interface driver renders Ui to a terminal. There is no built-in windowed GUI; a browser front end is better served by JavaScript. |
| Console | Built in | Console maps straight to fmt / os.Stdout. |
| Networking | Built in | Network uses net/http and gorilla/websocket or the standard library. |
| Asynchrony | Built in | A LOCKED state models an in-flight value; a driver on a goroutine completes it and re-enters the cycle. |
| Concurrency | Built in | Goroutines and channels are first-class; a driver runs its work on its own goroutine and feeds results back through the update callback. |
| Storage & files | Built in | Storage maps to the os package — full filesystem access. |
| Animation / graphics | Not native | No rendering surface on the server; time-based effects are limited to what a terminal can show. |
Where a capability needs host code it arrives as a NATIVE
Go function (needing a go body) or a driver — see
native modules and
drivers.