rdunnington / bytebox Goto Github PK
View Code? Open in Web Editor NEWStandalone WebAssembly VM.
License: MIT License
Standalone WebAssembly VM.
License: MIT License
Currently the order of args is: bytebox <FILE> [WASM_ARGS]... [OPTION]...
. However, wasmtime (and other runtimes) put their option args before the wasm file like so: wasmtime [OPTION]... <FILE> [WASM_ARGS]...
. Bytebox should match this ordering to make it easier to run as a drop-in replacement, or at the very least to make it easier to compare runtimes.
To do this, in the file run/main.zig
, parseCmdOpts()
will need to be updated to account for the reordering.
By convention, init() never returns errors and just initializes the struct. We should follow this convention.
The current implementation of the wasi functions are not threadsafe, as wasi file descriptors are backed by an internal data structure that isn't threadsafe, nor wrapped by any locks. This is fine for simple programs, but more complex programs that embed bytebox may invoke wasm functions from different threads. Ideally the solution will also allow compiling thread safety out if it isn't needed to avoid the overhead in single-threaded environments.
Stack-based VMs have inherent performance limitations that are not present in register-based VMs. To reach or surpass performance of other WASM VMs, bytebox will need to implement a register-based VM. To do this, we will need to:
A quickly-hacked together powershell script is doing the work here, but only works on windows. A zig program would be portable and could call out to either a checked-in binary or require WABT on the system if one doesn't exist for the OS.
Depends on #2 to avoid writing shell script for each platform.
this would allow applications that require this mode to be ported to wasm, such as htop, MC, alsamixer and others (in fact, 95% of the software uses ncurses doing it).
(i found this in c. termios.h functions: tcsetattr tcgetattr)
wasm3 allows you to supply a wasm file and invoke a specific function, supplying it with parameteres like so:
wasm3 [options] <file> [args...]
The run exe should do the same, and utilities should be provided to autoconvert string parameters into the proper Val
types the wasm function expects, if possible.
To allow for easier integration with other projects, bytebox should provide a C wrapper around the public API. Ideally this is tested with an actual integration in another project, such as wasm4.
As of this writing, wasi-testsuite does not have full coverage of the functions in preview1, and as a result the untested functions have not been implemented. To reach parity with other runtimes, bytebox still needs to implement:
The current testsuite mirror is using an old version, it should be updated since the newer suite has some extra test cases and fixes for bugs in the tests.
Currently zig build test
runs the wasm test suite, and you have to manually invoke zig test
to run unit tests. Running wasi tests is even more of a pain where you have to manually run a python command. Ideally we have a uniform interface for running all the tests from zig build
:
zig build test
: runs everythingzig build test-unit
: only unit testszig build test-wasm
: only wasm test suitezig build test-wasi
: only wasi test suitezig build test-cffi
should build a C file that loads a wasm file and invokes a function in it, link it with bytebox.lib
, and run the exe, expecting no errors. This will ensure the FFI code paths remain exercised in CI.
Currently the wasi_rights arg is essentially ignored for most wasi calls. To be compliant with the spec, the bytebox wasi runtime should return NOTCAPABLE when functions are called for file descriptors that don't have the particular rights. Special attention should be given to preopen rights and inheriting rights.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.