PhaserKell

PhaserKell

Create a compiler and a VM in Elixir

Hi, I would like to make in the near future a programming language like https://vlang.io/
I think Elixir is an excellent candidate for this job but I fear two points:

  • Would the performance be sufficient? According to some articles Elixir would be slower than Java, do you have bindings to LLVM?

  • I can’t ask my users to download the project and elixir to run it, do you have a way to get a static binary?

I am interested in https://github.com/nicolasdilley/dwarf-interpreter and when I compile it I get a tiny binary of 1 mo, how did it do?

Most Liked

rvirding

rvirding

Creator of Erlang

Hi, I have done 2 languages on top Erlang/BEAM, public languages anyway, LFE (Lisp Flavoured Erlang) https://github.com/rvirding/lfe and Luerl https://github.com/rvirding/luerl . The first is a Lisp which keeps the basic Erlang semantics as provide by the BEAM while the second is an implementation Lua implemented in Erlang. [*] Note that the BEAM is designed to run Erlang and most the of the Erlang language features are directly implemented in the BEAM.

Luerl works by compiling down to a VM for which I have then written an interpreter. This to provide the data and code handling which Lua requires but is not provided by the BEAM. Basically Lua has shared, mutable and global data which we don’t do. Yes, the resulting language is slower but the Erlang interface is fast and you get free access to Erlang’s concurrency and parallelism.

[*] I call the first “native” languages on the Erlang Ecosystem, Elixir is of course another one, while the second “non-native” languages.

NobbZ

NobbZ

What kinds of documents do you mean?

There is the BEAM book and also BEAM wisdom. Perhaps you can find even more valuable resources in Best resources on BEAM internals?.

As well as there might be some wisdom available in the OTP sourcecode or in the two RUST re-implementations ErlangRT and enigma.

You could, but if your language has a lot of mutability or objects (I do infer this from your constant mention of the JVM) or other semantics building on those, then the BEAM is probably not a suitable runtime for your language.

Still, building a compiler for your language on the BEAM is a valid choice.

Where Next?

Popular in Questions Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
kostonstyle
Hi all I want to have a unix time, from the current time plus 1 hour. DateTime.now + 1 hour How to get it in elixir? Thanks
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement