Overview

Syntax of the Knot Language.

Knots and Bolts

The Knot Language is made up of a number of different layers.

Modules

Modules are the largest element of Knot, they can contain multiple entities such as view's or state's. Modules can export and import entities so that multiple modules can re-use or access code stored in a different module. Modules are referred to using a name that is based on their path from the source directory of your project.

Entities

Entities are declared within a module and can only be declared within a module (functions can technically be created anonymously within a closure by using lambda expressions). Entities include view and func. Each is used to define an independent, re-usable piece of an application.

Statements

Certain statements are only available directly within a module such as const to define static constants and import to import from external modules. The let statement is only available to define variables within a closure, such as a function body.

Expressions

As a functional language, we strive to make as much of the language usable as an expression so it can be easily composed. These include simple primitives like booleans and integers as well as binary operations, unary operations, closures and more!

Primitives

The most basic types you can use to describe data in your application. These include nil, boolean, integer, float, string and element.

Last updated