Comments (3)
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.
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.
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)
- Is it works faster then JavaScript? HOT 4
- What is stopping support for `wasm32-unknown-unknown` for `quickjs-wasm-rs`? HOT 1
- Dependabot not picking up NPM dependencies for javy and javy-cli NPM packages HOT 1
- GitHub Action for Dependabot PRs to run cargo vet HOT 3
- How to call host functions from javascript? HOT 2
- BigUint64Array some large numbers broken in wasm32-wasi HOT 2
- Uncaught Error: Dynamic require is not supported HOT 6
- Update to latest quickjs? HOT 3
- Avenues for rich host functions HOT 7
- Feature Request: Ability to Change Brotli Compression Level via CLI HOT 3
- Stop using cargo-wasi
- Where can a dynamically linked WASM run? HOT 3
- Can javy receive command line args / env. Are they in scope? HOT 10
- Can't build javy main branch on Ubuntu 23.10 HOT 10
- imports HOT 7
- Imported functionallity from the host HOT 2
- Expose Rust structs to JavaScript as classes HOT 8
- [quickjs-wasm-sys] `JS_DupValue` is missing HOT 3
- [quickjs-wasm-rs] Should the closure passed to `wrap_callback` return `JSValueRef`? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javy.