Skip to content
/ mix Public
forked from John-Goff/mix_lfe

Mix tooling for LFE (lisp (flavoured (erlang)))

Notifications You must be signed in to change notification settings

lfe/mix

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mix LFE Compiler

A very simple Mix task that compiles LFE (lisp (flavoured (erlang))).

It is a Mix compiler which uses the Erlang Mix compiler.

Lisp is a great language to get into the functional way of thinking and LFE is Lisp 2+ which runs on the greatest platform (personal opinion). Elixir's Mix is a great (or the greatest) configuration/package/build manager, so why not use it to compile LFE? Also Elixir developers should try LFE! This little project has the purpose to make that easier.

Installation and setup

First you must have a mix project setup:

mix new <project_name>

You can then add mix_lfe to your project dependencies in mix.exs:

def deps do
  [
    {:mix_lfe, github: "lfe/mix", branch: "master", only: [:dev, :test], runtime: false}
  ]

You also need to add lfe to the compilers section of your mix project:

def project do
  [
    ...
    compilers: Mix.compilers() ++ [:lfe],
    ...
  ]
end

Compilation

Compiling *.lfe sources, located in the src folder can be done with:

mix compile

To use the compiled modules with the LFE REPL, you can run:

mix lfe

The compiled LFE modules can be used from Elixir too:

iex -S mix

Now the modules will be accessible just like Erlang modules are accessible in Elixir.

Running tests

The compiler can compile and run ltest tests. Just put all the tests in the test folder of the project and run:

mix lfe.test

Works with umbrella applications, meaning that some of applications in the umbrella can be LFE ones.

Example projects

A list of projects created with mix_lfe. More to come.

  • LfePlug is an example of using LFE to create a Plug.
  • Echo is an example LFE OTP application, created with an outdated version of mix_lfe.

TODO

The tests of this project mirror the ones for the Erlang Mix compiler. For now the source is very simple and uses an idea from the Erlang Mix compiler. All works well, but requires some manual work and doesn't support LFE compiler fine tuning, so that's what we'll be after next.

  1. Pass more options to the LFE compiler, using mix configuration.
  2. More and more examples.
  3. Add CI to this project.
  4. Make it possible to add options when running mix lfe.test.
  5. Run ltest tests from exunit or possibly vice versa.
  6. Figure out how to use Elixir macros from LFE and vice versa.

License

Same as Elixir.

About

Mix tooling for LFE (lisp (flavoured (erlang)))

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 100.0%