ExLua

Hex.pm packageHex.pm downloadsHex.pm licenseTravis CI build statusCoveralls.io code coverageGratipay donations

Lua for Elixir, based on Luerl.

Examples

[42.0] = Lua.State.new |> Lua.eval!("return 6 * 7")

Reference

https://hexdocs.pm/exlua/

ExLua (Elixir)Luerl (Erlang)Lua (C)
Lua.Error{:error, ...}luaL_error
Lua.State.newluerl:initluaL_newstate
Lua.call_chunk!luerl:call_chunklua_pcall
Lua.call_function!luerl:call_functionlua_pcall
Lua.evalluerl:evalluaL_dostring
Lua.eval!luerl:evalluaL_dostring
Lua.eval_fileluerl:evalfileluaL_dofile
Lua.eval_file!luerl:evalfileluaL_dofile
Lua.gcluerl:gclua_gc
Lua.loadluerl:loadluaL_loadstring
Lua.load!luerl:loadluaL_loadstring
Lua.load_fileluerl:loadfileluaL_loadfile
Lua.load_file!luerl:loadfileluaL_loadfile
Lua.set_tableluerl:set_tablelua_settable

Installation

Add exlua to your list of dependencies in your project's mix.exs file:

defp deps do
[{:exlua, "~> 0.1.0"},
{:luerl, github: "rvirding/luerl", tag: "v0.3",
compile: "make && cp src/luerl.app.src ebin/luerl.app"}]
end

Alternatively, to pull in the dependency directly from a Git tag:

defp deps do
[{:exlua, github: "bendiken/exlua", tag: "0.1.0"},
{:luerl, github: "rvirding/luerl", tag: "v0.3",
compile: "make && cp src/luerl.app.src ebin/luerl.app"}]
end

Alternatively, to pull in the dependency directly from a Git branch:

defp deps do
[{:exlua, github: "bendiken/exlua", branch: "master"},
{:luerl, github: "rvirding/luerl", tag: "v0.3",
compile: "make && cp src/luerl.app.src ebin/luerl.app"}]
end