Homoiconic
Expressions are structured data, so macros and syntax extensions stay concise and readable.
A tiny, homoiconic language where syntax is defined through pattern matching and control flow is continuation-based.
x := 42
double := [n] => n * 2
list := [1, 2, 3] + [4, 5]
if (#list > 5) "many" "few"
Expressions are structured data, so macros and syntax extensions stay concise and readable.
Operators and control flow are ordinary functions rather than reserved keywords.
Define a new syntax, and then immediately use it in the same file.
return is just a variable holding a continuation, making nonlocal jumps,
backtracking, coroutines, and cooperative multitasking easy.
Designed to be embedded in JavaScript applications for seamless scripting. You can use the provided FFI module, or create your own native functions.
Backolon's extensible syntax makes it perfect for building domain-specific languages, such as configuration files, while also allowing full Turing-complete functions where traditional syntax falls short.
Backolon does not discard any token, meaning you can make whitespace significant or not as you desire, or even introspect and parse the contents of comments.
Parameters can be lazy, preventing normal evaluation and allowing block bodies to be run once, not at all, or multiple times, as determined by what they're passed to.
Syntax is defined through structural patterns that match
Every lambda receives a built-in return continuation, so return,
break, and generators are ordinary values that can be passed around and stored.
import * as Backolon from "@r47onfire/backolon";
const scheduler = new Backolon.Scheduler([
Backolon.BUILTINS_MODULE,
Backolon.FFI_MODULE
], console.log);
const task = scheduler.startTask(0, "x := 1", null, Backolon.UNKNOWN_LOCATION.file);
scheduler.stepUntilSuspended();
console.log(task.result);