Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Lua in Erlang
tag: v0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
.gitignore
Emakefile
README

README

Luerl - an implementation of Lua in Erlang

An experimental implementation of Lua 5.2 written solely in pure Erlang.

Some things which are known not to be implemented or work properly:

- label and goto

- tail-call optimisation in return

- only limited standard libraries

- proper handling of __metatable

- ...

There are some simple interface functions in luerl.erl:

- luerl:eval(String) evaluates the Lua code in String. Returns the return values of the evaluation.

- luerl:dofile(FileName) reads in and runs the Lua code in the file and returns the values of the evaluation. Equivalent to doing luerl:eval("dofile('FileName')").

and some more basic interface functions:

- luerl:ps(String) parses the string and returns a chunk code.

- luerl:init() initialises the system and returns an initial state.

- luerl:do(String, State) evaluates the chunk in String with the current state and returns the values and a new state.

- luerl:gc(State) runs the (experimental) garbage collector on a state and returns the new state.

N.B. This interface is subject to change!

Currently implemented functions in the libraries:

_G
_VERSION
assert
collectgarbage
dofile
eprint
error
getmetatable
ipairs
next
pairs
print
rawequal
rawget
rawlen
rawset
select
setmetatable
tonumber
tostring
type

math.abs
math.acos
math.asin
math.atan
math.atan2
math.ceil
math.cos
math.cosh
math.deg
math.exp
math.floor
math.log
math.max
math.min
math.pi
math.pow
math.rad
math.sin
math.sinh
math.sqrt
math.tan
math.tanh

os.difftime
os.getenv
os.time

string.byte
string.char
string.len
string.lower
string.rep
string.reverse
string.upper

table.concat
table.pack
table.unpack
Something went wrong with that request. Please try again.