Language
Blocks

Rimu blocks

Rimu is structured as blocks similar to rimu (opens in a new tab), with some important differences.

Collections

Objects

mikey:
  name: "Mikey"
  website: "https://mikey.nz"

Keys

Keys must either be:

Unquoted Key

Unquoted keys are identifiers and must conform to regex: ^[a-zA-Z_][a-zA-Z0-9_]*$.

Quoted Key

Quoted keys can be any valid Unicode.

"🙆": "okay!"

Lists

similar_projects:
  - "JSON-e"
  - "Nickel"
  - "Jsonnet"

Scalars

Unlike rimu, scalars are expressions.

So this means Rimu is both more strict and more expressive:

Before we go into expressions in more detail, here are the basic scalars, as similar to rimu.

Null

mikey: null

Boolean

nonsense: true

Number

bottles_of_beer_on_the_wall: 99

String

cat: "Charlie"

Function

add: (a, b) => a + b

Or

add: (a, b) =>
  a + b

Multi-line values

TODO

Operations

if

apple:
  bottom:
    if 20 > 10
    then "jeans"
    else "trousers"
boots:
  if "a" == "a"
  then
    with: "fur"
  else
    without: "fur"

let

let
  add: (a, b) => a + b
  subtract: (a, b) =>
    a - b
in
  subtract
    - add(10, 20)
    - 30