Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting V8 bindings into a standalone crate? #1357

Closed
Neurrone opened this issue Dec 16, 2018 · 5 comments
Closed

Extracting V8 bindings into a standalone crate? #1357

Neurrone opened this issue Dec 16, 2018 · 5 comments

Comments

@Neurrone
Copy link

Hi,

There aren't any existing bindings to V8 that are up to date. Based on the crate documentation, Deno is able to call V8 APIs, and it would be useful to use this for scripting from standalone Rust programs.

@hayd
Copy link
Contributor

hayd commented Dec 17, 2018

see #1209 , I don't think the plan is to expose the entire v8 API however...

@Neurrone
Copy link
Author

@hayd sure, I think for most use cases, the ability to ergonomically call rust functions from javascript and vice versa and use rust structs as js classes would be enough.

I tried using bindgen to do the binding, but it kept crashing when i tried creating a new isolate, and could never figure out why.

@bartlomieju
Copy link
Member

Deno is available as a crate at https://crates.io/crates/deno.

Can this issue be closed now? CC @ry

@Neurrone
Copy link
Author

Just looked at the documentation, it doesn't look like there's a way of exposing rust objects to JS and vice versa.

@ry
Copy link
Member

ry commented May 20, 2019

@Neurrone Deno's philosophy is to only allow binary blobs (Uint8Arrays) to be passed back and forth between V8. This has very nice consequences if it is adhered to. So we will not be automatically exposing Rust objects to JS. (Though a proper FFI is on the roadmap.)

Despite the lack of documentation, https://crates.io/crates/deno is by far the most advanced Rust V8 binding out there. Please try it.

See these examples
https://github.com/denoland/deno/blob/master/core/examples/http_bench.rs
https://github.com/denoland/deno/blob/master/core/examples/http_bench.js

@ry ry closed this as completed May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants