hhstore / blog

My Tech Blog: about Mojo / Rust / Golang / Python / Kotlin / Flutter / VueJS / Blockchain etc.
https://github.com/hhstore/blog/issues
295 stars 24 forks source link

Mojo FFI: Mojo Call XXX - Binding C/C++/Rust libraries to Mojo libraries. #432

Open hhstore opened 1 month ago

hhstore commented 1 month ago

📖 Abstract:

💯 Related:

hhstore commented 1 month ago

Mojo FFI 方案

🌞 Mojo Call XXX

工具人语言(C/C++/Rust)

🌝 YYY Call Mojo

👇🏻 说明 - ✅ `YYY`: 不限,可以是 `Python/Go/Java`, 也可以是 `C/C++/Rust/Zig` 等。 - ✅ 把 `Mojo 库` binding 成 `其他语言库`, 供`其他语言`使用。 ### Python Call Mojo - 当前是 `subprocess` + cmd 方式来调用,后续应该有更简单方案。 ### Rust Call Mojo - 待支持
hhstore commented 1 month ago

Mojo FFI: 🔥 Call C/C++

hhstore commented 1 month ago

Mojo FFI: 🔥 Call Rust

Mojo 侧

Rust 侧

🛠️ Rust 工具链

💼 Rust FFI 示例项目

项目案例:

🛑 注意事项

🙅🏻 内存泄漏问题

🙅🏻 数据类型转换

hhstore commented 1 month ago

1

hhstore commented 1 month ago

1

hhstore commented 1 month ago

1

hhstore commented 1 month ago

1

hhstore commented 1 month ago

1