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!

First Post!

NobbZ

NobbZ

There is already elixir script, which compiles elixir to JavaScript, I’m not sure if there are plans to move it to generate WASM though.

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!

Last Post!

quda

quda

I’m aware of Firefly. It’s just a work in progress. Not production ready yet.

Where Next?

Popular in Discussions Top

mbenatti
Following https://github.com/tbrand/which_is_the_fastest |> https://raw.githubusercontent.com/tbrand/which_is_the_fastest/master/imgs...
New
und0ck3d
Hello everyone! A few days ago I’ve created a topic here about how people were creating CMSs with Elixir and Phoenix. I’ve been studying...
New
wmnnd
The Go vs Elixir thread got me thinking: Would it be too hard to implement a simple mechanism for creating Go-style static app binaries f...
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
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
Rustixir
Hi everyone, im working on find best language/framework/system for high concurrency, high performance and stable performance after wor...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
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 49266 226
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44778 311
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
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42716 114
New

We're in Beta

About us Mission Statement