2025-05-07 09:45:50 -05:00
2025-05-07 09:45:50 -05:00
2025-05-07 09:08:51 -05:00
2025-05-07 09:23:04 -05:00
2025-05-07 08:26:49 -05:00
2025-05-06 18:13:24 -05:00
2025-05-07 09:08:51 -05:00
2025-05-07 09:08:51 -05:00
2025-05-07 08:18:38 -05:00
2025-05-07 09:23:04 -05:00

Mako

Lightweight, efficient Lua-like scripting language with a Go backend!

the go mod is git.sharkk.net/Sharkk/Mako

Lexing & Parsing

Recursive descent + Pratt parsing. Scanner should move through tokens with virtually no allocations. Easy-to-consume AST for bytecode compilation.

VM

Stack-based VM, register-based optimizations where it makes sense for performance, and a very minimal bytecode format to preserve space.

Memory Management

Go's GC is robust and can be used for most needs; the internals can pool commonly used structures to reduce pressure.

Syntax

Lua-like, but with more minimalism and eventually some syntactic sugars.

// C style comments
/*
	C style multi line comments
*/
// No local for variable definitions; the local behavior should be implicit
x = "foo"
y = "bar"
fn add(a, b)
	return a + b
end
echo add(x, y) // Outputs: foobar
fnVar = fn(x, y, ...) /* do something */ end

if expression and expression2 then
	res = add(1, 2)
elseif otherExpression() then
	// do other stuff
else
	// final thing
end

// Table order is preserved, unlike Lua
table = {
	anything = "foo",
	123 = "arg"
}
echo table["anything"] // outputs foo
echo table.anything // outputs foo
table.rawr = "mega"
table["mega"] = "rawr"
Description
Scripting language!
Readme 196 KiB
Languages
Go 100%