Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/indoorvivants/sn-bindgen
Scala 3 native binding generator + libclang facade
https://github.com/indoorvivants/sn-bindgen
bindings c generator sbt scala scala-native
Last synced: 3 days ago
JSON representation
Scala 3 native binding generator + libclang facade
- Host: GitHub
- URL: https://github.com/indoorvivants/sn-bindgen
- Owner: indoorvivants
- Created: 2021-12-26T14:09:46.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-27T07:47:11.000Z (6 months ago)
- Last Synced: 2024-07-27T08:34:28.720Z (6 months ago)
- Topics: bindings, c, generator, sbt, scala, scala-native
- Language: Scala
- Homepage: https://sn-bindgen.indoorvivants.com
- Size: 2.57 MB
- Stars: 77
- Watchers: 1
- Forks: 8
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bindings generator for Scala 3 Native
[![bindgen-interface Scala version support](https://index.scala-lang.org/indoorvivants/sn-bindgen/bindgen-interface/latest.svg)](https://index.scala-lang.org/indoorvivants/sn-bindgen/bindgen-interface)
Distributed as a SBT plugin and a CLI program, this project generates idiomatic
Scala 3 Native bindings to C libraries using libclang.- [Documentation](https://sn-bindgen.indoorvivants.com/index.html)
- [Template](https://github.com/keynmol/sn-bindgen-template)
- [Sample bindings and usage examples](https://github.com/keynmol/sn-bindgen-examples) - Postgres, Sqlite, Tree Sitter, cJSON, Git, Lua, Redis, RocksDB, DuckDB, libuv, Cmark, s2, OpenSSL, etc.**Status (February 2024)**: project it actively maintained, and is used in several applications
- Generates glue C code to work around Scala Native's missing interop features
- Strongly typed (where possible) interfaces to structs, unions, and functions
- Supports named enums
- Collects unnamed enums into a single location
- Extra flags to work around compiler deficiencies