indoorvivants / sn-bindgen   0.0.14

Website GitHub

Scala 3 native binding generator + libclang facade

Scala versions: 2.12 2.13 3.x
Scala Native versions: 0.4
sbt plugins: 1.0

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.

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