3 ms·
> This is why I think talking about what you're trying to achieve is more fruitful than just talking about the language you want to replace This is definitely
by tialaramex 5y ago
> This is why I think talking about what you're trying to achieve is more fruitful than just talking about the language you want to replace
This is definitely the right approach in my opinion. Even for your garbage collection example on the one hand, in some cases your program is dominated by tricky reclamation problems and the "correct" Rust program is basically 90% garbage collector, so that an existing GC language might produce faster programs; but on the far opposite scale maybe your program has tricky non-memory resource problems and GC doesn't help at all, so the GC language has worse performance and yet it makes your problem harder to solve than in Rust anyway.
One of the nice things about Rust and about C++ RAII here is that you don't care whether the resources are memory. Database handles? Aerial drones? A tape robot? These are all just resources you can wrap in an object to manage them, in both languages. "I only have 15MB of RAM" and "I only have 4 fire-fighting robots" are the same kind of problem from this perspective.
> If you want to make the point that Zig is "closer to C" compared to other language that wants to replace C, that's a fair claim to make.
This is really important. Zig is very much inspired by C. Rust has the syntax of a semi-colon language like C, but its inspirations come from all over the shop. I came to Rust having already programmed not only C and Java (and a little C++) but also Python and ML (and a little Prolog) and so this was less disconcerting. But I can see if you've literally never encountered a functional language some of Rust is weird because even though it is spelled like semi-colon languages you know it behaves very differently.
I like Rust, much more than I liked Go or Python when I picked those up. It feels less clunky. An elegant weapon, for a more civilised age.
- Zababa 5y agoFor the comparaison between C, Zig and Rust syntax, I'm honestly not that sure. People love to complain about Rust's syntax for reasons I don't really understand. Sure the turbofish is a bit weird the first time, but other than that I don't find it especially difficult. On the other hand, I still have a hard time understanding Zig code. Probably because I never really played with it, but it's just like Rust, you need to familiarize yourself a bit. Maybe people that did only C are able to get up to speed with Zig more quickly than Rust? But that seems a bit superficial, if these people are already spending most of their time with only one language, if they learn a second to spend that much time with a few hours to get up to speed with the syntax is nothing.
- tene 5y agoI'm really curious to hear any stories or more detail about how Rust can feel weird to someone without experience with functional programming concepts? One of the things I like most about Rust is how aggressively normal it feels to me, and it's really hard for me to remember what it's like to encounter this stuff for the first time.
- ngrilly 5y ago“Aggressively normal” :)