docs · v6

Documentation

Everything you need to read, write, and run Citril.

Citril is a small, dynamically typed scripting language with an end-delimited syntax, two back ends (a tree-walking interpreter and a bytecode VM), and a C++ core designed to be embedded. New here? Start with Getting started.

Sections

Getting started Build the interpreter, run your first program, and use the REPL.
Learn Citril in 10 minutes A fast, hands-on tour from hello-world through functions, collections, and errors.
Language guide Syntax, values, operators, control flow, functions, closures, errors, and directives.
Standard library The ~75 built-in functions, grouped by topic.
Command line Every citril command and flag.
Cookbook Short, copy-pasteable recipes for common tasks with lists, maps, strings, and numbers.
Embedding Use Citril as the scripting layer in a C++ project such as a game engine.

A taste

function fizzbuzz(n)
  for i = 1, n do
    if i % 15 == 0 then
      print("FizzBuzz")
    elif i % 3 == 0 then
      print("Fizz")
    elif i % 5 == 0 then
      print("Buzz")
    else
      print("${i}")
    end
  end
end

fizzbuzz(15)