Optimize client crate development using FFI #258
BirnadinErick
started this conversation in
Ideas
Replies: 1 comment
-
For caller-callee mechanism how about do everything in rust side the usual way and return the result in string (JSON-format) and parse it in caller ( Or may a struct like this? struct SurealResponse {
time: f32,
result: serde::Value | &str,
status: bool,
} And rust would communicate with SUrrealDB using websockets? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Wouldn't it be nice to have a single client library written in rust and then use FFI to use them in other programming languages like C and go? I was just 🤔!
How (a vague idea)
Write the library in
rust
, then build platform specific shared object like.so
for *nix &.dll
for Windows.Or some other way? Rust already has docs to do it with
C
itself, docs, using FFI. Hopego
would have same feature too.Advantages
rust
's Borrow checker than own mem-management inC
orgo
's garbage collector (I think this is better for performance? idk)Disadvantages
C
orgo
like raw-pointersBeta Was this translation helpful? Give feedback.
All reactions