Giter VIP home page Giter VIP logo

deno-wasi's Introduction

WebAssembly System Interface implementation for Deno

This package provides an implementation of the WebAssembly System Interface for the Deno TypeScript runtime.

Status

This is a work in progress so if a function isn't implemented, hit refresh.

Name Status Notes
args_get
args_sizes_get
environ_get
environ_sizes_get
clock_res_get
clock_time_get
fd_advise This has no obvious path to implementation at this time.
fd_allocate This has no obvious path to implementation at this time.
fd_close
fd_datasync This is blocking on getting fdatasync(2) implemented upstream in Deno.
fd_fdstat_get This currently does not write flags and rights as we do not track those at the moment.
fd_fdstat_set_flags This has no obvious path to implementation at this time.
fd_fdstat_set_rights
fd_filestat_get This is blocking on getting fstat implemented upstream in Deno.
fd_filestat_set_size This is blocking on getting ftruncate implemented upstream in Deno.
fd_filestat_set_times
fd_pread
fd_prestat_get
fd_prestat_dir_name
fd_pwrite
fd_read
fd_readdir
fd_renumber
fd_seek
fd_sync This is blocking on getting fsync(2) implemented upstream in Deno.
fd_tell
fd_write
path_create_directory
path_filestat_get
path_filestat_set_times
path_link
path_open Opening directories is not portable
path_readlink
path_remove_directory
path_rename
path_symlink
path_unlink_file
poll_oneoff
proc_exit
proc_raise
sched_yield
random_get
sock_recv
sock_send
sock_shutdown

Example

import WASI from "https://deno.land/x/wasi/mod.ts";

const wasi = new WASI({
	args: Deno.args,
	env: Deno.env,
});

const binary = Deno.readAll("command.wasm");
const module = await WebAssembly.compile(binary);
const instance = await WebAssembly.instantiate(module, {
	wasi_snapshot_preview1: wasi.exports,
});

wasi.memory = module.exports.memory;

if (module.exports._start) {
	instance.exports._start();
} else if (module.exports._initialize) {
	instance.exports._initialize();
} else {
	throw new Error("No entry point found");
}

deno-wasi's People

Contributors

caspervonb avatar

Watchers

James Cloos avatar  avatar

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.