Live data from Hacker News

From Python to Go to Rust: an opinionated journey (2018)

tech.allo-media.net

11–20 of 78 posts

Re: From Python to Go to Rust: an opinionated journey (2018)

#11
post #9
post #5

I love Rust. Rust can be frustrating for those who didn't do enough c/c++ but once your brain and eyes get used to it, it becomes a joy to develop with. I never felt so excited writing code unless with Rust nowadays and back when I learned C++ for the first time more than 10 years ago when I was still a teenager. Rust is the closest thing to a perfect language ever existed imho. EDIT: for some reason I get mass downv…

Would you still use rust for your CRUD apps? I think of it as a specialized, safe, performant system language. I wouldn’t think of turning to it for the random rest services we constantly churn out.

I don't write REST services, but I use rust on AWS Lambda, and it works great. I can interact with AWS resources easily through Rusoto, I use Dynamo and S3, etc.

Re: From Python to Go to Rust: an opinionated journey (2018)

#12
post #6

> I compiled the code and … no error message. Everything went fine. But?! I just added a field to a struct, the compiler should say that my code is not good anymore because I’m not initializing the value where it should be! This is your big hangup with Go? You added a new field, didn’t use that field anywhere, and the compiler didn’t complain? I’ve heard a lot of valid criticisms of the language but this is a new one…

[deleted]

Re: From Python to Go to Rust: an opinionated journey (2018)

#13
post #6

> I compiled the code and … no error message. Everything went fine. But?! I just added a field to a struct, the compiler should say that my code is not good anymore because I’m not initializing the value where it should be! This is your big hangup with Go? You added a new field, didn’t use that field anywhere, and the compiler didn’t complain? I’ve heard a lot of valid criticisms of the language but this is a new one…

It's a pretty big annoyance with Go though. I hate that all struct fields are optional.

there are times when a nil struct field is useful, like for trees and json. very easy to require struct fields by using a constructor

Re: From Python to Go to Rust: an opinionated journey (2018)

#15

Earlier quoted context omitted.

It's a pretty big annoyance with Go though. I hate that all struct fields are optional.

there are times when a nil struct field is useful, like for trees and json. very easy to require struct fields by using a constructor

Absolutely, and Options are great for modelling that. It just shouldn't be the default.

Re: From Python to Go to Rust: an opinionated journey (2018)

#16
> but at some point, it didn’t feel right anymore.

That's not how engineering works.

> I realized that I couldn’t rely on the compiler to get my back when I was doing mistakes

That's not how engineers work.

> a compiler that should not rely on the fact that I know how to code

I don't even know what to say anymore.

Re: From Python to Go to Rust: an opinionated journey (2018)

#17
post #9
post #5

I love Rust. Rust can be frustrating for those who didn't do enough c/c++ but once your brain and eyes get used to it, it becomes a joy to develop with. I never felt so excited writing code unless with Rust nowadays and back when I learned C++ for the first time more than 10 years ago when I was still a teenager. Rust is the closest thing to a perfect language ever existed imho. EDIT: for some reason I get mass downv…

Would you still use rust for your CRUD apps? I think of it as a specialized, safe, performant system language. I wouldn’t think of turning to it for the random rest services we constantly churn out.

I would. I feel more performant (as a dev I mean, I'm not referring to code) with Rust after a year than with Go after 6 years. Which to me indicates that at least for myself, Rust is a language that allows me to get things done more quickly. Iterators especially.

With that said, I definitely wouldn't throw Rust at the Python/Go devs in my shop expecting them to be better/faster at it. It can have significant spin up time and, most importantly, if you're used to doing things unsafely by using bad patterns Rust will be hell for you.

I commented recently that I think Rust can be far more simple than people give it credit for. Namely, that you can write Rust in the same manner as Go, pretending Rust was Go. However going far beyond that too quickly is a world of hurt, from personal experience at least.

Re: From Python to Go to Rust: an opinionated journey (2018)

#18
post #3

I went from python to go to nim. Actually I still like go - but nim is an easy transition from python. I think nim is the best thing out there for building tiny CLI utilities. It’s a fun language to code in.

I wonder if there's any performance difference between Cython and Nim.

Nim is generally considered to be faster. Being statically typed allows more optimization. Nim is usually quite competitive with even pure C, especially if the C is non-trivial (e.g. has to do actual memory management)

Re: From Python to Go to Rust: an opinionated journey (2018)

#20
post #5

I love Rust. Rust can be frustrating for those who didn't do enough c/c++ but once your brain and eyes get used to it, it becomes a joy to develop with. I never felt so excited writing code unless with Rust nowadays and back when I learned C++ for the first time more than 10 years ago when I was still a teenager. Rust is the closest thing to a perfect language ever existed imho. EDIT: for some reason I get mass downv…

I enjoy coding in Rust as well, I don't understand why some people try a forced comparison with C++ arguing that Rust is younger in contrast with C++. Sure, but Rust is very promise language and it's not restricted only at system programming scope. It goes a bit more further. In few years I see Rust taking a place on top and sharing it that place with C++.
Post reply on HN