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

create bindings for isolates #8

Open
tusharmath opened this issue Jan 24, 2024 · 2 comments
Open

create bindings for isolates #8

tusharmath opened this issue Jan 24, 2024 · 2 comments

Comments

@tusharmath
Copy link

Hey! Thanks for this amazing library!

There are a few use cases where we are using mini-v8 and have reached a dead end when it comes to using isolates. mini-v8 doesn't have support for it, and it's quite a useful feature, especially for us where we are embedding v8 into our Rust application. We need to fire and run js in multiple contexts, moreover we also need to integrate it with https://crates.io/crates/serde_v8

@SkylerLipthay
Copy link
Owner

Hi there. In what way do you mean using isolates? Each MiniV8 instance is backed by its own V8 isolate, and there's no problem with creating multiple MiniV8s side-by-side. Do you mean exposing the internal v8::Isolate in some way? I fear this would lead introduce many complications.

Instead of trying to match the interfaces of serde_v8 and mini-v8, I would recommend creating a serde layer specifically suited to mini-v8. This should only amount to a few hundred lines of code; I did something similar a while ago for my ducc library.

@tusharmath
Copy link
Author

@SkylerLipthay How would it perform if we create MiniV8 instance in hot code, in comparison just running a mini_v8::Function in that path? From what I could gather, we need to pass the script for each instance, which could take sometime to execute.

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