bryanjos

bryanjos

Rayscript: Erlang Abstract format to JavaScript

In my Lonestar Elixir presentation on Elixirscript I mentioned compiling from Beam files. About a 2 weeks ago, I started to play around with getting the Erlang Abstract Format from beam files. From there, I started thinking about turning that format into JavaScript. That project is rayscript

There are a couple of big advantages to doing so over Elixirscript’s implementation. The biggest one is that it could enable all languages on the Beam to convert code to JavaScript. Another is that compile time features, such as macros in Elixir, would not be a concern. Yet another would be that OTP should be easier to support as long as the beam files are available. I did some tests and was able to retrieve the format from beam files in both the Erlang and Elixir standard libs and convert to JavaScript. A question I get asked about a lot with Elixirscript are around processes. The problem isn’t that there is not an implementation for processes. One exists. The problem was one of integrating it within what already exists in Elixirscript. Starting from the beginning means that it will be a simpler task of adding it in.

The work done in Elixirscript helps a lot here. Most of what is there now is modified from Elixirscript. There are a few new problems. The biggest one being around how to handle NIFs. Also, an old one around JavaScript interoperability.

Long story short, if we can implement all of the forms there, we might be in business. I’m currently looking for any help on the project. Especially from anyone who can help with implementation, may have experience with other Beam languages, or who would be interested in helping with whatever underlying JavaScript that would be needed.

Most Liked

OvermindDL1

OvermindDL1

Looks fascinating!

Well NIF’s and Ports sound like great integration points between Rayscript and javascript at least. ^.^

If you are curious in Elixir AST → Javascript compilation, there is an old project that did most of it at GitHub - synrc/shen: 🐉 SHEN: Erlang JavaScript Compiler · GitHub if you are curious about any code to swipe or so since that project is long-dead. :slight_smile:

Shen worked based on a parse_transform though, much different method.

bryanjos

bryanjos

Thanks! I’ve seen shen before, but I think I will look to see how they implemented tail recursion.

I started looking into the idea after looking more and more into bucklescript recently since I see that both Ocaml and Reason can both use it. I’ve been interested in OCaml for a while now for some things and started taking the dive into it.

Where Next?

Popular in Announcing Top

wmnnd
Hi there, for my project DBLSQD, I needed a file storage solution that is a bit more flexible than Arc. Because I thought others might f...
New
tmbb
I’ve published the first version of my Makeup library. It’s a syntax highlighter for Elixir in the spirit of Pygments, Currently it highl...
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
New
ityonemo
Currently just starting out on a new mini-project - getting zig NIFs to run in elixir. https://github.com/ityonemo/zigler The idea here...
New
oltarasenko
Dear Elixir community, After a year of development, bug fixes, and improvements, we are proudly ready to share the release of Crawly 0.1...
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
fuelen
Hey folks! Want to present a toolkit for writing command-line user interfaces. It provides a convenient interface for colorizing text...
New

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54921 245
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
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
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement