-
Notifications
You must be signed in to change notification settings - Fork 142
0.2 Getting started
Luerl works as a library embedded in a host simple called the embedding program. The host program can invoke functions to execute a piece of Lua code, can write and read Lua variables, and call Erlang functions by Lua code.
Through the use of Erlang, Luerl can be augmented to cope with a wide range of different domains, creating a customized language sharing a syntactical framework.
Luerl implement standard Lua 5.3 in pure Erlang to start using the project you need to include the luerl library as new dependency on your OTP application.
With Rebar 3, you can either install luerl
from hex.pm or from GitHub directly (for more info on Rebar dependencies, see the dependency documentation).
Add luerl
as a dependency to your project rebar.config
file using one of the two options below.
{deps, [luerl]}.
{deps, [{luerl, {git, "git://github.com/rvirding/luerl.git", {branch, "develop"}}}]}.
Or use Erlang.mk to setup quickly your environment, build the code and project release.
Create a Makefile and include luerl to the project dependencies.
DEPS = luerl
$ git clone https://github.com/rvirding/luerl.git
For a quick starting tutorial we're going to use Erlang.mk to setup quickly our environment, build our code and start or stop the project release.
Erlang.mk is very easy to setup: create a folder, put Erlang.mk in it, and write a Makefile:
include erlang.mk
For a step by step:
$ mkdir luerl_demo
$ cd luerl_demo
$ curl https://erlang.mk/erlang.mk -o erlang.mk
Create a Makefile and copy the next code snippet, there you can make the correct changes to reflect your project needs.
PROJECT = ophelia
DEPS = luerl
include erlang.mk
$ make
From that point you can create an src/ folder or start using http://erlang.mk/ templates - User guide.