top | item 44937048

(no title)

bilkow | 6 months ago

(not your parent commenter)

> For me, programming is about corralling motivation more than anything else. Rust saps my motivation is ways that Zig does not.

Yes, agree with you a lot! Maybe our brains are just wired differently, for me, no other language (until now) gives me as much motivation as Rust, as it's type system and docs make me feel really good.

> Zig is simply a much smaller language than Rust. I use Zig because my brain isn't big enough for either C++ or Rust.

Disclaimer: haven't really tried Zig yet. IMO you don't need to keep the whole of Rust in your brain to use it, I usually can just focus on the business logic as if I make a stupid mistake, the compiler will catch it. That (and the type system) is what makes me more efficient with it than other langs. I also stay clear of lifetimes unless I really need them (which is almost never for application code). An extreme example of the opposite is C, where I need to take care about anything I do as it will just accept anything (e.g. auto casting types) so I need to be vigilant about everything.

All of that said, there are patterns that will just be harder to reason about in Rust, mostly with self-referential things, and if you area already used to using them a lot, this can be a hassle. If you're used to smaller data structures and data-oriented programming, it will be a lot easier.

This is not trying to convince you or anyone else, just showing a different perspective. If you feel better with Zig, use it! Everyone has their own experience.

discuss

order

hardwaresofton|6 months ago

> All of that said, there are patterns that will just be harder to reason about in Rust, mostly with self-referential things, and if you area already used to using them a lot, this can be a hassle. If you're used to smaller data structures and data-oriented programming, it will be a lot easier.

Also an underrated chance to be forced to learn about Arenas, most of the time.

GoblinSlayer|6 months ago

Simple data structures are easy to handle though, KISS rulez. You need rust when you write something comically complex like servo, that's when you need all the checks.