Skip to content
FutureBlitz

    Install

    The tour, 1 of 11

    Your first program

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

    FutureBlitz is one command, fb, which builds, runs, tests, formats, and documents programs. The download page has the install line for each OS. Then make a package and run it:

    fb new hello
    cd hello
    fb run

    fb new makes a folder with a project.toml and a main.fb:

    main.fb
    Import std.core
    
    Print("Hello, world!")
    Output
    Hello, world!

    A program is the top-level code of its main file, run from top to bottom: no Main Function, no class around it. Import std.core brings in Print and the rest of the basics; everything from the standard library is imported by name, std.core too.

    fb run compiles the program to a native executable in build/, then runs it. fb build only builds it, and fb build --release builds it optimized, to ship.

    One file is enough

    A .fb file outside a package is a program too: fb run game.fb builds and runs it, with the executable beside it.

    countdown.fb
    Import std.core
    
    For i = 3 To 1 Step -1
        Print("{i}...")
    End For
    Print("Go!")
    Output
    3...
    2...
    1...
    Go!

    What fb says when it can’t build

    The compiler’s errors say where the problem is and, often, what to write instead. A miscased keyword, like print or end if, gets the right spelling suggested, since keywords are PascalCase and the language is case-sensitive.

    Next: values and types.

    Next: Values and types

    Report an issue with this page or with FutureBlitz on GitHub.