3 ms·
> The way I would summarize Rust is: it’s a better Go, or a faster Python That's an interesting take. I feel like all three of these languages fit into pretty
by apitman 2y ago
> The way I would summarize Rust is: it’s a better Go, or a faster Python
That's an interesting take. I feel like all three of these languages fit into pretty discrete lanes that the others don't. Python for quick hacking or scientific stuff, Go for web services and self-contained programs, Rust for portability (specifically sharing code as C ABI or WASM) and safety.
> It’s not hard to learn
I agree Rust is easy to learn. I've done it 4 or 5 times now.
- dominicrose 2y agoPython requires less lines of code (much less?). Comparing Ruby with Python wouldn't shock me.
- steveklabnik 2y agoReally depends on what you're doing, and how you write the Rust. I'd never claim this is always true, but Rust can be pretty concise depending on what you're doing. See this previous comment of mine, which links to some others with an example I've evolved over time on this forum: https://news.ycombinator.com/item?id=42312721 https://news.ycombinator.com/item?id=42312721
- kelafoja 2y agoI agree, there are only superficial similarities. Like they're all 3 C-based. And Go and Rust both compile to machine code. I believe once one of the creators of Go mentioned that it felt to some users "like a faster Python". But I have no clue how Python relates to Rust in any sense, I fail to see any similarities. In fact, I would almost be inclined to say that Python and Rust have more differences than similarities.
- woadwarrior01 2y ago> I would almost be inclined to say that Python and Rust have more differences than similarities. This is somewhat of a stretch: dyn Traits in Rust are sort of like compile time duck typing. OTOH, interfaces in Go and virtual functions in C++ are the same thing.
- steveklabnik 2y agoIt really depends on what kind of axis you’re talking about. Under the hood, Go’s interfaces and Rust’s “dyn types” (the new nomenclature for trait objects) are the same, and C++’s virtual functions are different. (Though you can emulate them with unsafe in Rust, like anyhow)
- _flux 2y ago> I agree Rust is easy to learn. I've done it 4 or 5 times now. https://www.lurklurk.org/effective-rust/ https://www.lurklurk.org/effective-rust/ could be for you; while it starts from the very basics—for a person that knows how to program—it does seem to cover a lot and in a structured manner. I expect one to learn something new at least something by page 70 :).
- knighthack 2y agoI really wish there was more of a discussion on Nim.
- apitman 2y agoI've never looked closely at Nim because I think I don't need another fast GC language in addition to Go. What's your pitch for someone like me?
- SJMG 2y agoNot so much a pitch, but a good demonstration. https://nim-lang.org/blog/2021/07/28/Nim-Efficient-Expressive-Elegant-Benchmarking.html https://nim-lang.org/blog/2021/07/28/Nim-Efficient-Expressiv...
- archargelod 2y agoGo is too verbose for my taste. Nim can be pretty concise while staying readable. One feature I love in Nim and miss most when using other languages is templates - it reduces a lot of boilerplate. Also, type system is very nice, probably one of the best amongst non-functional programming languages. Overloading, generics, type inference, distinct type aliases, first-class functions, subranges, etc. etc. I've seen Go have praise over not supporting OOP. Nim got some of it too =D. No classes, only structs and functions. In fact every operator is a function and you can overload them for custom types. OOP is still possible, but it's harder to make inheritance monster with factory factory factories. Nim gives you power, just remember that with power comes responsibility. This is my pitch for Nim language.
- mamcx 2y ago> I agree Rust is easy to learn. I've done it 4 or 5 times now No joke, is true. When I see Rust first time I agree to everything, agree is the way, is correct and is nice (it hurt me a lot that have used around 10+ langs before professionally, and I come just right from F# so need so little to be converted!). And obviously that is how I should have done the stuff if the other langs have the proper features! Then, I need to actually program correctly and bam! Is so hard! I need to relearn it many times. And yes, the hard part is to stop doing all the things that I have done in all the other langs implicitly. BTW, the hard part with Rust is that a)It syntax is too familiar and b) Is a totally different programming model. Until it not get the second part and truly pay attention to `moves, borrow, share, lock, clone, copy` instead of `loops, iter, conditional, read, write, etc` then is very hard to progress.