Student | Prerak Mann - github@mannprerak2, Linkedin@mannprerak2, mannprerak2.github.io |
Project Entry | summerofcode.withgoogle.com/archive/2020/projects/6706610564497408 |
Project Repository | github.com/dart-lang/ffigen |
Pub package | pub.dev/packages/ffigen |
FFIGEN is a .h
to .dart
bindings generator which makes it easier to use a C library with dart:ffi
.
Consider LibClang(C interface to Clang). The C headers in LibClang's API source code is ~8k LOC. If you were to generate dart bindings for LibClang it amounts to almost ~4.5k LOC. With FFIGEN , all you need to do is pass in a small yaml config file which is less than ~20 LOC and simply generate the bindings.
Users can control what C functions to generate, rename macros, enums, and individual struct members using simple regular expressions. It can also generate array members nested in structs (which are not supported in dart:ffi
yet).
Check out github.com/dart-lang/ffigen for a complete list of configurations, FAQs, examples, etc.
The project was completed from scratch, under the guidance of my mentor Daco Harkes @dcharkes.