Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sachaarbonel/dodge

To be : bridge Dart and Rust code with ease through proc macros
https://github.com/sachaarbonel/dodge

dart ffi generator proc-macro proc-macro-attributes rust

Last synced: 28 days ago
JSON representation

To be : bridge Dart and Rust code with ease through proc macros

Awesome Lists containing this project

README

        

# A set of proc macros for generating a C API automatically

## Usage

```rust
use dodge::wrapper;

#[wrapper]
fn add(a: i32, b: i32) -> i32 {
a + b
}

// Expand to
// fn add(a: i32, b: i32) -> i32 { a + b }
// #[no_mangle]
// pub extern "C" fn rust_add(a: i32, b: i32) -> i32 { add(a, b) }

fn main() {
add(1, 2);
}

```

# TODOs
- [x] function
- [ ] method
- [ ] class
- [ ] list all public facing struct, impl traits of a trait etc and generate wrapper around them