Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
C Erlang Perl
branch: master
Failed to load latest commit information.
c_src Mark Emonk sources with the MIT license.
docs Include the design picture.
ebin Major rewrite of emonk for R14A.
src Mark Emonk sources with the MIT license.
.gitignore Now requires Erlang R14A or newer.
LICENSE Mark Emonk sources with the MIT license.
Makefile Updates to etap tests. Remove reference to old design.
rebar Major rewrite of emonk for R14A.
rebar.config Major rewrite of emonk for R14A.

emonk - Accidentally Refactored erlang_js

erlang_js is awesome. But I started refactoring. Now there's emonk.

With the latest versions of Emonk there's quite a bit of difference now. Emonk is NIF based and uses a thread-pool to move JavaScript execution off of the Erlang scheduler threads. Translation from Erlang terms to JavaScript objects uses a native translation step to avoid JSON overhead. I haven't gotten around to actually testing to see if there's any sort of appreciable difference in speed.


  1. A fairly recent version of Spidermonkey. I use the version from HomeBrew which uses this url.
  2. R14A. Emonk uses the new NIF API extensively.


Hopefully the build scenario is something like:

$ git clone git://
$ cd emonk
$ make
$ make check


I've been using etap to test as I code. Its awesome. You should use it. That said, running is pretty cake assuming emonk is on your Erlang code path:

$ ERL_LIBS=~/awesome_projects/emonk/src erl -s emonk
1> {ok, Context} = emonk:create_ctx().
{ok, <<>>} % Note: The <<>> here is *not* an empty binary. Its a resource.
2> emonk:eval(Context, <<"var f = 2; f*3;">>).
{ok, 6}
3> emonk:eval(Context, <<"var g = function(x) {return x*4;};">>).
{ok, undefined}
4> emonk:call(Context, <<"g">>, [9]).
{ok, 36}

Bugs and Things

The best place to file bugs is at the issue tracker on GitHub. Less yapping, more tapping. Thanks mattly.


That's pretty much it. Mostly this was internal churn that I kinda started chasing around like my tail. Hopefully things are easy enough to follow in the logs and code.

Something went wrong with that request. Please try again.