Skip to content

fb new hello; fb run hello

Write it like BASIC. Ship it like C.

FutureBlitz is a compiled, general-purpose language with BASIC's readability, native speed, and a standard library for real programs.

stock.fb
Import std.core

Struct Item
    Field name: String
    Field count: Int
End Struct

Local stock = [Item("apples", 12), Item("pears", 0),
               Item("plums", 7)]
For item In stock
    Local left = item.count > 0 ? "{item.count} left" : "sold out"
    Print("{item.name}: {left}")
End For

$ fb run stock.fb
apples: 12 left
pears: sold out
plums: 7 left

Readable code, compiled to machine code

Whole programs, with what they print

Each program here is complete. The site's build ran each one with fb and recorded its output.

A command-line tool @Program, Args, and File

count/main.fb
Import std.core
Import std.io
Import std.os
Import std.text

@Program(Name: "count", About: "Counts the lines and words in files.")
Struct Options
    @Positional(Help: "The files to read", Name: "file")
    Field Files: String[]
End Struct

Local options = Args.Parse<Options>()
For path In options.Files
    Try
        Local text = Try File.ReadText(path)
        Print("{text.SplitLines().Count:>4} lines {text.SplitWhitespace().Count:>5} words  {path}")
    Catch e As IOError
        PrintError("count: can't read {path}: {e.Kind}")
    End Try
End For
$ fb run -- poem.txt missing.txt
   3 lines    16 words  poem.txt
count: can't read missing.txt: NOT_FOUND

206 modules, written in FutureBlitz

The whole standard library

One command for the whole job

terminal

fb new shop # a package: project.toml and main.fb

fb run # build it and run it

fb build --release # an optimized executable

fb test # every @Test, in parallel

fb fmt # format every file

fb doc # the package's API as JSON

fb add colors # a dependency from the registry

fb publish # the package, to the registry

VS Code

The FutureBlitz extension shows errors as you type, formats on save, completes names, and debugs with breakpoints, through fb's language server.

Install it, then fb new

Windows

PowerShell
winget install FutureBlitz.FutureBlitz

winget installs fb for you alone, with its bin on your PATH.

Then
fb new hello
cd hello
fb run
Output
Hello, world!

Other ways to install, with updating, uninstalling, and checksums.