Live data from Hacker News

Should I Rust or Should I Go?

kerkour.com

131–140 of 178 posts

Re: Should I Rust or Should I Go?

#131
Use the tool for the job. I use Rust where it makes sense - georust is very useful to me. If I need simple web services I use Typescript. Image processing? Python and numpy. Low latency event handling over web sockets? Java and Lmax disruptor. Modern tooling and IDEs are great, using four or five languages is not that hard.

Re: Should I Rust or Should I Go?

#132
post #13

As someone building my startup [0] on Rust (and a fan of the language since ~2014) I don't think this is a very compelling list of points. > Rust is overhyped People are excited about Rust! Not sure why this is a reason you _shouldn't_ use the language. > Rust projects decay The text doesn't match the headline here; Rust takes backwards compatibility very seriously, and rust code I wrote in 2016 against Rust 1.10 sti…

> Rust makes you think about everything you're doing, the ways in which your programs use resources, and every possible class of errors. This is incredibly useful for writing fast and correct software, but will be overhead for people who just want to move fast.

I agree with the reduction in development speed. But the cognitive load is less, at least for me. Rust's type system, error handling primitives, language server and compiler messages seem to guide and reduce the effort needed to write good programs. The reduced development speed is often an acceptable compromise for all the advantages Rust gives - especially the cognitive load. The language also seems to save a lot of debugging time - so the reduced development speed may not be of much consequence.

> Overall, I don't think that Rust is the right solution to all problems.

I guess this depends on how comfortable you are with the language. Rust is my second choice after shell scripts to automate things. The point is, your statement is correct for only a class of developers - those who are new to Rust. For others, it's just as good as any other language for almost all problems.

Re: Should I Rust or Should I Go?

#133
post #74

Go and Rust do not compete at all in the same domain. A long time ago, Rust did not have the focus it as now and even included a GC But now, asking Go vs. Rust does not make sense at all. If you want a mediocre speed application with fast development, use Go If you want good memory footpeint with mediocre development use rust

> If you want a mediocre speed application with fast development, use Go

I don't know if you can describe much of Kubernetes like that.

Re: Should I Rust or Should I Go?

#134
post #13

As someone building my startup [0] on Rust (and a fan of the language since ~2014) I don't think this is a very compelling list of points. > Rust is overhyped People are excited about Rust! Not sure why this is a reason you _shouldn't_ use the language. > Rust projects decay The text doesn't match the headline here; Rust takes backwards compatibility very seriously, and rust code I wrote in 2016 against Rust 1.10 sti…

"Rust makes you think about everything you're doing ... overhead for people who just want to move fast."

Honestly, I find it much easier to move fast in Rust because for explorative code, I just bang out the code and used copy/clone liberally and once I have a skeleton it's usually a few iteration until rustc agrees to compile my code. Strong types makes it very easy for me to move fast. Doing this in C/C++ never worked for me and I always had to be extra careful lest I'd end up wasting a lot of time debugging.

I don't think Rust is over-hyped; almost everything I would have used Haskell for I do in Rust now.

Re: Should I Rust or Should I Go?

#135
Isn't it obvious, just use what everyone use (golang at the moment)? Is your role as a software engineer NOT a job/creating values for other people, but to "influence technology" or some sort of activism? I know that there are software engineers like that, but I just don't think most people are. Many seem to be confused why they do what they do apparently.

Re: Should I Rust or Should I Go?

#136
post #89
post #70

Honestly? Though I am forced to write go at work, I take Rust in a heartbeat(and it is a constant moaning from my end to ditch go and use Rust all the way almost every day). First thing to keep in mind is that Rust today is nothing like the Rust of 2015, even 2020. Way too many things are wrong with go: The packaging is one thing which I absolutely hate. I can't find words to express how much I hate the import "githu…

C looks like a toy language too, when compared to C++. And yet some of the best software in the world is written in it. So yes, Go has its drawbacks. But it is easy to get things done with it.

C a toy language? C is arguably the most difficult languages to master from the (relatively) mainstream languages. Far more difficult than C++ imo. I've gone through a lot of C and C++ code over the years and, I'm fully standing behind Torvald's opinions of it. As far as get things done, you could say that about any language really - Python, Haskell, Julia, hell, even PHP and js get things done easily. The example I gave above - the Rust microservice is not more than 10-15% larger in terms of codebase compared to the go one. The gains in performance and code which is actually pleasant to read is well worth it.

Re: Should I Rust or Should I Go?

#137

This is usually a very simple decision. Do you need the performance of Rust? If not, use Go (or Java or F# or C# or whatever GC language you prefer)

> Do you need the performance of Rust? If not, use Go

Or, if GC is not an option - like operating systems, embedded software, web engines and game engines. That said, why not just use Rust for everything if you know it?

Re: Should I Rust or Should I Go?

#138
post #137

This is usually a very simple decision. Do you need the performance of Rust? If not, use Go (or Java or F# or C# or whatever GC language you prefer)

> Do you need the performance of Rust? If not, use Go Or, if GC is not an option - like operating systems, embedded software, web engines and game engines. That said, why not just use Rust for everything if you know it?

You can use any language you like for your pet project with a single contributor, but there are more considerations if you want to have/move a team to that language in business environment.

Re: Should I Rust or Should I Go?

#139
post #5

As someone who doesn't know either language, would love HN's opinion on this video that was recommended to me by another HN user on a Rust thread a few days ago: https://www.youtube.com/watch?v=p-tb1ZfkwgQ The general gist of the video is the creator prefer Rust for functional programming and programs without much state and Go for everything else. As someone who's coming from a React background I don't see why if Rus…

I have experience in Rust, but not in Go. The video was more informative than I expected - a lot of comparative insights into the type systems. Ocaml sounds interesting. And while personally prefer Rust for everything, I agree that Go might be the better choice if the developers have to learn it from scratch or have to develop the application quickly. Rust takes a lot of effort to reach the level where you can appreciate its advantages. Once in a while, you can see someone cursing Rust because they were forced by the management to use Rust to develop an application under a tight deadline.

Rust, on the other hand, guarantees memory safety, pushes you to design better programs and cuts down on debugging time a lot. Rust is the better choice when correctness and performance matters. And if you are comfortable with Rust, it's good for almost any task.

> The general gist of the video is the creator prefer Rust for functional programming and programs without much state and Go for everything else.

Rust has no problems with handling states, as you guessed. They can't be global states (like in Go?). You have to group the state variables logically and pass them around. An additional constraint is that the data structures should be in a tree form. The ownership rules make it hard to have circular and mutual references in data structures (it's still possible with things like Rc and unsafe blocks).

Whether all this is an advantage or disadvantage really depends upon your preference. For example, I usually have a single large config object in my Python programs, whereas Rust forces me to split it up into manageable pieces. Frankly, I prefer the Rust style for multiple reasons: 1. Global states and circular references are an easy recipe for disastrous bugs. 2. Splitting up large state variables into smaller ones make it easier to reason about the purpose of each code section - it encourages more modular, refactorable and reusable code. (Splitting up data feels magical. All the problems seem to suddenly disappear when you reach a certain level of segregation) I haven't yet worked on a program that can't be written in Rust.

Re: Should I Rust or Should I Go?

#140
post #137

Earlier quoted context omitted.

> Do you need the performance of Rust? If not, use Go Or, if GC is not an option - like operating systems, embedded software, web engines and game engines. That said, why not just use Rust for everything if you know it?

You can use any language you like for your pet project with a single contributor, but there are more considerations if you want to have/move a team to that language in business environment.

Agreed. That's certainly a good criterion.
Post reply on HN