Skip to content
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 libsql_bindgen in Rust for interoperability between libSQL and WebAssembly #15

Open
psarna opened this issue Oct 5, 2022 · 0 comments

Comments

@psarna
Copy link
Collaborator

psarna commented Oct 5, 2022

WebAssembly modules are seldom coded by hand. Instead, Rust, C++, AssemblyScript and any other language compilable to Wasm is used for that purpose. In order to facilitate creating user-defined functions in Rust that work properly with libSQL types (https://www.sqlite.org/datatype3.html), we should create a crate which exposes a libsql_bindgen macro. This macro can take care of translating Rust types directly into something that libSQL understands, which would allow users to write user-defined functions for libSQL in native Rust.

Example (pseudo-Rust, subject to change):

#[libsql_bindgen]
fn append_42(input: String) -> String {
    input + "_42"
}
penberg added a commit to penberg/libsql that referenced this issue Jun 19, 2023
MarinPostma added a commit that referenced this issue Oct 17, 2023
23: replace sqlparser with lemon parser r=penberg a=MarinPostma

The PR ~makes lemonade~ replaces sqlparser with lemon-rs, which has up-to-date sqlite3 grammar and working a working code emitter.

close #15 


Co-authored-by: ad hoc <postma.marin@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant