# RustCall.jl?

**URL:** <https://discourse.julialang.org/t/rustcall-jl/113259>\
**Category:** Tooling\
**Created:** [April 20, 2024, 1:05am UTC](https://discourse.julialang.org/t/rustcall-jl/113259 "2024-04-20T01:05:48Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [April 20, 2024, 12:49pm UTC](https://discourse.julialang.org/t/rustcall-jl/113259/6 "2024-04-20T12:49:24Z")

</div>

I wrote this as an example, but it sounds like you already know how to do that.

> [@Simple example of calling Rust from Julia](https://discourse.julialang.org/t/simple-example-of-calling-rust-from-julia/111742):
>
> Introduction I was asked for a simple example about how to call Rust from Julia on Slack. I thought I would post it here for posterity. Just to emphasize, my goal here is simplicity. For practical use, you would probably want to use cargo with [jlrs](https://discourse.julialang.org/t/jlrs-v0-19-many-performance-optimizations/102253). That said, I do find some virtue in simple and reductionist demonstrations. The code hellojulia.rs: #[no\_mangle] pub extern "C" fn rust\_add(a: i64, b: i64) -\> i64 { return 2\*a + 3\*b } hellorust.jl const libpath = "./libhellojulia.so" hellor…

If there were some additional support, I think it would end up looking more like CxxWrap.jl.

The existence of `cargo` does seem like a significant difference though, so perhaps a Julia wrapper of some sort would make sense similar to Conda.jl.

For a Julia package though, you probably would just want to use BinaryBuilder.jl to build the the C FFI.

---

_[View the full topic](https://discourse.julialang.org/t/rustcall-jl/113259)._
