# Integrating Julia with Rust?

**URL:** <https://discourse.julialang.org/t/integrating-julia-with-rust/121745>\
**Category:** General Usage\
**Created:** [October 25, 2024, 11:12am UTC](https://discourse.julialang.org/t/integrating-julia-with-rust/121745 "2024-10-25T11:12:04Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [October 25, 2024, 11:32am UTC](https://discourse.julialang.org/t/integrating-julia-with-rust/121745/2 "2024-10-25T11:32:27Z")

</div>

> [@benslinux](#):
>
> **Improved packaging and deployment** by incorporating Rust’s Cargo?

I think you’ll get some pushback on the idea that using Cargo would be a clear improvement over Julia’s amazing built-in packaging system.

For example, Cargo relies on [build scripts](https://doc.rust-lang.org/cargo/reference/build-scripts.html) to support non-Rust dependencies. Julia used to do this, but deployment of non-Julia dependencies was a huge pain because it relied on users having working non-Julia build systems. Nowadays in Julia we have JLL packages and [Yggdrasil](https://github.com/JuliaPackaging/Yggdrasil).

> [@benslinux](#):
>
> **Embedded Julia into Rust** using the C API or other tools?

There have been some efforts on calling Julia from Rust using Rust’s FFI, since in that sense Julia can be called like any other C library: [I wrote Rust bindings for Julia. If you're interested in calling Julia from Rust, please have a look and tell me what you think](https://discourse.julialang.org/t/i-wrote-rust-bindings-for-julia-if-youre-interested-in-calling-julia-from-rust-please-have-a-look-and-tell-me-what-you-think/34481)

And for the reverse, here’s an example of calling Rust from Julia: [Simple example of calling Rust from Julia](https://discourse.julialang.org/t/simple-example-of-calling-rust-from-julia/111742)

See also: [[ANN] Embedding Rust Library in a Julia Package](https://discourse.julialang.org/t/ann-embedding-rust-library-in-a-julia-package/15470)

I’m not sure how widely used these are; so far, it seems Julia and Rust have mostly been applied to very different kinds of software and applications.

> [@benslinux](#):
>
> **Rust’s** efficiency

The advantage of Rust vs. Julia is not really runtime efficiency (putting aside compiler latency), but the age-old tradeoffs of static typing (stronger compile-time guarantees, compact AOT binaries) vs. dynamic typing (e.g. easier exploration/prototyping, interactive JIT environments).

But there have been many “Julia vs. Rust” threads on this forum (rehashing the many decades of debates on static vs. dynamic languages), e.g.

- [Rust / Julia Comparison Post](https://discourse.julialang.org/t/rust-julia-comparison-post/75403)
- [Blog post: Rust vs Julia in scientific computing](https://discourse.julialang.org/t/blog-post-rust-vs-julia-in-scientific-computing/101711)
- [Rust vs Julia](https://discourse.julialang.org/t/rust-vs-julia/11979)
- [Comparison of Rust to Julia for scientific computing?](https://discourse.julialang.org/t/comparison-of-rust-to-julia-for-scientific-computing/78508)

So probably it isn’t productive to start yet another general thread on this topic — let’s keep this focused on interop.

---

_[View the full topic](https://discourse.julialang.org/t/integrating-julia-with-rust/121745)._
