pdgonzalez872

pdgonzalez872

Elixir + WASM -> will it happen?

  • If this has been asked here before, please point me to where it was asked as I didn’t find it when I searched the forum. Maybe a mailing list somewhere, but I didn’t find it.

I think I’m not alone when thinking about the awesome possibility of using Elixir for both backend and frontend work. I honestly think that this would be a massive win for Elixir. It would be awesome!! With that said, here are a couple of questions:

  1. What are some of the tradeoffs that we’d make when using Elixir for both (front + back)end development? I don’t know much about WASM to have an opinion/idea of what to expect here. But, I know a lot of folks here do.

  2. Is there anything holding the Elixir + WASM effort back? Is it just open source + time to get it working? Is there some technical challenge that makes this a pain? If there are, could you please list them?

  3. Is WASM on the roadmap for Elixir at all?

There seems to be a library that started trying to accomplish this:
https://github.com/jamen/elixir-wasm

Thanks! Excited to hear more about this!

Most Liked

alexgaribay

alexgaribay

Phoenix Core Team

Yes. DockYard is hiring someone to tackle this effort by first seeing if it’s possible and then implement it. Brian Cardarella (CEO of DockYard) said that you shouldn’t wait for it since it will be a multi-year effort.

JakeBecker

JakeBecker

I made a brief attempt at it but I got inundated with compile errors that look difficult to tackle without solid C experience. For anyone who wants to try, here’s the basics of how I got started. You’ll need emsdk installed and activated first:

# Clone Erlang repo
git clone https://github.com/erlang/otp.git
cd otp
git checkout OTP-21.0.9

# Some of the build stuff references the environment variable $ERL_TOP
export ERL_TOP=`pwd`

# Start with some autoconf stuff for the Erlang RunTime System (erts). Though it may not
# actually make a difference here, I'm prefixing these commands with `emconfigure` command
# to make sure that emscripten's headers are used instead of the default system headers
cd erts
emconfigure autoheader
emconfigure autoconf

# Back in the root, configure and compile. The flag --enable-bootstrap-only causes only the
# core runtime system to be compiled
cd ..
emconfigure autoconf
emconfigure ./configure --enable-bootstrap-only
emmake make

At this point, be prepared for a mountain of compiler errors. The exact errors differ when running it on Mac vs Ubuntu. Many of them occur in parts of the code that can be disabled with preprocessor defines, so it’s possible that the right set of defines could get it to work.

There’s a section of the Erlang docs that describes cross-compilation, but I didn’t find anything I knew how to make use of. To anyone at Dockyard or elsewhere giving this a whirl, good luck, and please let us know how it’s going!

Where Next?

Popular in Discussions Top

Donovan
Hello everyone, I’m so glad to have discovered this awesome community. Thanks for creating it! This is my second post, and apologies for...
New
sashaafm
I’m trying to evaluate the best combo/stack for a BEAM Web app. Right now I’m exploring Yaws a bit, after having dealt with Phoenix for a...
New
owaisqayum
I have a sample string sentence = "Hello, world ... 123 *** ^%&*())^% %%:>" From this string, I want to only keep the integers, ...
New
fireproofsocks
This is more of a general question, but I’m wondering how other people in the community think about the pattern matching in function sign...
New
AstonJ
If a newbie asked you about Phoenix Contexts, how would you explain the basics to them? Feel free to be as concise or in-depth as you li...
New
PragTob
Hey everyone, this has been on my mind for some time and I’d love your input on it! TLDR: I feel like maps are superioer for storing and...
New
chulkilee
Here are the list of HTTP client libraries/wrappers, and some thoughts on HTTP client in general. I’d like to hear from others how they w...
New
griffinbyatt
Sobelow Sobelow is a security-focused static analysis tool for the Phoenix framework. For security researchers, it is a useful tool for g...
New
kostonstyle
Hi all How can I compare haskell with elixir, included tools, webservices, ect. Thanks
New
Markusxmr
Since Drab has been developed for a while in the open, introducing the Liveview functionality in a way it happend appears to undermine th...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
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
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 47930 226
New

We're in Beta

About us Mission Statement