1 Introduction
1.1 Lisp Flavored Erlang
1.1.1 About
Lisp Flavored Erlang or LFE is a Lisp syntax front-end to the Erlang compiler. LFE is a Lisp-2, like Common Lisp, and comes with a REPL (shell). LFE coexists seamlessly with vanilla Erlang and OTP. As such, code written in LFE can freely be used together with modules written in vanilla Erlang and applications in Erlang/OTP.
1.1.2 Background
This work started life as a beautification of what Robert Virding had already created when he originally documented LFE. There are a few exemplar open source projects which have produced extraordinary documentation: both highly informative as well as being exceedingly easy on the eyes. We wanted LFE to aspire to those standards. In addition to helping with project adoption, creating an attractive and well-documented online resource for LFE makes it much nicer for the folks who already use the project.
The Github Pages feature provided us a means whereby an appealing open source project site could be created easily. These efforts were rewarded almost immediately by visitors and users who began spreading the word, further catalyzing our commitment to producing an improved user experience.
While attempting to add more verbose descriptions and enhance the prose around the original docs, there arose a strong desire to improve the organization of the topics covered as well. In this effort, we turned to the excellent Erlang books that have been published to date, and began drawing inspiration from these. It soon became clear that what was really needed was an LFE version of some combination of those wonderful efforts. With that, the LFE User Guide was fully set upon its course.
1.1.3 Motivation for the Uninitiated
If you have ever found yourself greatly admiring the Erlang language but thirsting for an alternative to the standard syntax, and you do not fear the elegance of parentheses (for a more civilized age), you might want to spend some time writing code in LFE. It could be just what you're looking for.
LFE has borrowings from Common Lisp and Scheme, so should provide a familiar face for those who have spent time hacking on projects powered by SBCL, Allegro, LispWorks, Chicken Scheme, Gambit, or Racket.
Similarly, those who have come to Lisp via the Java VM-powered Clojure will find much to love in the Erlang VM-powered LFE. LFE was released just one year after Clojure, but has 100% compatibility with the features in Erlang that inspired Clojure, some of which the Clojure community is still working on. You can get those without waiting when you use LFE!
1.2 Getting Started
The user guide assumes the following background knowledge:
- basic familiarity with Lisp or Lisp dialects
- a passing knowledge of Erlang
- a working installation of Erlang and LFE
For those that would like additional information on any of these, we recommend the resources below.
Online: * The LFE Quick Start * Learn You Some Erlang for Great Good (.mobi) * Practical Common Lisp * On Lisp * Structure and Interpretation of Computer Programs
Books: * Programming Erlang: Software for a Concurrent World * Erlang Programming: A Concurrent Approach to Software Development * Introducing Erlang * Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp
The LFE Quick Start is an important resource, as it covers dependencies, building LFE, installation, using the REPL, running scripts, and using modules/libraries (OTP and third-party).
1.3 More About LFE
1.3.1 What LFE Isn't
Just to clear the air and set some expectations, here's what you're not going to find in LFE:
- An implementation of Scheme
- An implementation of Common Lisp
- An implementation of Clojure
As such, you will not find the following: * A Scheme-like single namespace * CL packages or munged names faking packages * Access to Java libraries
1.3.2 What LFE Is!
Here's what you can expect of LFE:
- A proper Lisp-2, based on the features and limitations of the Erlang VM
- Compatibility with vanilla Erlang and OTP
- It runs on the standard Erlang VM
Furthermore, as a result of Erlang's influence (and LFE's compatibility with it), the following hold: * there is no global data * data is not mutable * only the standard Erlang data types are used * you get pattern matching and guards * you have access to Erlang functions and modules * LFE has a compiler/interpreter * functions with declared arity and fixed number of arguments * Lisp macros
1.4 What to Expect from this Guide
The intent of this guide is to follow the same general pattern that the best Erlang books do, covering the topics listed in the User Guide table of contents from an LFE perspective.
Some of the Guide's sections will be covered in dedicated tutorials or other in-depth documents; in those cases, we provide links to that material. If your favorite topic is not covered above, let us know! We'll try to find a place for it :-)