http://tiny.cc/luk

luk is the .luk language: a tiny indentation-based dialect that transpiles to Lua via luk.lua (~100-line module). luk.lua returns a single function: local lua_src = require("luk")(fun_src). Same Lua semantics, fewer ends, Python-style list comprehensions.

git clone http://tiny.cc/luk && cd luk
# transpile (luk.lua is a module; one-liner driver):
lua -e 'io.write(require("luk")(io.read("*a")))' < my.luk > my.lua
lua my.lua                            # run
make my.lua                           # via Makefile

For the optimizer shipped with luk (fft.luk) see fft.md.

Sections: NAME | SYNOPSIS | LANGUAGE REFERENCE | PERFORMANCE | FILES | VIM SUPPORT | SEE ALSO | LICENSE | AUTHOR

NAME

luk - .luk-to-Lua transpiler (single-file, no deps)

SYNOPSIS

lua -e 'io.write(require"luk"(io.read"*a"))' <IN.luk >OUT.lua
-- or programmatically:
--   local lua_src = require("luk")(fun_src)

LANGUAGE REFERENCE

Keywords (whole-word substitution)

fun                -> function
!                  -> return
!=                 -> ~=     (Lua's not-equal)

Local declarations

NAME := EXPR       -> local NAME = EXPR
A, B := X, Y       -> local A, B = X, Y

Compound assignment (start of line)

X += V             -> X = X + V
X -= V             -> X = X - V
X *= V             -> X = X * V
X /= V             -> X = X / V

Block openers (use ":" at EOL or before body)

if (cond):         -> if cond then
elseif (cond):     -> elseif cond then
else:              -> else
for X in Y:        -> for X in Y do
for i = a, b:      -> for i = a, b do
while cond:        -> while cond do
fun (args):        -> function(args)
NAME := fun (a):   -> local NAME = function(a)

Block bodies

List comprehensions (Python-style, inside [ ])

[EXPR for V in ITER]
[EXPR for V in ITER if COND]
[EXPR for K,V in ITER]            -- 2 loop vars -> pairs

ITER auto-wrapping inside comprehensions:

- 1 var, no "(" in ITER  -> ipairs(ITER)
- 2 vars, no "(" in ITER -> pairs(ITER)
- else passed through as-is

Misc

PERFORMANCE

Runtime, default mode (depth=4, 16 trees built):

file       rows    fft.py   fft.lua  fft.luk (transpile+run)
--------   -----   ------   ------   -----------------------
auto93     398     0.080s   0.032s   0.039s
SS-N      53663    9.18s    6.24s    6.11s

Lua 1.5x-2.5x faster than Python. Transpile overhead ~7ms (constant, negligible on any real workload).

FILES

luk.lua      .luk -> .lua transpiler (filter)
lib.luk      "battery" helpers (argmin, sum, csv, of, ...)
fft.luk      example: multi-objective regression tree
Makefile     rule:  %.lua: %.luk luk.lua

VIM SUPPORT

syntax: http://tiny.cc/timm-lua  -> etc/syntax/luk.vim
nvim init at etc/nvimluk.lua.

SEE ALSO

fft.md                   help page for the fft.lua app
http://tiny.cc/fft       Python sibling project
http://tiny.cc/optimiz   example CSVs
http://tiny.cc/konfig    shared Makefile

LICENSE

MIT. (c) 2026 Tim Menzies.

AUTHOR

Tim Menzies <timm@ieee.org>

NC State ©2026, timm, MIT License
150 words of css
designed.2.last