Home

Awesome

Go Lua Compiler and VM

This is a Lua 5.3 VM and compiler written in Go. This is intended to allow easy embedding into Go programs, with minimal fuss and bother. It can also run in a browser by Webassembly.

This repository is forked from milochristiansen/lua, and I made some incompatible changes. So it's unlikely to be merged into the original repository.

The strftime function and string pattern matching is currently copied from yuin/gopher-lua. It may be rewritten in the future.

Usage

package main

import (
	"github.com/ofunc/lua/util"
)

func main() {
	l := util.NewState()
	util.Run(l, "main.lua")
}
local js = require 'js'
local window = js.global

window:setTimeout(function()
	window:alert('Hello world!')
end, 1000)

Please refer to the README for standard libraries.

Dependencies

Modules

Missing Stuff

The following standard functions are not available:


The following standard modules are not available:


The following modules are not implemented exactly as the Lua 5.3 specification requires:


There are a few things that are implemented exactly as the Lua 5.3 specification requires, where the reference Lua implementation does not follow the specification exactly:


The following core language features are not supported:

TODO