Vertis is a simple toy interpreted language implemented in TypeScript/Deno. It supports variable declarations, arithmetic, mutable variables, object literals, nested objects, and null values.
- Variable declaration (
var
) - Mutable variables (
var mut
) - Arithmetic operations (
+
,-
,*
,/
,%
) - Object literals and nested objects
- Null and boolean values
- Simple REPL and file execution
- Deno (for development)
- Node.js (for running via Node)
Clone the repository:
git clone https://github.com/KCSquid/virtis.git
cd virtis
To execute a .vrt
file:
deno run -A src/virtis.ts -f main.vrt
Or start the interactive shell:
deno run -A src/virtis.ts
Below are some example Vertis programs (from main.vrt
):
// Variable declaration and arithmetic
var x = 10;
var y = 20;
var sum = x + y;
// Mutable variable
var mut counter = 0;
counter = counter + 1;
// Object literals
var point = {
x: 5,
y: 7
};
// Nested objects and referencing variables
var foo = 42;
var obj = {
a: 1,
b: foo,
nested: {
c: true
}
};
// Null values
var nothing = null;
x // { value: 10, type: "number" }
y // { value: 20, type: "number" }
sum // { value: 30, type: "number" }
counter // { value: 1, type: "number" }
point // { kind: "ObjectLiteral", properties: [ ... ] }
foo // { value: 42, type: "number" }
obj // { kind: "ObjectLiteral", properties: [ ... ] }
nothing // { type: "null", value: null }
MIT