Work on Elixir/LFE port to Erlang stopped

65 views
Skip to first unread message

Matus Kmit

unread,
Aug 3, 2018, 1:57:37 PM8/3/18
to Shen
Hi

As I have mentioned in a previous thread I have been working on an Elixir/LFE port of Shen targeting Erlang VM. Unfortunately, I am not able to continue working on this project(s) as my priorities in life have shifted.

I wanted to at least roughly let you know what I could achieve so far, so that you in general and particularly those interested in this platform know.

Elixir port:
- Interpreter.
- It has a Klambda REPL (good for testing things when porting the primitives).
- Very slow. I think it has mainly to do with the fact that functions are not compiled and the way how currying/partial application is performed.
- When I stopped working on it had only one failing test, although now it is broken due to some other reason. It could be anything from upgrades of Elixir/Erlang/OTP which happened in the meanwhile, screwing something with git branches or something in code.
- Functions and global variables namespaces are implemented using Genserver.
- Vectors are implemented using Agents wrapping native Erlang arrays.
- Source code is to be found here: https://github.com/nimaai/shen-elixir

LFE/Erlang port:
- Compiled.
- This was supposed to become the final port, leaving the Elixir one behind.
- Just in the beginning, but one can see how Klambda can be compiled to LFE and which primitives are implemented using functions and which using macros.
- Namespaces are done with simple ETS tables instead of Genserver. I don't know if this is good idea but should work.
- The mapping between Klambda and LFE is very straightforward as the latter one is a Lisp too.
- You can compile down to Erlang VM .beam files via this path: Shen -> Klambda -> LFE -> BEAM.
- Working with LFE/Erlang feels quite intuitive due to couple of similarities with Shen:
-- Pattern-matching (LFE, Erlang?).
-- Function variables beginning with capital letter (Erlang not LFE).
-- Self-evaluating symbols (Erlang not LFE).
- Due to the above last 2 reasons one may consider to compile to Erlang instead of LFE, but a Lisp is a Lisp.
- Source code is to be found here: https://github.com/nimaai/shen-lfe

I hope someone gets inspired by my incomplete efforts and writes his own fast port of Shen to Erlang VM. Because, although I won't continue with my work, Shen definitely deserves one!

Greetings,
Matus

Mark Tarver

unread,
Aug 4, 2018, 2:49:09 AM8/4/18
to Shen
Thank you for that Matus.

Mark
Reply all
Reply to author
Forward
0 new messages