Quilon

A statically-typed, symbol-based language that compiles to native and should make me laugh.

Colorless concurrency on cooperative fibers — work runs when its data is ready, not where it sits in the file.

<< core.io

~ variants split by /, payloads optional
Shape = Circle(Num) / Rect(Num, Num)

~ ? and | match, and bind the payload
area = (s :: Shape) -> Num => s ?
  | Circle(r)  => 3 * r * r
  | Rect(w, h) => w * h

~ Result is just Ok / NotOk
check = (n :: Num) -> Result =>
  n <= 100 ? Ok($) : NotOk(n)

^ = () -> $ => <
  print(area(Rect(6, 7)))   ~ 42
  print(check(50) ?
    | Ok(_)    => 0
    | NotOk(c) => c)
>
<< core.io

~ |> feeds the left value in as the FIRST
~ argument of the call on its right
double  = (x :: Num) -> Num => x * 2
addFive = (x :: Num) -> Num => x + 5

^ = () -> $ => <
  ~ the same as addFive(double(10))
  print(10 |> double |> addFive)   ~ 25
>
<< core.io

~ ` holes splice any expression in, and a
~ record can override how it renders
User = {
  name :: Text,
  age :: Num,
  ` = () -> Text => "`it.name` (`it.age`)"
}

^ = () -> $ => <
  print("half is `1 / 2`")   ~ half is 0.5
  print("sum `1 + 2 + 3`")   ~ sum 6

  u = User { name = "Ada", age = 36 }
  print("hi `u`!")           ~ hi Ada (36)!
>
<< core.io

~ the binding operator IS the capture mode.
~ no capture list, no marker.
^ = () -> $ => <
  ~ := captures by reference; writes escape
  total := 0
  bump = n => <
    total := total + n
    total
  >
  print(bump(10))     ~ 10
  print(bump(20))     ~ 30

  ~ = captures by value: a frozen copy
  base = 7
  addBase = x => x + base
  print(addBase(5))   ~ 12
>
<< core.io

~ records carry methods; `it` is the instance
Counter = {
  value :: Num,

  bump = (by :: Num) -> Num => it.value + by
}

^ = () -> $ => <
  c = Counter { value = 30 }
  print(c.bump(5))   ~ 35
>

v0.9.2 “Hegemon”

The site is coming. The language is already here.