Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I program in Python by day. Racket is probably the language I know best after Python, then maybe Groovy. I've had exposure to R, C, C++, D, Java, Common Lisp etc, and I find it easier to pick up new languages due to my familiarity.

While Rust has all the constructs that I'm used to from these other programming languages, I find Rust to be the most difficult one for me to learn in recent memory. The documentation is great, the book is great, the tooling with Cargo is great, but after getting through the first 15 chapters in the Book I struggled to write a program that had any sort of complexity. Sure I can add a dependency super easily to my project, but figuring out what errors everything in the library throws takes a lot of work. Sometimes I get confused about using panic!, expect, unwrap, or ? when I'm writing my own functions or interfacing with others. Swimming through the myriad of traits on different structs is confusing, and I sometimes get tripped up passing closures. And don't get me started on Macros, with great shame, they still have not clicked for me, in Lisp, or in Rust. The language just feels very different from what I'm used to, and I've never had such a hard time getting code I've written to compile correctly. I'd be totally lost without all the help from the subreddit and the book, and I appreciate everyone who has helped me.

I know this will get easier... and it has. But it will take longer for me to get comfortably with Rust then it has for other programmings languages in the same time period. This is not to say that it's a bad language. I remember one day after having debugged a Python issue that ended up being a stupid logic error on my part I exclaimed "I wish I knew a programming language that would save me from myself". I think... Or rather I hope Rust is that language in the long term for me



I think you missed some Haskell (or some other functional / category-theorish language) in your baggage of languages.

Coming from Haskell, Rust felt like a weird C-like home.

It's a weird marriage, but it makes for a language which make very predictable software imho


> The language just feels very different from what I'm used to

The reason it feels very different is... because it is very different. Then why does it feel off? Because, while it is very different, it doesn't look very different. Then why doesn't it look very different, when it is very different?

That's because, Rust developers spent conscious effort to make Rust look similar. So feeling something is off with Rust is the result of intentional design of Rust developers. In a sense this is dishonest and deceiving, but Rust without similarity engineering would be considerably less popular and hence less successful.

Rust's ambition was to change the world, not simply to discover a way to change the world and leaving actual changing to others. (Although changing the world requires discovery first.) So Rust chose to "lie".

As an example, Rust's assignment(=) looks similar, but works very different. In fact, since it is very different, it was originally written <-. It was changed to = specifically to make it look similar.


Another example is std::mem::swap. In the world of affine type system which Rust uses, swap is a primitive on an equal footing with assignment (which is actually called move). So naturally, move was written <-, and swap was written <->.

But <-> weirded people out, and people complained why Rust has so many special and strange operators. So Rust developers made it look similar to a library function. But it still is a primitive: it is impossible to implement swap yourself in safe code.

The result is that people use swap much less than they should, either because they are not aware of it, or because they think it is a specialized library function for special cases. This is significant and large cost. But it is still less than cost of looking weird. All because people won't even try languages with <->. Alas.


One of the side-effects of this is that, Reading Rust code is painful.. it is a bit like reading old perl or haskell code you haven't looked at. Especially when rust is not the day job it gets complicated/painful to remember the distinctions between "=" in say python(that's what i use most) vs "=" in rust. This is not necessarily a bad thing, but it does contribute to that previous posters' point out finding errors or bugs from libraries being used hard to find or fix. Once again, I don't care much for go, but rust is one of the languages that excite me, but trying to level up in rust(beyond the trivial tutorial code/projects) seems to need a dedicated "maker time' schedule rather than spending 30 mins- 1 hour spare time in between distractions from children.


> it was originally written <-. It was changed to = specifically to make it look similar.

That's actually kinda disappointing, I use <- in my pseudocode.

(I don't know Rust though, so I can't comment on their choice for the language)


I program in Python at my job and Rust in a hobby project. It surprised me how easy and productive actually Rust is, and I was really very sceptical initially. I know it is very subjective, and possibly a result of my longer exposure to statically typed languages, but simply Rust felt quite natural to me, while Python still feels very quirky, irregular and sometimes outright annoying, despite me spending more time with Python than Rust.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: