Bindings generator for Scala 3 Native
Distributed as a SBT plugin and a CLI program, this project generates idiomatic Scala 3 Native bindings to C libraries.
- Documentation
- Template
- Sample bindings and usage examples - Postgres, Sqlite, Tree Sitter, cJSON, Git, etc.
Status (March 2022): project is actively developed and maintained, interface is considered very unstable until v0.1.0
FAQ:
-
Generated bindings do not run on the JVM, only on Scala Native
-
In cases where Scala Native cannot encode certain C idioms, glue C code is generated
-
The generator itself is implemented in Scala 3 Native with some C glue code to libclang
-
Only C header files are supported
-
Due to lack of Apple M1 runners, I am not able to build binaries for that platform. For local work, you can checkout the repo at the version you want and run
$ sbt devPublish
Which will build the binary for your platform and publish it locally