Minimal scripting language (.ilu) and Go interpreter . WIP
Go to file
2026-03-19 01:01:28 -07:00
cmd/ilusm privacy: neutral README examples; module ilusm (no forge user in imports) 2026-03-19 00:38:44 -07:00
examples initial import: ilusm interpreter (.ilu language) 2026-03-19 00:19:22 -07:00
internal privacy: neutral README examples; module ilusm (no forge user in imports) 2026-03-19 00:38:44 -07:00
.gitignore initial import: ilusm interpreter (.ilu language) 2026-03-19 00:19:22 -07:00
go.mod privacy: neutral README examples; module ilusm (no forge user in imports) 2026-03-19 00:38:44 -07:00
README.md ilusm: tweak readme 2026-03-19 01:01:28 -07:00

ilusm

ilusm is a small programming language built around one idea:

write less, keep it readable, make it fun.

It is meant to be fast to type, easy to remember, friendly to use, and lighter on ceremony than most other languages. A lot of normal language baggage gets cut out or merged together so code stays short without turning into total symbol soup.

This repo is the reference implementation: lexer, parser, AST, and interpreter in Go.

It is my language, still in progress. Whats here is for my own build and dev workflow — not an open call for unsolicited changes or for treating the repo like a playground.


Status

Work in progress.

Right now ilusm already has a real core:

  • variables by first assignment
  • short literals: tru, fls, nil
  • one-line and block functions
  • final-expression return
  • if cond: a | b
  • <- loops
  • lists
  • objects
  • indexing
  • dot access
  • shorthand statement calls
  • and, or, !

This is still early and the language may change while the core gets tightened.


Goals

ilusm is trying to be:

  • short
  • readable
  • fast
  • fun
  • friendly
  • low ceremony

The rule is simple:

If something can be shorter, simpler, or combined with something else without making the language worse, it probably should be.


Design vibe

A few big choices define the language:

Left out Instead
let, var, const assignment with =
func function syntax without the keyword
braces indentation blocks
semicolons newlines
else if a: b | c
for ... in ... <-
mandatory return final expression return

ilusm leans on:

  • assignment by =
  • final expression return
  • indentation blocks
  • |
  • <-
  • short builtins like prn

Examples

Variables

x = 5
msg = "hello"
ok = tru
bad = fls
n = nil

Functions

add(a, b) = a + b

sum(xs) =
    s = 0
    x <- xs: s = s + x
    s

Conditionals

prn if ok: "yes" | "no"

Loops

x <- [1, 2, 3]: prn x
i <- 0..3: prn i

Objects

cfg = {ok: tru, prt: 8080}
prn cfg.prt

Logic

ok = tru
nick = nil
cfg = {ok: tru, prt: 8080}

prn ok and "yes"
prn nick or "guest"
prn cfg.ok and cfg.prt
prn !ok
prn if !ok: "no" | "yes"

Syntax snapshot

Literals

tru
fls
nil
1
3.14
"txt"
[1, 2, 3]
{key: "ex", ok: tru}

Assignment

x = 1

Function

inc(x) = x + 1

sum(xs) =
    s = 0
    x <- xs: s = s + x
    s

Conditional

if ok: prn "yes" | prn "no"

msg = if ok: "yes" | "no"

Loop

x <- xs: prn x

Call

prn x
len xs
add(1, 2)
save()

Builtins (so far)

The builtin surface is intentionally small:

Builtin Role
prn print
len length
str string
int integer
typ type

More can come later; the goal is to keep the core and stdlib small and sharp.


Truthiness

Falsey: fls, nil, 0, "", []

Everything else is truthy.


Range behavior

0..3 is inclusive on both ends — so 0..3 means 0, 1, 2, 3.

Descending ranges also work, e.g. 3..0.


Rough edges

This is still early. Things work, but the language is not locked forever.

May still change: syntax details, parser rules, stdlib shape, runtime edge cases, what gets shortened further.

Already pretty central: tru / fls / nil, if a: b | c, <-, =, final-expression return, shorthand statement calls.


Why this exists

Most languages make you type too much for small things. ilusm is an attempt to feel lighter and more direct without becoming unreadable or a novelty language.

The goal is not to be clever for its own sake. The goal is to make coding feel easier, faster, and a little more alive.


Roadmap

Near-term ideas:

  • interpolation
  • field / index assignment
  • more stdlib
  • file running / CLI polish
  • better errors
  • more data handling
  • maybe imports later, if deserved

WIP note

This repo is active, unfinished, and still being shaped. If something looks strange, it may still be tested against the main rule:

Does this make the language simpler, faster, and better to use?

If yes, it stays. If not, it gets cut.


Build from source

Requires Go 1.22 or newer. From the repo root:

go build -o ilusm ./cmd/ilusm

CLI:

./ilusm run path/to/script.ilu   # execute
./ilusm tok path/to/script.ilu   # tokens
./ilusm ast path/to/script.ilu   # AST
./ilusm run examples/demo.ilu

Layout:

Path Role
cmd/ilusm CLI
internal/lexer tokenizer
internal/parser parser
internal/ast AST nodes
internal/runtime interpreter
examples/ sample .ilu