Skip to content

Quick Start

github-actions[bot] edited this page May 2, 2026 · 1 revision

Quick Start

Get up and running with Flow in minutes.

Prerequisites

Build

git clone <repo-url>
cd flow-sharp
dotnet build

Run a Script

Create a file called hello.flow:

use "@std"

(print "Hello, Flow!")

Int x = 5
Int y = 10
Int sum = x + y
(print $"Sum: {sum}")

Run it:

dotnet run --project flow-interpreter hello.flow

Start the REPL

dotnet run --project flow-interpreter

The REPL lets you type Flow expressions interactively and see results immediately.

Watch Mode

Automatically re-run a script when the file changes:

dotnet run --project flow-interpreter -- --watch path/to/script.flow

Evaluate an Expression

dotnet run --project flow-interpreter -e 'Int x = 5; (print (str x))'

Your First Melody

Create melody.flow:

use "@std"
use "@audio"

tempo 120 {
    timesig 4/4 {
        key Cmajor {
            section intro {
                Sequence melody = | C4 E4 G4 C5 |
            }

            Song song = [intro]
            Buffer buf = (renderSong song "piano")
            (exportWav buf "melody.wav")
            (print "Exported melody.wav!")
        }
    }
}
dotnet run --project flow-interpreter melody.flow

This renders a simple C major arpeggio using the piano synthesizer and exports it as a WAV file.

Standalone Flow Editor (Optional)

A desktop GUI for editing and running Flow scripts is included in the repo as flow-editor:

dotnet run --project flow-editor

This is optional — everything in the language is usable from the CLI.

Important: The Standard Library

Most Flow programs need to start with:

use "@std"

This imports the standard library, which provides essential functions like print, str, concat, add, sub, mul, div, list, map, filter, and many more. Without it, you only have raw language syntax.

For audio features, also import:

use "@audio"

See Standard Library for the full list of modules.

Running Tests

Flow's test suite is a collection of .flow scripts in the tests/ directory:

# Run a single test
dotnet run --project flow-interpreter tests/test_comprehensive.flow

# Run all tests
for test in tests/test_*.flow; do dotnet run --project flow-interpreter "$test"; done

See Also

Clone this wiki locally