basho / erlang_js Goto Github PK
View Code? Open in Web Editor NEWA linked-in driver for Erlang to Mozilla's Spidermonkey Javascript runtime.
License: Apache License 2.0
A linked-in driver for Erlang to Mozilla's Spidermonkey Javascript runtime.
License: Apache License 2.0
Compiling src/js_benchmark.erl failed:
src/js_benchmark.erl:41: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/js_benchmark.erl:43: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
ERROR: compile failed while processing /project_path/erlang_js: rebar_abort
** (Mix) Could not compile dependency :erlang_js, "$HOME/.mix/rebar" command failed. You can recompile this dependency with "mix deps.compile erlang_js", update it with "mix deps.update erlang_js" or clean it with "mix deps.clean erlang_js"
Xcode 4.3 does some strange things when inlining code; two functions within erlang_js.so are declared as inline (for no clear reason), so we need to remove that.
A linked-in driver for Erlang to Mozilla's Spidermonkey JavaScript runtime.
(I can't change your repo's description)
Hello, I have been trying to compile erlang_js with OTP 18.3, but allways I get this message "Failed to load erlang_js_drv.so". I tried in Ubunto 14.0.04 and OSX 10.11.4.
Here you can find the full log of my error: https://gist.github.com/rhumbertgz/ee0bf432edfa89ffa0a47405f3250fcd
Any suggestion?
Thanks in advance,
Humberto
I'm not very familiar with Erlang & rebar, but I'd like to play around with erlang_js. I'm trying to compile master (07467d8) and 1.3.0 but I'm getting the same error[0]. I have no idea where to start debugging this and I'd appreciate any hints.
I'm on OS X 10.9.3, using (via homebrew) Erlang 17.0 and I think I have a "GNU-style build system" (whatever that exactly means).
With Ubuntu 12.04 and R16B03-1, make test
succeeds and I can run the example described in the README.
[0]
$ make test
./rebar get-deps
Uncaught error in rebar_core: {'EXIT',
{badarg,
[{re,replace,
[[36,40,114,118,109,95,112,114,111,109,112,
116,41,37,123,37,40,63,46,37,123,37,98,37,
115,37,117,27,91,48,48,109,37,125,46,37,
83,41,37,125,37,123,27,91,51,50,109,37,
125,36,40,103,101,116,95,103,105,116,95,
112,114,111,109,112,116,95,105,110,102,
111,32,37,98,41,37,123,27,91,51,49,109,37,
125,36,40,103,101,116,95,103,105,116,95,
112,114,111,109,112,116,95,105,110,102,
111,32,37,115,41,37,123,37,40,63,46,37,
123,37,98,37,115,37,117,27,91,48,48,109,
37,125,46,37,83,41,37,125,37,123,27,91,51,
55,109,37,125,37,66,37,49,126,37,98,37,
123,37,98,37,115,37,117,27,91,48,48,109,
37,125,32,37,123,37,83,36,102,103,91,36,
90,76,69,95,67,79,76,79,82,93,37,125,37,
123,37,98,37,115,37,117,27,91,48,48,109,
37,125,37,123,27,91,51,52,109,37,125,
10140,37,123,37,98,37,115,37,117,27,91,48,
48,109,37,125,32],
[92,36,40,"PROMPT",40,92,115,124,36,41,124,
123,"PROMPT",125,41],
[[],"\\2"],
[global,{return,list}]],
[{file,"re.erl"},{line,355}]},
{rebar_port_compiler,merge_each_var,2,[]},
{rebar_port_compiler,setup_env,2,[]},
{rebar_core,'-setup_envs/2-fun-0-',2,[]},
{lists,foldl,3,
[{file,"lists.erl"},{line,1261}]},
{rebar_core,process_dir1,6,[]},
{rebar_core,process_commands,2,[]},
{rebar,main,1,[]}]}}
make: *** [deps] Error 1
Hello!
What's the current status of the project? Last commit was ~1 year ago, PRs are mounting, and I'm getting worried a bit.
We're working on figuring out the best future for the erlang_js project. If I've tagged you, it's because you've either made a contribution or expressed an interest in the project somewhere on GitHub. (Apologies if I've missed anyone, these are just the names that I've seen from scrolling through open pull requests.)
@marianoguerra @lemenkov @tisba @zackehh @sebastian @superstructor
So first off, thanks for all the contributions and for your interest in the project! I'm very sorry that we haven't been more responsive: there are multiple pull requests that have been sitting untouched for a long time, and that's a shame. Basho has not been so great about working with the OSS community lately, but we're working hard to rectify the situation.
That said, the erlang_js project is especially tricky, because Basho has no real reasons for updating it anymore. The only thing it's used for in Riak is for submitting JS MapReduce functions, but that functionality has been deprecated for years (since the Riak 2.0 release). We've been using the same 1.3.0 tag of erlang_js for numerous releases in a row, and eventually we may just remove erlang_js from Riak altogether.
Since there is clearly interest from the outside community, I don't want to just let this project rot, but we also don't necessarily have the resources to maintain it and deal with outside contributions. For example, updating the javascript engine would be great, but it would require a lot of testing to put that into a new release of Riak, and it's very hard to justify doing that work for a little-used, deprecated feature.
So, would any of you potentially be interested in taking over as a maintainer? In the past, we've successfully spun out popular Erlang OSS projects into their own external organizations (webmachine being perhaps the best example of this). If any of you who are using this project would like to see it continue to grow and evolve, I think this may be our best bet for allowing that to happen.
Thanks again, and let me know what you all think! I'm very open to any suggestions anyone might have on this matter, so feel free to speak your minds :)
I am getting this error when I attempt to compile erlang_js - I need it's support in an Elixir library called "coffee_rotor"... I have added the issue I raised on that project below..
Here is the compile error I am getting - it relates to time issues not working when compiling erlang_js against the latest version of Erlang. Any chance this can be fixed in Erlang 18..? THANKS :)
Compiled src/erlang_js.erl Compiled src/js.erl src/js_benchmark.erl:41: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information. src/js_benchmark.erl:43: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information. ERROR: compile failed while processing /Users/steveforkin/Work/elixir-workbench/erlang_js: rebar_abort make: *** [compile] Error 1
When run with R15B against the current master branch, beam.smp coredumps on emulator exit.
erlang_js will not build on Xcode 4.4 with Mountain Lion.
Couple things I'm noticing with nsprpub:
Maybe I'm doing something wrong, but if I continuously create and destroy JavaScript VM instances the process memory increases all the time:
runjs() ->
{ok, Js} = js_driver:new(),
js_driver:destroy(Js),
runjs().
Any thoughts? Should I do this in some other way?
Hi,
I was playing aroung with erlang_js and encountered the following behavior:
I want to run the following js function with a string as the argument:
function(x)
{
return x.split(" ");
}
there are three ways I can think of doing this and two work, whereas the third does not.
{ok, JS} = js_driver:new().
js:eval(JS, <<"function(x) {return x.split(\" \")}(\"foo bar\")">>).
and
{ok, JS} = js_driver:new().
js:define(JS, <<"var doSplit = function(x) {return x.split(\" \")}">>).
js:call(JS, <<"doSplit">>, [<<"foo bar">>]).
both return the expected {ok, [<<"foo">>, <<"bar">>]}
when I try to do call an anonymous function I get an error:
{ok, JS} = js_driver:new().
js:call(JS, <<"function(x) {return x.split(\" \")}">>, [<<"foo bar">>]).
{error,[{<<"lineno">>,1},
{<<"message">>,
<<"SyntaxError: missing ) in parenthetical">>},
{<<"source">>,
<<"JSON.stringify(function() { if (function(x) {return x.split(\" \");} === undefined) { thro"...>>}]}
something is going wrong with the space character in split(). If I pass it in as an argument it works fine again:
{ok, JS} = js_driver:new().
js:call(JS, <<"function(x, s) {return x.split(s)}">>, [<<"foo bar">>, <<" ">>]).
My machine reports this:
Darwin dhcp-218.dyn81-121.trifork.com 11.4.0
Darwin Kernel Version 11.4.0: Mon Apr 9 19:32:15 PDT 2012;
root:xnu 1699.26.8~1/RELEASE_X86_64 x86_64
During configure, I get
checking host system type... i386-apple-darwin11.4.0
Which is not a platform being matched in current rebar.config
Compiling fails with some header file isses.
I tried to upgrade to nspr-4.9.1 (erlang_js is currently using 4.8), and it seems to compile just fine.
Is this project still can be use now?
os:
[root@db-01 erlang_js]# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
erl:
[root@db-01 erlang_js]# erl
Erlang/OTP 19 [erts-8.3.3] [source] [64-bit] [smp:32:32] [async-threads:10] [hipe] [kernel-poll:false]Eshell V8.3.3 (abort with ^G)
1>
I run:
git clone git://github.com/basho/erlang_js.git
make all test
It result:
=PROGRESS REPORT==== 17-Sep-2018::10:16:50 ===
application: sasl
started_at: nonode@nohost=ERROR REPORT==== 17-Sep-2018::10:16:50 ===
Error loading "erlang_js_drv": "undefined symbol: erl_exit"=CRASH REPORT==== 17-Sep-2018::10:16:50 ===
crasher:
initial call: supervisor:erlang_js_sup/1
pid: <0.298.0>
registered_name: erlang_js_sup
exception exit: {bad_return_value,
{error,
{load_error,"Failed to load erlang_js_drv.so"}}}
in function gen_server:init_it/6 (gen_server.erl, line 356)
ancestors: [<0.297.0>]
messages: []
links: [<0.297.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 376
stack_size: 27
reductions: 145
neighbours:=CRASH REPORT==== 17-Sep-2018::10:16:50 ===
crasher:
initial call: application_master:init/4
pid: <0.296.0>
registered_name: []
exception exit: {{bad_return_value,
{error,
{load_error,"Failed to load erlang_js_drv.so"}}},
{erlang_js,start,[normal,[]]}}
in function application_master:init/4 (application_master.erl, line 134)
ancestors: [<0.295.0>]
messages: [{'EXIT',<0.297.0>,normal}]
links: [<0.295.0>,<0.31.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 376
stack_size: 27
reductions: 129
neighbours:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.