I am on the fence between rust and Odin. Help push me off

I was introduced to “systems” programming through rust. I was a python script kiddy before and I was tired of not understanding what the hell is going on “under the hood” and solving every problem with “pip install solution”. I tried going straight to C, but the build complexity and FUD about memory safety scared me off. Then I tried rust and it was great. It took me a while to get the hang of move semantics and ownership, but once those clicked I finally felt like I was doing “real” programming. I started writing a relational database server, to touch on as many aspects of low-level cpu programming as I could think of and that has been extremely rewarding.

Since then I have learned a staggering amount about programming and computers. I discovered Odin and finally “learned” C. Now rust is starting to piss me off more and more. The compile tile is very frustrating if you ever have to do a full rebuild, which happens quite often, and even with an incremental build my 10k line project takes about 2-5 seconds to compile on my shitty old laptop. The rust people’s insistence on ooping all their libraries makes using them very annoying. The borrow checker gets increasingly annoying as I become a better programmer and start to want to take more control over my programs memory model. There are whole sections of the language that I avoid like the plague (async, macros, most traits).

Nevertheless, I have not made the switch to Odin. I use very few dependencies, but the ones I do use it’s very convenient to be able to just cargo add them and there are some very good libraries. My project is a database which is inherently about shared data access so rusts threading guarantees are very useful. I really like the move semantics since they make it easier for me to reason about the “location” of data. Rusts portable_simd module, while still a nightly feature, is very good and seems to be able to optimize my simd code to use better aligned loads and not need so many loadu instructions. The way rust gives access to simd intrinsics like the aes-ni is very nice, if a bit verbose. The language is very mature already and the tooling and compiler messages are actually excellent.

Would anyone like to try to convince me to switch to Odin fully? I’ve tremendously enjoyed coding in Odin, I’ve written maybe 2k lines of it, but it’s not without downsides. Help me get off the fence

Tl;dr: Convince me that rust sucks and Odin is the best.

1 Like

For me Rust is the “Java” or “Typescript” for system languages. So if you want something more verbose and C++ like you can go for Rust.

If you want something more succint and more similar to “Go”, you can choose Odin.

The main differences between the two appart from the verbose syntax of Rust compared to Odin. Is that

  1. Rust does not need bindings to C.
  2. Rust have more “libraries” and huge amount of books and learning resources.
  3. Rust can compile to older systems than Odin (Home · rust9x/rust Wiki · GitHub)
  4. Rust have more dependencies and require more configuration tools than Odin.

For me I choose Odin instead of Rust or Zig, because is more simple to understand, at least for me and I liked very much how the packages are organized and the proc declarations. I feel like I could learn Odin in a few hours, instead of months.

Rust feels overly complex to me and if Odin can run in my main systems and projects then Odin is ok for me.

PD: You can always bind rust and C libraries if you need something that is not available for Odin.

2 Likes

I think convincing anyone about what language to use is bad.

Pick a language that fits the problem domain and its benefits outweighs the language/ecosystem annoyances. If it is rust, use rust, if not use whatever else…

If I were you, I’d just write more Odin until I figure out where it’s located on the benefit-annoyance scale compared to rust.

edit: typo

6 Likes

rust compile times are insanely slow. if you develop by iterating a lot, you will go insane.

Rust memory safety approach makes doing some data structures will be hard and challenging without unsafe block.

like circular linked list, graph, quadtree, and octree.

And, it will be hard for games that uses custom allocators, some games might be have own subsystem dedicated to memory management, doing that is nearly impossible without unsafe block in Rust.

I have no problem with using unsafe blocks.