-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Request Feature: Support direct WebAssembly import and run #6279
Comments
Duplicate of #5609 |
this nested issues has not direct vision to every one how want to help. and yes it's better to use --unstable flag for such features. |
From what I've gathered, wasm currently lacks the concept of an entry point ("main" function or top level code), so it is unclear how deno should execute the wasm module. |
I'm gonna close this issue as a duplicate of #5609, let's continue there. |
@Spoonbender Sorry for the year late ping, but a WebAssembly module is allowed to choose a function that executes immediately upon compilation, reminiscence of Linux |
It's good to directly run WebAssembly files in deno like
.js
and.ts
files. If so then I can run:deno run myTask.wasm
without any additional files and steps. (it exports a common function like
main
orstart
or ...)Also it's good to directly import these files to project with simple and readable syntax:
import { task1 } from ".../myLib.wasm"
Like this code in dev.to, it writes a simple library function called
square
and import it in.ts
file and run that.ts
file with deno.Example above can be very simpler:
can write somthing like:
It's much more readable, clean, easy to use, and also do not dirty the global context.
This simple feature enables more comfortable journey to publish libraries and write cross-platform deno apps.
The text was updated successfully, but these errors were encountered: