Code Monkey home page Code Monkey logo

lfe's Introduction

LFE

LFE, Lisp Flavoured Erlang, is a lisp syntax front-end to the Erlang compiler. Code produced with it is compatible with "normal" Erlang code. An LFE evaluator and shell is also included.

Installation

LFE installation isn't recommended. Instead, one should:

  • use lfetool to create projects (which will automatically have LFE as a dependency when it creates skeleton libraries, OTP apps, etc.; or
  • use LFE directly in a working dir, e.g.:
    $ git clone https://github.com/rvirding/lfe.git
    $ cd lfe
    $ make compile

If you really do want to install LFE system-wide, you can do so like this:

    $ git clone https://github.com/rvirding/lfe.git
    $ cd lfe
    $ git checkout develop
    $ export ERL_LIBS=`erl -noshell -eval \
        'io:format("~s~n", [code:lib_dir()])' -s init stop`
    $ make compile
    $ make install

REPL

If you have used lfetool to set up your project, you can simply do this to start a REPL:

    $ make shell
    Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:8:8] ...

    LFE Shell V5.10.4 (abort with ^G)
    >

Note that this will recompile all the deps (often useful for projects with changing dependencies). If you would prefer to only recompile code for the project itself, you can use make shell-no-deps instead.

If you're running LFE from a git clone working dir, you can start the REPL like so:

    $ ./bin/lfe -pa ./ebin
    Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:8:8] ...

    LFE Shell V5.10.4 (abort with ^G)
    >

Usage

The docs site has several places to explore that will show you how to start using LFE. However, here's a quick taste:

  • start up an LFE REPL as demonstrated above
  • then, do something like this:
    > (* 2 (+ 1 2 3 4 5 6))
    42
    > (: lists foldl (lambda (n acc) (+ n acc)) 0 (: lists seq 1 6))
    42

Documentation

Classic Docs

Files with more technical details:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.