My name is Oleksii Vasyliev.
I work as a Software Engineer. For more information about me, check out this links:
V8 engine for Elixir with pools
Home Page: http://leopard.in.ua/elixir_v8/
My name is Oleksii Vasyliev.
I work as a Software Engineer. For more information about me, check out this links:
In my personal project, after I put {:elixir_v8, "~> 0.2.2"}
as deps in mix.exs, hit $ mix deps.get
and $ iex -S mix
, I see this:
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Compiling 1 file (.ex)
Generated elixir_v8_try app
=INFO REPORT==== 16-Feb-2017::17:21:05 ===
application: logger
exited: stopped
type: temporary
** (Mix) Could not start application erlang_v8: could not find application file: erlang_v8.app
Did I miss something?
I am trying to run this within phoenix and I get the error: Could not compile dependency erlang_v8, ~/.mix/rebar command failed. If you want to recompile this dependency, please run: mix deps.compile erlang_v8. Any ideas?
Here is a simple elixir script running totally fine.
ElixirV8.create_pool(:main, 10, file: "a.js")
IO.inspect ElixirV8.eval({:global, :main}, "a()")
But when the "a.js" gets larger, it shows error like this.
[pig@localhost phoenix_react]$ ls -lh a.js ; mix run run.exs
-rw-r--r-- 1 pig pig 130K Feb 25 10:40 a.js
** (exit) exited in: :gen_server.call({:global, :main}, {:checkout, #Reference<0.0.7.2642>, true}, 5000)
** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
(kernel) global.erl:198: :global.send/2
(stdlib) gen_server.erl:219: :gen_server.cast/2
(poolboy) src/poolboy.erl:58: :poolboy.checkout/3
(poolboy) src/poolboy.erl:74: :poolboy.transaction/3
run.exs:2: (file)
(elixir) lib/code.ex:370: Code.require_file/2
(mix) lib/mix/tasks/run.ex:82: Mix.Tasks.Run.run/1
(mix) lib/mix/task.ex:294: Mix.Task.run_task/3
(mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2
(elixir) lib/code.ex:370: Code.require_file/2
[error] GenServer #PID<0.273.0> terminating
** (MatchError) no match of right hand side value: {:error, {{:badmatch, {:error, :vm_unresponsive}}, [{ElixirV8.VM, :init, 1, [file: 'lib/elixir_v8/vm.ex', line: 19]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 328]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}
(poolboy) src/poolboy.erl:275: :poolboy.new_worker/1
(poolboy) src/poolboy.erl:296: :poolboy.prepopulate/3
(poolboy) src/poolboy.erl:145: :poolboy.init/3
(stdlib) gen_server.erl:328: :gen_server.init_it/6
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: {:EXIT, #PID<0.272.0>, {{:badmatch, {:error, {{:badmatch, {:error, :vm_unresponsive}}, [{ElixirV8.VM, :init, 1, [file: 'lib/elixir_v8/vm.ex', line: 19]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 328]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}}, [{:poolboy, :new_worker, 1, [file: 'src/poolboy.erl', line: 275]}, {:poolboy, :prepopulate, 3, [file: 'src/poolboy.erl', line: 296]}, {:poolboy, :init, 3, [file: 'src/poolboy.erl', line: 145]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 328]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}
State: {:state, {#PID<0.273.0>, :poolboy_sup}, :simple_one_for_one, [{:child, :undefined, ElixirV8.VM, {ElixirV8.VM, :start_link, [[file: "a.js"]]}, :temporary, 5000, :worker, [ElixirV8.VM]}], {:set, {:set, 0, 16, 16, 8, 80, 48, {[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []}, {{[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []}}}}, 0, 1, [], 0, :poolboy_sup, {ElixirV8.VM, [file: "a.js"]}}
It's nicer when it prints kinder error message or document about it in readme.
Have you had any success including node libraries like 'request' or others? I would like to add the ability to make http calls? what about jquery?
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.