ML with FFI
Suppose you wish to do some machine learning stuff with Deno, would it be optimal to use FFI with C over Rust?
8 Replies
That may be a strange thing to ask but I was just curious as someone who knows less C than Rust.
Haven't tried FFI with C so wanted to know if it was worth it.
yep, definitely
there's https://github.com/denosaurs/netsaur which has a C backend
although much WIP atm but for simple models its performance is on par with tensorflow and even better
Guess I gotta learn some C then
don't really need to, Rust can be used as well
I specifically had that doubt because Netsaur seemed cool and my rust FFI was like 1.7x slower than JS code itself
Tho it's mostly just me and my bad code
yea language shouldn't matter here, there must be something with the code
Certainly
I guess I'll go try to improve my rust code then
Thanks btw
np, and btw make sure your ffi calls go through fast api otherwise they'll be just slow