Skip to main content

Syntax Overview

Here's what Flow-Wing looks like:

print("Hello, World!")

Flow-Wing is statically typed, case-sensitive, and whitespace-insensitive — indentation is yours to choose.

Basic Structure

/; Imports
bring io

/; Types
type Point = { x: int, y: int }

/; Functions
fun greet(name: str) -> nthg {
  print("Hello, " + name)
}

/; Entry point
fun fg_main() -> int {
  greet("World")
  return 0
}

Quick Reference

ElementSyntax
Variablevar x: int = 42
Constantconst x: int = 100
Functionfun name(p: Type) -> RetType { }
Typetype Name = { field: Type }
Classclass Name { }
If/Elseif (cond) { } or if (cond) { } else { }
Whilewhile (cond) { }
Forfor (var i = 0 to 10 : 1) { }
Switchswitch val { case v: { } default: { } }
Comment (line)/; comment
Comment (block)/# comment #/
Importbring "file.fg" or bring {a, b} from mod