re: Nim v. Rust VIEW POST


Other differences can be:

  • Nim has inheritance, Rust has no Inheritance.
  • Nim has template, Rust do not have that.
  • Nim can generate Hardened Binaries easily, Rust can not (at least as of today, in proper way).
  • Nim can generate identifier names with backticks (like Kotlin), Rust I can not find a way to do it easily.
  • Rust has better Marketing, but enforces Trademarks on name and logo.

Lots of Rust dev still depend on NodeJS to do Frontend stuff (I know Rust can do WASM),
but still for some reason, a lot of people still depend on NodeJS and TypeScript,
if thats a Pro or Con, is opinionated, but I prefer to not fight with node_modules, etc.

More idiomatic Nim can be:

func factorial(n: int): int =
    if n == 0:
        result = 1
        result = n * factorial(n - 1)

Mainly the return type, I would add {.inline.} if was my code :P

Good comparison, nice post, I think you have more experience with Rust, both awesome languages.


Hey! Thanks for replying.
I do agree, the other differences you pointed out are key. I actually mentioned the identifier with backticks trick as stropping, turns out that's what it's officially called.
About the func vs proc—I don't know how I could forget about that. I'll actually edit the post for this.
I actually do not have more experience with Rust; I know both of them moderately well, but know a lot of stuff about them.
Really, thanks for replying, it means a lot!

Code of Conduct Report abuse