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

Deno support #51

Open
Stephan-C opened this issue Apr 5, 2021 · 3 comments
Open

Deno support #51

Stephan-C opened this issue Apr 5, 2021 · 3 comments

Comments

@Stephan-C
Copy link

Would it be possible to create a deno port? This might be useful: https://dev.to/craigmorten/guide-to-porting-node-modules-to-deno-41cd

@josephg
Copy link
Owner

josephg commented Apr 5, 2021

I'd love to. The javascript code should mostly work without issue. The problem is porting the native bindings to deno.

It looks like deno has merged a patch to support native plugins but I can't find any documentation on it. We're blocked by this trifecta:

  1. Foundationdb doesn't have a published network protocol. If it did, we could write a fdb client in plain javascript and run that in deno.
  2. FDB's native client library doesn't support wasm. If it did, we could compile the fdb client API to wasm and include that from nodejs and deno. (And then we wouldn't need separate builds for windows/mac/linux/freebsd/etc.
  3. As far as I can tell, deno has no support for napi (node's native module API). If it did, the current native code could be imported and used as-is from deno.

Generally making noise about 1 and 2 in the fdb forums would be helpful if you want to get the ball rolling. Or doing the work yourself - I don't know enough about wasm-ir to port the pure assembly parts of the fdb client codebase to wasm.

If deno has its own native plugin API, maybe we can make an alternate version of the native code specifically for deno. But porting the native code to a different API will be a lot of work.

@rojvv
Copy link

rojvv commented Mar 10, 2023

Can't this be done using FFI?

@rojvv
Copy link

rojvv commented Mar 17, 2023

https://github.com/roj1512/foundationdb_deno might be interesting. I’ve recently worked on it.

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

3 participants