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

portable bindings #9

Open
dominictarr opened this issue Jun 7, 2016 · 4 comments
Open

portable bindings #9

dominictarr opened this issue Jun 7, 2016 · 4 comments

Comments

@dominictarr
Copy link

looking at the code here:
https://github.com/creationix/nucleus/tree/master/implementations/duktape/duv

it looks like that is coupled to libuv and duktape, and wouldn't that mean that you would also have to rewrite that binding when you introduce jerryscript and others

That might be acceptable for if we only need to do it for libuv, but there are lots of other useful C libraries (leveldb and libsodium are the first I'll be needing)

What sort of approaches can be made so those bindings are generic,
that it doesn't matter if I use jerryscript but the author of a binary lib that I use uses duktape?

@creationix
Copy link
Member

creationix commented Jun 7, 2016

I'm not sure we can make bindings be portable across all the engines. Their bindings use wildly different techniques/styles and even different languages (forth style stack machine in C vs C++ smart pointers for example). My plan is to standardize on the interface exposed to the JS and then write the bindings in whatever manner works best for each engine.

@creationix
Copy link
Member

Now that I'm going down the road of using as much rust as possible, I think the bindings will be more portable. At least the rust-libuv bindings will be reusable across all backends written in rust.

@dominictarr
Copy link
Author

wait, you are not reimplementing libuv in rust though, right?
you are just writing nucleus in rust, so duktape is still C, right?

@creationix
Copy link
Member

right

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

2 participants