HigherOrderCO / Bend

A massively parallel, high-level programming language
https://higherorderco.com
Apache License 2.0
17.4k stars 427 forks source link

Creating Rust packages and import to Bend #653

Closed AndreyMihaylovDron closed 3 months ago

AndreyMihaylovDron commented 3 months ago

Hi, is it possible today to create package on rust and then import to bend as library or something?

developedby commented 3 months ago

Yes, but you need export your Rust function into a dynamic library with C interfaces, and wrap your functions with adapters for communicating and converting your values for the HVM.

You can read how to do that here https://github.com/HigherOrderCO/Bend/blob/main/docs/ffi.md. We're still working on refining the ffi interfaces, so you can expect it to become easier to write your bend libraries in other languages in the future

AndreyMihaylovDron commented 3 months ago

This is cool, thanks!