Live data from Hacker News

Should I Rust or Should I Go?

kerkour.com

101–110 of 178 posts

Re: Should I Rust or Should I Go?

#101
post #15

As someone with very little expertise in this, and from the very little time that I can spare for experimental webdev, from a webdev framework perspective, Rust is where Go was 7-8 years back. There are some Rust frameworks available which look promising (rocket), but golang has much more. On the flipside, There is nothing wrong with golang (or at least it has less wrong going for it as compared to the js frameworks)…

I think you need to qualify the aspects, in which you think Rust is 7-8 years back. I rather have the impression, that the designers of the Go language had a too simplistic view of what Go should offer and then it took them 12 years to get something as common as generics. Rust has many language features and of course had generics waaay before Go. In general it seems the Rust ecosystem does sometimes have things later…

Shocking but true: you could program things in Go before generics.

Re: Should I Rust or Should I Go?

#102
post #17

In what world is Go more reliable or faster than Java? Especially modern Java (or other good JVM languages like Kotlin). It compiles faster but that is about it. Which is a good thing too because it's verbose AF and heavily reliant on code generation even after generics shipped so that compiler lines/s actually matters. The only knock you can put on Java for reliability is null-safety but lets be real, nil pointers,…

> the only knock you can put on Java for reliability is null-safety

FWIW, nullity control has been added to the Valhalla project, so it might be fixed going forward.

https://youtu.be/Ma0NtbG0mHY?feature=shared&t=1076

Re: Should I Rust or Should I Go?

#104
post #35
post #17

In what world is Go more reliable or faster than Java? Especially modern Java (or other good JVM languages like Kotlin). It compiles faster but that is about it. Which is a good thing too because it's verbose AF and heavily reliant on code generation even after generics shipped so that compiler lines/s actually matters. The only knock you can put on Java for reliability is null-safety but lets be real, nil pointers,…

The usual Java bashing from Go folks, meanwhile Google keeps mostly using Java, Kotlin and C++, with only a couple of key projects using Go, like Kubernetes or Google downloader.

I was a witness to a decision on whether to migrate an old Java project to Go. A proof of concept (a Go rewrite of a core part of the engine) convincingly showed that the Go version would be somewhat more performant, would have vastly better startup time, and would have a smaller and simpler codebase, since the Java version's caches and latency-hiding complexity would not be needed.

The decision made was to stick with Java.

Why? Because rewriting the long feature tail of the Java version in Go and ensuring bug-for-bug compatibility with the Java version would have taken multiple engineer-years. During the rewrite, from the perspective of the project's users, development would have stalled. It made more business sense to instead use those engineer-years to implement some new features that users were demanding. And after all, while the Java version's performance wasn't amazing, it was acceptable.

Re: Should I Rust or Should I Go?

#105
This feels like the beginning of a long blog post I'd like to read.

Go feels natural to me, Rust feels like an ugly looking, needlessly complicated language.

Go has decay too. Many packages are abandoned or not properly taken care of. Generics did their own to slow the language down. But even if it's not the fastest language, it's fast and robust enough to get things done. And that's what counts for me.

Re: Should I Rust or Should I Go?

#106
post #10

> As far as I know, today, Rust is the only programming language (other than C) able to create efficient WebAssembly (wasm) libraries Zig is also a good option for that, but the language is still in development.

[deleted]

Re: Should I Rust or Should I Go?

#107
post #10

> As far as I know, today, Rust is the only programming language (other than C) able to create efficient WebAssembly (wasm) libraries Zig is also a good option for that, but the language is still in development.

Regarding Zig, note that the author writes "starting a new project in a memory unsafe language in 2023 is foolish as demonstrated by the endless flow of vulnerabilities."

Re: Should I Rust or Should I Go?

#108
post #10

> As far as I know, today, Rust is the only programming language (other than C) able to create efficient WebAssembly (wasm) libraries Zig is also a good option for that, but the language is still in development.

Regarding Zig, note that the author writes "starting a new project in a memory unsafe language in 2023 is foolish as demonstrated by the endless flow of vulnerabilities."

Yes but that's a silly argument for most software, which will never see adversarial contact.

Re: Should I Rust or Should I Go?

#109
Rust is not a good match for embedded Linux so long as binary sizes are so gigantic (same is true for a lot of C++). When your binary takes 100 MB of a few GB emmc, you have a problem.

Re: Should I Rust or Should I Go?

#110
post #90

Earlier quoted context omitted.

Go’s is ok. Not as good though.

Can you provide an example of where rust has better tooling than Go?

Offhand, I like rustfmt a lot more than gofmt because it handles long lines rather than only changing things within a given line; in my opinion, any time I need to manually format something myself, that's a failure of the formatting tool. I also find rustdoc to be much more flexible than Go's documentation functionality (which I forget the name of, but I assume it's something like `go doc`). At least the last time I used it Go required me to prefix any doc comment for a given function, type, etc. to start with the name of the item I was documenting; not only is this redundant, but it also means that any typo I make will cause the comment to be omitted completely, whereas Rust only requires a third slash for doc comments (i.e. `///` rather than just `//`). It's a minor thing, but small quality of life things add up across an entire ecosystem.
Post reply on HN