Julia == rust + dynamic_typing + JiT + GC?

Dabbling in Julia and then recently beginning to learn rust, it seems to me that the two languages have a lot in common.

My impression now is that the most fundamental differences are that Julia has:

  • dynamic typing
  • JiT compilation (as opposed to ahead-of-time)
  • garbage collection

Each of these design decisions has tradeoffs. For example, dynamic typing means Julia is flexible, while Rust’s static typing means its compiler can emit rich ahead-of-time feedback.

Of course there are other differences, e.g. syntax or convention around how traits are defined, but those differences feel like they’re only skin deep.

Is my list above missing anything?

Multiple dispatch:

My impression was that, while rust functions don’t have multiple dispatch, generic rust traits can have multiple dispatch, which lets you accomplish pretty much the same thing (though it’s more verbose).
For example:

impl MyTrait<i32, &str> for MyStruct {
  fn foo(self, x: i32, y: &str) { ... }
}
impl MyTrait<u32, String> for MyStruct {
  fn foo(self, x: u32, y: String) { ... }
}

For comparisons of Julia and Rust, see e.g.

Probably it isn’t productive to start another general thread on this topic.

5 Likes

I’m fairly confident that overloads like that are resolved entirely statically in Rust, which makes it not dispatch of any kind, let alone multiple. Syntactically similar, expressively very different.

6 Likes