...To the taste of Erlang, aged in the oaken barrels of Lisp, served at a temperature of perfect hotness. New to LFE? Check out our Quick Start guide!
LFE-based projects coexist seamlessly with Core Erlang and OTP. As such, code written in LFE can freely be used together with modules written in other BEAM languages such as Erlang and Elixir.
We have a Features page, but here are some of the highlights:
LFE installation isn't recommended. Instead, one should:
$ lfetool new library my-lib $ ls -al my-lib/deps/lfe ...
$ git clone https://github.com/rvirding/lfe.git $ cd lfe $ git checkout develop $ make compile
If you really do want to install LFE (master branch) system-wide, you can do so like this:
$ lfetool install lfe
If you have used
lfetool to set up your project, you can simply do this to
start a REPL:
$ lfetool repl lfe
If you want to compile your source code before you start the repl, you can use this command:
$ make shell
Both of those commands will set
ERL_LIBS to the dirs of all your declared
and downloaded dependencies.
If you're running LFE from a git clone working dir, you can start the REPL like so:
$ ./bin/lfe -pa ./ebin
Note that if you want access to your dependencies and have started the REPL
manually, you will need to either tack them on with additional
parameters or you'll want to define
Here's a quick taste:
> (* 2 (+ 1 2 3 4 5 6)) 42 > (* 2 (lists:foldl (lambda (n acc) (+ n acc)) 0 (lists:seq 1 6))) 42
LFE documentation is maintained in the source code in the doc directory. There is also a wiki with some excellent content presented there. However, the site you are currently reading is attempting to provide a gentler and more verbose introduction to Lisp Flavored Erlang. We aim to accomplish this in two important ways:
A final resource for the curious and motivated is available in the examples directory of the project repo. Each sample provides functioning code that shows how to use LFE in larger contexts.