Using LFE
Reference materials, tooling, and practical resources for working LFE developers.
Development environment
# In a project directory (Erlang 21+ and rebar3 required):
$ rebar3 lfe repl
# From the LFE source repo:
$ make && ./bin/lfe
# No install needed:
$ docker run -it lfex/lfe
Once in the REPL, (help) prints available commands and double-tap
<TAB> after a module prefix (e.g., (lists:) lists its exported
functions.
- Development Setup — installing Erlang + rebar3 + LFE
- The LFE REPL — features, readline, job control, file evaluation
- Creating LFE Projects — project layout and rebar3 conventions
- Emacs lfe-mode — syntax highlighting and REPL integration, bundled with LFE
Language reference
- The LFE Machine Manual — the comprehensive reference (in progress)
- The LFE Guide — core language guide (man page source)
- Data types — the LFE type system
- REPL reference — functions, variables, environment
- LFE formatting — I/O and format strings
- Common Lisp compatibility — the
clmodule - Clojure compatibility — the
cljmodule - Style Guide — naming, formatting, data representation conventions
- All LFE books — the complete collection
OTP reference
The modules you'll reach for every day.
;; Calling into OTP is just calling Erlang modules:
lfe> (application:which_applications)
((lfe "Lisp Flavoured Erlang" "2.1.4")
(compiler "ERTS CXC 138 10" "8.4.1")
(kernel "ERTS CXC 138 10" "9.2.1")
(stdlib "ERTS CXC 138 10" "5.2.1"))
- ERTS Reference Manual — the runtime system
- Key modules: erlang, application, supervisor
- Behaviours: gen_server, gen_event, gen_statem
- Data: lists, maps, proplists
- The LFE Machine Manual — Part V: OTP — OTP in LFE
Ecosystem & interop
LFE calls Erlang modules directly — no wrappers, no FFI, no overhead.
;; Any Erlang library is an LFE library:
lfe> (lists:reverse
(erlang:integer_to_list
(lists:foldl #'*/2 1 '(1 2 3 4))))
"42"
- Calling Erlang from LFE — the interop model
- Ports and Port Drivers — interfacing with external programs
- Jinterface — Java interop
- rebar3_lfe plugin — the LFE compiler plugin for rebar3
- Community libraries — the LFE ecosystem on GitHub
Deployment
- Releases — building OTP releases
- LFE Docker images — a large collection of ready-to-use images
- Adopting Erlang — taking BEAM applications into production
- Stuff Goes Bad — Erlang in Anger — debugging production systems
- rebar3 — Getting Started, Configuration, Using Plugins, Writing Plugins