Gwion is a musical programming language, similar to chuck.
It also provides high-level features, like templating and function pointers.
The main difference being an emphasis on performance.
This page is just a quick overview of the language.
Since block bock comments are a bad idea, only lines comments are enabled.
// this is a one line comment
int i; // this comment comments a int declaration
Gwion provides a debug print syntax, quite similar to the one in chuck.
int i; // declare an int veriable named i;
<<<i>>>; // print i's type, then i's value
// debug print can handle multiple variables
int i, j:
<<<i, j>>>; // prints i's type, i's value, then j'type, j's value
Note that it will first print the type of the value if there is only one value.
11 => int i;
// so do this to print '11'
<<<i, "">>>;
-
Primitives
- int
- float
- time
- dur
- void
- vec3
- vec4
-
Control Structures
- if/else
- while/until/do
- for
- repeat
- break/continue
- return
- switch
-
Other keywords
- class
- extends
- public
- private
- static
- fun/function
- typedef
- typeof
- template
- enum
- union
- const
- spork
-
Special values
- this
- me
- now
- true/false/maybe
- null/NULL
- pi
-
Builtin durations
- samp
- ms
- second
- minute
- hour
- day
- week
-
Builtin UGens
- dac
- adc
- blackhole