-
Notifications
You must be signed in to change notification settings - Fork 227
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
Implement a WebAssembly runner function #17
Comments
The advantage of choosing Wasmer IMO is mainly the Singlepass backend - it helps with the compilation speed for functions that are large or only need to run once. Haven't checked the Cranelift backend performance for a while - I would assume they are evolving towards similar numbers ATM. |
Wasmtime and Wasmer both support wasm-c-api (with some custom extensions) btw. |
I gathered my experiments in a repository: https://github.com/psarna/libsql_run_wasm_example. I'll later proceed with integrating it into libSQL core, but that will be lots of preprocessor macros and configuration boilerplate to make sure that it also builds fine for people not interested in WebAssembly integration. And the feature itself should definitely be opt-in during compilation, because the Wasm runtime weighs an order of magnitude more than the entire sqlite3 codebase. |
mvcc: implement OP_Rowid
fly: simplify user guide by switching to the HTTP API
A user-defined function capable of running WebAssembly code should be defined (and registered with
sqlite3_create_function
).Its final specification should be subject to discussion, but the proposed format could look like that (pseudo-code):
The function would accept a blob with compiled WebAssembly as its first argument, the Wasm function name to look up and execute as the second argument, and forward the rest of the arguments as is to this Wasm function to be executed.
This function can later be a foundation for allowing users to create and register arbitrary Wasm functions right from the CQL interface (esp. with some syntactic sugar to make it pretty: #18).
An important design decision is to pick a WebAssembly runtime for executing the modules. A preliminary list to consider:
Right now I'm biased in favor of wasmtime, but since I saw @losfair's activity in this repository (welcome!!!) I can't resist asking - would you recommend wasmer instead? Any recommmendations for/against it?
The text was updated successfully, but these errors were encountered: