Learn FutureBlitz
A tour of the language in short pages. Every example on them is a whole program, built and run with fb when the site was built, with what it printed under it.
Start with installing fb, then go through the pages in order; each takes a few minutes. Coming from Blitz3D? The guide for Blitz3D users says what changed.
-
Your first program
Install fb, make a package with fb new, and run it. -
Values and types
Local, Const, and Global; the built-in types; strings and their interpolation. -
Control flow
If, For, While, Repeat, Loop, Select, and Defer, each block with its End. -
Functions
Parameters, defaults and named arguments, tuples, lambdas, and closures. -
Arrays and Maps
Dynamic arrays, Map literals, and std.collections' methods on them. -
Structs and Classes
Values and objects, constructors, Methods, Properties, and inheritance. -
Nullability
Types that can't be Null unless they say so, and the operators for the ones that can. -
Errors
Throws, Try, Catch, and Finally for what can go wrong, and panics for bugs. -
Interfaces and generics
Interfaces with default Methods, generic Functions and types, and constraints. -
Threads and coroutines
Spawn and Parallel For on every core, Async and Await on one thread, and the checks that keep them safe. -
Modules and packages
One file is one module, Public is what other files see, and project.toml makes a package.
The tutorial
After the tour, the tutorial builds three small programs, a step at a time: a game, a command-line tool, and a web service.
-
A small game
A dungeon crawl in the terminal, in three steps: fighters, the game loop, and a package of files. -
A command-line tool
A word counter with options and help, from a Struct's attributes, reading the files it's given. -
A web service
A high-score server with std.net.http's HttpServer, its routes as Methods, JSON in and out, and a client to try it.
Report an issue with this page or with FutureBlitz on GitHub.