[ffi] How to add native code? #53959
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
library-ffi
type-question
A question about expected behavior or functionality
I have a unique requirement, I usually develop dylibs in Rust and I always have to inject something into dylib specific functions.
When I saw napi I thought it was amazing and I spent many days studying it.
Let me first talk about my ffi needs. I want to use dart to develop a library. This library defines many functions such as
a
.I develop a dylib using Rust, and then I write in rust:
Then I do this in Dart:
I know of course that I can pass dart 's a function to b (from dylib), but that's inconvenient, and I'd like to develop some other language compatible libraries to dart.
When I researched napi I found that they implement this.
I tried using C and Rust, and after compiling Rust to a dylib, I can declare
extern "C"
in Rust to have the dylib call functions written in C code!So the question is, how to declare native functions written in Dart to dylib in Dart FFI?
The text was updated successfully, but these errors were encountered: