GithubHelp home page GithubHelp logo

Comments (8)

nilslice avatar nilslice commented on June 12, 2024 1

Hey - we don't officially support this via Extism, but you can use another tool we make, Modsurfer. Either statically, via the web0 or CLI1, or dynamically in a program using it as an Extism plugin2.

For 2, via an Extism plugin, you would call the export parse_module, passing it the bytes of your wasm plugin, and in return, the plugin will provide a Module protobuf.

We provide Go and Rust libraries, but you can also generate your own protobuf library in any language they support using the api.proto as the definition. See the files here: https://github.com/dylibso/modsurfer/tree/main/proto/v1

from extism.

Somfic avatar Somfic commented on June 12, 2024

Awesome thanks for the quick help!

from extism.

nilslice avatar nilslice commented on June 12, 2024

For sure! If you have any issues with these approaches, please let us know. I might also add another export to this plugin (would be a new .wasm) which would just list the exports by name in a JSON list ["count_vowels", "etc"] so you don't need to deal with the protobuf types... would that help?

from extism.

nilslice avatar nilslice commented on June 12, 2024

@Somfic -- ok, the Extism plugin0 (new version to download) has an export called list_extism_funcs, which just returns the exports that you can call from Extism specifically.

The usage is like:

cat plugin.wasm | extism call modsurfer.wasm list_extism_funcs --stdin | jq 
["export_1", "export_2", ...]

from extism.

slyons avatar slyons commented on June 12, 2024

I'd love to see this exposed via the Plugin API. It would be a great way to verify that the module you've been given adheres to a certain contract.

from extism.

Somfic avatar Somfic commented on June 12, 2024

I’ll reopen the issue as per slyons’ suggestion

from extism.

nilslice avatar nilslice commented on June 12, 2024

I agree it would be convenient, but would recommend using the modsurfer plugin approach for now. Mainly since it could be some time until we decide to implement this especially across all the runtimes and SDKs.

from extism.

Somfic avatar Somfic commented on June 12, 2024

Will use the modsurfer plugin for now then! :)

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.