Giter Site home page Giter Site logo

Deno support about extism HOT 5 CLOSED

extism avatar extism commented on May 12, 2024 1
Deno support

from extism.

Comments (5)

bhelx avatar bhelx commented on May 12, 2024 1

One point of discussion amongst the team was whether we should try to make a universal JS library that switches out the FFI library depending on the platform, or we should just make 1 SDK per runtime (e.g. node, deno, bun). Any input on this decision would be helpful. Has anyone ever created a library that works on all of them and uses FFI?

from extism.

lukevp avatar lukevp commented on May 12, 2024 1

I think the most maintainable way forward would be to have a single Typescript interface implementation that is used by node/deno/bun and wrap the FFI-specific code behind that implementation per host runtime. I haven't done any FFI based implementation though so I'm not sure what this would look like.

from extism.

nilslice avatar nilslice commented on May 12, 2024

This is definitely something we want to do. I was planning on starting it tonight actually.

Do you think the API should be mostly the same as the Node.js one? I'm not so familiar with Deno but think there are maybe some other types/patterns that could be used.

EDIT: I have not yet started this, open to PRs or suggestions on implementations!

from extism.

nilslice avatar nilslice commented on May 12, 2024

It's also worth considering the possibility of re-using the Extism browser-runtime, which is an implementation of the rust runtime on top of JavaScript-native WebAssembly APIs. If each of Bun/Deno/Node use the same APIs for WebAssembly, it might be advantageous to instead work on converging the browser runtime to this "universal" JavaScript SDK.

from extism.

bhelx avatar bhelx commented on May 12, 2024

For anyone landing on this issue, I was able to get it to work pretty easily by just using the browser runtime as @nilslice mentioned. All you need to do is import it like a normal npm package:

import { ExtismContext } from "npm:@extism/[email protected]"

See some more docs here: https://extism.org/docs/integrate-into-your-codebase/browser-runtime-sdk

I'm going to close this in favor of more focused discussions to come later. Perhaps there is more we can do to better integrate with Deno.

from extism.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.