Skip to content
FutureBlitz

    Install

    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.

    1. 01

      Your first program

      Install fb, make a package with fb new, and run it.
    2. 02

      Values and types

      Local, Const, and Global; the built-in types; strings and their interpolation.
    3. 03

      Control flow

      If, For, While, Repeat, Loop, Select, and Defer, each block with its End.
    4. 04

      Functions

      Parameters, defaults and named arguments, tuples, lambdas, and closures.
    5. 05

      Arrays and Maps

      Dynamic arrays, Map literals, and std.collections' methods on them.
    6. 06

      Structs and Classes

      Values and objects, constructors, Methods, Properties, and inheritance.
    7. 07

      Nullability

      Types that can't be Null unless they say so, and the operators for the ones that can.
    8. 08

      Errors

      Throws, Try, Catch, and Finally for what can go wrong, and panics for bugs.
    9. 09

      Interfaces and generics

      Interfaces with default Methods, generic Functions and types, and constraints.
    10. 10

      Threads and coroutines

      Spawn and Parallel For on every core, Async and Await on one thread, and the checks that keep them safe.
    11. 11

      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.

    1. Part 1

      A small game

      A dungeon crawl in the terminal, in three steps: fighters, the game loop, and a package of files.
    2. Part 2

      A command-line tool

      A word counter with options and help, from a Struct's attributes, reading the files it's given.
    3. Part 3

      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.