Code reference

Warning
Work in progress

Dialect declaration

To use the code dialect start the module file with this line:

(mod code)

Imports

To import other modules use the use keyword:

(use module-name)

You can also import multiple modules at once:

(use module-a module-b)

Static variables

Static variables are variables that belong to the global state and are independent from function calls.

The following types are supportet for static variables:

  • int: 64-bit signed integer
  • uint: 64-bit unsigned integer
  • float: 64-bit floating point number
  • str: a string of text
  • buffer: a fixed size buffer filled with a specific byte
  • int-array: an array of 64-bit signed integers
  • uint-array: an array of 64-bit unsigned integers
  • float-array: an array of 64-bit floating point numbers

Syntax

Static variables are declared at module-level like this:

(static my-variable 42)

Multiple variables can also be declared in one statement:

(static
  a "Hello world!"
  b 500
)

Buffers

Buffers have the following syntax:

{16} ; length = 16, fill-byte = 0
{-7 10} ; length = 10, fill-byte = -7

Arrays

Arrays are represented by its elements enclosed by square brackets:

[1 2 3 4 5] ; signed integers
[1u 2 3 4 5] ; unsigned integers
[1.0 2.0 3.0] ; floats