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 https://github.com/synrc/shen 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 Libraries Top

mathieuprog
Hello :wave: Allow me to introduce you to Tz, an alternative time zone database support to Tzdata. Why another library? First and fore...
New
sabiwara
Dune is a sandbox for Elixir and aims to safely evaluate user-provided code. You can try it out using this basic Elixir playground made ...
New
josevalim
EDIT: since Ecto 3.0 final version is out, this post was amended to use the final versions in the instructions below. Hi everyone, We a...
New
blatyo
https://www.conduitframework.com/ The best overview for how things are tied together is this presentation. Modules and functions are pre...
New
Qqwy
Hello everyone, I wrote a small library today called MapDiff. It returns a map listing the (smallest amount of) changes to get from map...
New
zorbash
I created Kitto a framework for dashboards inspired by Dashing. [demo] The distributed characteristics of Elixir and the low memory foo...
New
bryanjos
Hi, I wanted share a small library we at Revelry Labs made for rendering react components from the server side. There are instructions fo...
New
gjaldon
As the title states, EctoEnum has just been updated after some time of hardly any activity in the repo. Here’s the latest release: https:...
New
vic
Expat is a tiny experiment I did for extracting patterns and being able to reuse them (compose and share patterns between elixir librarie...
New
wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New

Other popular topics Top

srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
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
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
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
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

Sub Categories:

We're in Beta

About us Mission Statement