Skip to content

chaos-ad/emonk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My fork of emonk library, in which I fix stuff for my own good.
Original can be found here: http://github.com/davisp/emonk/

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.

Requisites

  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.

Building

Hopefully the build scenario is something like:

$ git clone git://github.com/davisp/emonk.git
$ cd emonk
$ make
$ make test

Running

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
{ok, Context} = emonk:start_vm().
{ok, 6} = emonk:eval(Context, <<"var f = 2; f*3;">>).
{ok, undefined} = emonk:eval(Context, <<"var g = function(x) {return x*4;};">>).
{ok, 36} = emonk:call(Context, <<"g">>, [9]).

Bugs and Things

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

Yep

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.

About

An Erlang NIF-based application which allows to embed JS into the Erlang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 46.6%
  • Erlang 38.8%
  • Perl 13.8%
  • C++ 0.8%