# Code --- Code is encoded as UTF-8, allowed glyphs are: ```text abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 `~!@#$%^&*()-_=+{}[]\|;:'"<>,.?/ \s\t\n ``` # Comments ```text // This is a comment until the end of the line /* Comment block */ ``` # Atoms ## Number Literals ```text 12 // Decimal ``` ##### Integer ```text 0x12 // Hex 0b10 // Binary 0o75 // Octal ``` ##### Float ```text 1.2 1e6 ``` Underscores `_` can separate digits in a number ```text 100_000 1.100_000 1_ // Invalid ``` ## String Literals ```text "Asdf\n" ``` Any UTF-8 glyph is allowed between `""` ```text Ω // Invalid code "Ω" // Valid code ``` ## Variable Names Start with a lowercase letter Variables starting with `_` are treated as unused ## Type Names Start with an uppercase letter created with either \`alias or \`unique # Operators Represented as an symbol or a keyword starting with \` ```text 1 + 2 1 `add 2 ``` ## Operator Conventions ```text `operator FIRST FIRST `operator SECOND FIRST `operator (REST; ...) `operator (FIRST; REST; ...) ``` # Symbols Start with a `.` ```test .symbol ``` # Lists A list of statements between `()` separated by `;` or `\n` ```text (1; 2; 3) ``` # Definitions A list of definitions between `[]` separated by `;` or `\n` ```text Type[arg] ``` ## Destructuring Take values out of a collection ```text target [VAR_NAME.TARGET_NAME] target [VAR_NAME] // Resolves to VAR_NAME.VAR_NAME target [VAR_NAME_AT_INDEX] ``` ### Destructuring Example with Indexes ```text v : Tuple $ (1; 2; 3) v [a; b; c] `log a // I64.a $ 1 `log b // I64.b $ 2 `log c // I64.c $ 3 ``` # Actions A list of statements between `{}` separated by `;` or `\n` associated with a conditional Arguments are specified with a `[]` at the beginning of the `{}` ## Conditionals ### Loop `@` ```text @ condition { statements } @ condition {[args] statements } @.name condition { statements } @.name condition {[args] statements } ``` #### ``break` `break .name` Stops a loop ```text @.a 1 .. 5 {[x] @.b 1 .. 5 {[y] ? x = y { `break .a } } } ``` #### ``continue` `continue .name` Move loop to next iteration ### If `?` ```text ? condition { statements } ? condition { true statements } { false statements } ? { condition { statements } { default statements } } ? condition {[arg] statements } ``` ### Match `#` ```text # match { target { statements } target {[arg] statements } { default statements } } ``` ### Mutation `^` ```test ^ mutation {[arg] statements } ```