-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
Get up and running with Flow in minutes.
git clone <repo-url>
cd flow-sharp
dotnet buildCreate 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.flowdotnet run --project flow-interpreterThe REPL lets you type Flow expressions interactively and see results immediately.
Automatically re-run a script when the file changes:
dotnet run --project flow-interpreter -- --watch path/to/script.flowdotnet run --project flow-interpreter -e 'Int x = 5; (print (str x))'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.flowThis renders a simple C major arpeggio using the piano synthesizer and exports it as a WAV file.
A desktop GUI for editing and running Flow scripts is included in the repo as flow-editor:
dotnet run --project flow-editorThis is optional — everything in the language is usable from the CLI.
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.
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- Language Basics - Learn the fundamentals
- Note Streams - Write music inline
-
Loops -
for,while,break,continue -
String Interpolation -
$"..."syntax - Examples - Complete working programs