Getting started, 1 of 4
Install FutureBlitz
Install fb, check that it runs, build a program with it, and set up an editor.
What you’ll build
A working FutureBlitz setup: the fb command on your system, a program it has built and run, and an
editor that understands .fb files. fb is the one command you need. It compiles, runs, tests,
formats, and documents FutureBlitz code, and it comes with the compiler, the linker, and the
standard library, so on Windows and Linux nothing else has to be installed first. On macOS, fb
also uses Apple’s Command Line Tools, for the macOS SDK it links programs with.
Install fb and check it
The download page detects your operating system and shows the recommended way to install fb on it, with the other ways below: a package manager, an install script, and downloads to install by hand. Follow one, then open a new terminal and ask fb for its version:
fb --versionIt prints one line: fb’s version, then the commit it was built from and the system it builds for, like this:
fb 1.0.0 (1a2b3c4, windows-x64)If the terminal says the command isn’t found, open a new one: installing adds fb to your PATH, and a terminal that was already open doesn’t see the change.
On macOS, install Apple’s Command Line Tools too, if they aren’t already, before you build a program:
xcode-select --installBuild a program
Make a folder, and a file in it named check.fb. Run it from that folder with
fb run check.fb, which compiles the file into a native executable and runs it:
Import std.core
Local sum = 0
For n = 1 To 100
sum += n
End For
Print("1 + 2 + ... + 100 = {sum}")1 + 2 + ... + 100 = 5050
If you see that line, the compiler, the linker, and the standard library all work.
Set up an editor
The FutureBlitz extension for Visual Studio Code is on the Visual Studio Marketplace and on Open VSX. Search for “FutureBlitz” in the Extensions view, or install it from a terminal:
code --install-extension futureblitz.futureblitzIt gives you:
- highlighting for
.fbfiles; - errors as you type, from FutureBlitz’s language server;
- formatting on save, the same as
fb fmt; - Run, Debug, and Run Tests, in the editor’s title bar.
The language server, fb-lsp, comes with fb, so any editor that supports the Language Server
Protocol can use it.
What you learned
- fb is one command that builds, runs, tests, formats, and documents code.
fb --versionshows which fb you have and the system it builds for.fb run file.fbcompiles a file into a native executable and runs it.- The VS Code extension and
fb-lspbring the compiler’s errors into your editor.
Report an issue with this page or with FutureBlitz on GitHub.