deno_bindgen
deno_bindgen copied to clipboard
feat: language agnostic rust codegen
⚠️ WIP! ⚠️
This PR addresses #43, #4, #23 by implementing a new codegen in rust which in turn will be used by the macro and in the future extensions to deno bindgen which could enable for example c header support.
Todo:
- [ ] Make the macro use the
codegencrate - [ ] Update the CLI (it will have to be converted to rust to use the new
codegen) - [x] Library loader
- [x] Deno
- [x] Plug
- [x] Function generation
- [ ] Into
- [x] Primitives
- [x] Pointers
- [x] Buffers
- [x] CString
- [x] Type aliases
- [x] Structs
- [x] Tuples
- [ ] Enums
- [ ] Arrays
- [ ] From
- [x] Primitives
- [x] Pointers
- [x] Buffers
- [x] CString
- [x] Type aliases
- [x] Structs
- [x] Tuples
- [ ] Enums
- [ ] Arrays
- [ ] JSON/serde fallback?
- [x] Packed structs?
- [ ] Automatic minification and or formatting?
- [ ] Flexible array members?
Previous works, references and resources:
- https://github.com/rustwasm/wasm-bindgen
- https://doc.rust-lang.org/nomicon/other-reprs.html
- https://github.com/rust-lang/rfcs/blob/master/text/2195-really-tagged-unions.md
- https://github.com/sunshine-protocol/dart-bindgen
- https://github.com/dart-lang/ffigen
- https://github.com/denosaurs/plug
- https://github.com/rust-lang/rust-bindgen
- https://github.com/eqrion/cbindgen
- https://github.com/infinyon/node-bindgen
@eliassjogreen maybe the new CLI should be a custom cargo subcommand? https://github.com/rust-lang/cargo/wiki/Third-party-cargo-subcommands I want to avoid distributing native binaries.
@littledivy Yep I agree, that sounds like a wise choice
Closing because stale and merge conflicts.