GithubHelp home page GithubHelp logo

Support a WASI reactor target about javy HOT 3 OPEN

andrewmd5 avatar andrewmd5 commented on June 26, 2024
Support a WASI reactor target

from javy.

Comments (3)

saulecabrera avatar saulecabrera commented on June 26, 2024

Javy-generated modules, are WASI-compliant by default. More concretely, Javy-generated modules are Commands, which according to the WASI specification:

A Command has a "main" function, and when this function returns the program terminates.

The main function referenced in the specification is the exported _start function; in that sense, calling any other function after calling _start will result in a panic. In theory we could make Javy modules be configurable (either a Command or Reactor) if that's something that you need for your use-case.

from javy.

andrewmd5 avatar andrewmd5 commented on June 26, 2024

Right, I figured that was the case. The reason for my issue is because if we look at say TinyGo's WASM/WASI target, it requires you to call _start before calling any other methods and in reality behaves like a reactor even though it is a command module (they're currently working on a reactor compile target.)

Why this is relevant is my use-case loads extensions written in any programming language which are compiled to a WASI module, and we have to workaround and support the various calling conventions and ceremony each compiler requires since everyone is fast and loose with the standards.

So, with that being said, a reactor target would be great for Javy so we can have setup code and still call exported functions.

from javy.

saulecabrera avatar saulecabrera commented on June 26, 2024

If you're willing to work on a PR to add this functionality, I'd be happy to review it.

from javy.

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.