personal monorepo
# Soul lang

## Hello World

```lua

main = () => print "Hello World"

```

## Comments

```lua

-- This is a single line comment

```

## Primitives

```lua

-- Numbers

1_000_000.00

-- Booleans

true or false

-- Strings

"Hello Rafiki"

-- Closure

add = (x,y) => x + y

id = x => x

multi = () => {
	print "one"
	print "two"
	print "three"
}

```

## Operators

```lua

-- Assignment

assign  = 1
assign += 1
assign -= 1
assign *= 1
assign /= 1
assign %= 1

-- Arithmetic

action = 1 + 1
action = 1 - 1
action = 1 * 1
action = 1 / 1
action = 1 % 1

-- Comparison

is_equal  = true == true
not_equal = true != false

less_than  = 1 < 2
less_equal = 1 <= 2

more_than  = 1 > 0
more_equal = 1 >= 1

-- Boolean

bool_and = true and true
bool_or  = true or false
bool_not = not true

```

## Blocks

```lua

-- singleline blocks

if true :: print "Hello Rafiki !"

-- multiline blocks

if true {
	print "Hello Rafiki !"
}

```

## Control flow

```lua

-- if <condition> :: <singleline statement>

if true :: print "Hello Rafiki !"

-- if <condition> { <multiline statement> }

if true {
	print "Hello Rafiki !"
}

-- if <condition> :: <singleline statement> else <singleline statement>

if x < 42 :: print "is less" else print "is more"

-- if <condition> { <multiline statement> } else { <multiline statement> }

if x < 42 {
	print "is less"
} else {
	print "is more"
}

-- if <capture> in <optional> :: <statement>

optional : number? = 42

if x in optional :: print "Number is {x}"

-- for <condition> :: <statement>

for true :: print "infinity"

-- for <initializer> ; <condition> :: <statement>

for x = 10 ; x > 0 :: x -= 1

-- for <initializer> ; <condition> ; <action> :: <statement>

for x = 10; x > 0; x -= 1 :: print "Countdown {x}\n"

-- for <capture> in <optional,array> :: <statement>

array = [ 1, 2, 3, 4, 5 ]

for x in array :: print "Number {x}\n"

```

## Feature wishlist

Primitives:
- unit
- null
- bool
- rune
- number
- string
- option
- array
- record
- variant
- closure

Control_Flow:
- if  ... else ...
- if  ... in ...
- for ... else ...
- for ... in ...
- pattern matching `match`