# Does knowing Rust make you a better Julia programmer

**URL:** <https://discourse.julialang.org/t/does-knowing-rust-make-you-a-better-julia-programmer/122668>\
**Category:** Offtopic\
**Tags:** rust\
**Created:** [November 15, 2024, 9:41am UTC](https://discourse.julialang.org/t/does-knowing-rust-make-you-a-better-julia-programmer/122668 "2024-11-15T09:41:03Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [November 16, 2024, 10:37pm UTC](https://discourse.julialang.org/t/does-knowing-rust-make-you-a-better-julia-programmer/122668/17 "2024-11-16T22:37:39Z")

</div>

> [@rafael.guerra](#):
>
> Could [FilePathsBase.jl](https://github.com/rofinn/FilePathsBase.jl) be of interest?

> [@Blog post: Rust vs Julia in scientific computing](https://discourse.julialang.org/t/blog-post-rust-vs-julia-in-scientific-computing/101711/87):
>
> Can you show some example(s) of those type instabilities in cases where they are actually relevant (not by design)? I think type instabilities that are by design are still problematic. For one, they prevent static analysis of your program. Both by blocking inference and by spamming the JET output so you miss the real issues Eventually, they might also prevent compilation of your program to static binaries (but let’s see). Some examples of this are: Spurious instabilities in Base. These ten…

@jakobnissen and others have also mentioned the lack of composibility because it’s not adopted ecosystem-wide.

EDIT: There is a good discussion in this Discourse post: [Better handling of pathnames](https://discourse.julialang.org/t/better-handling-of-pathnames/36792)  
One comment asked why methods are not included for functions taking filenames in `Base`. I started from scratch following the example of Rust’s `std::path` with a type `Path` and `PathBuf`. It was relatively little work to add wrapper methods for many functions in `Base` (that for some reason are not wrapped in `FileSystemBase`). `PathBuf` is used for constructing paths and wraps `IOBuffer`. Rust’s `std::path` is more focused on efficiency and minimizing allocation. It may also be simpler in a way than `FilePathsBase`. There is no equivalent of a type hierarchy (which would be implemented with traits). It’s just two types each of which wraps a string. (Rust’s approach to mutability means it doesn’t need an `IOBuffer` for `PathBuf`.) A large amount of `std::path` wouldn’t make sense in Julia because of different language semantics. Still, I think it’s worth exploring. But I can’t invest much time at the moment.

---

_[View the full topic](https://discourse.julialang.org/t/does-knowing-rust-make-you-a-better-julia-programmer/122668)._
