Top
Best
New

Posted by jabits 1 day ago

Migrating from Go to Rust(corrode.dev)
406 points | 398 commentspage 2
mxey 4 hours ago|
> You literally cannot dereference an Option without acknowledging the None case. Whole categories of pager-duty incidents disappear.

This is at the very least misleading, given that you can use unwrap.

Regarding error handling: will a parser error in the config return an error that includes the name of the file that’s failed to parse? That’s the kind of useful context that I add to errors in Go.

tuetuopay 3 hours ago|
The difference is, unwrap will stick out like a sore thumb, and it’s opt-in. You explicitly tell "this may panic".

As for error handling, this kind of enrichment is usually left to the caller (that is, the end application), with error libraries like anyhow where you can add arbitrary string contexts to an error. You would end up writing `Config::load(path).with_context(|| format!("Failed to load configuration file {path}"))?`.

sg1apm 1 hour ago||
Curious about the operational side: did the migration affect your deployment pipeline complexity significantly? We recently rewrote a monitoring dashboard from Python/Qt to Go specifically to get a self-contained binary with no runtime dependencies — the deployment story for Go is hard to beat for internal tooling even if Rust would win on performance.
drykiss 5 hours ago||
Quite new to Go, so sorry in advance for a stupid question:

> "Go got generics in 1.18 (March 2022), thirteen years after the language shipped. They are useful, but they feel tacked on, and in practice they have most of the downsides of a generic type system without delivering the upsides you’d expect coming from Rust, Haskell, or even modern C++."

The problems with Go generics have now largely been solved, haven't they? Is this comment from the author still applicable?

aatd86 2 hours ago|
That's the thing, a programming language is not something static, it evolves. For instance, people are working on adding generic methods for the next release cycles.

And what the article complains about is by design, not a bug. It is a tradeoff made to avoid bloat. In any case, given the future possibilities, I'd bet on Go.

If anything, the language is just slower to evolve because every language change means the tooling needs to catch up. And now llms would have to catch up. ChatGPT is still using Go 1.23 for instance...

gertlabs 22 hours ago||
I liked Rust before running a benchmark, but the gap between how effectively most LLMs write in Rust vs Go was still surprisingly large to me (especially in agentic harnesses where they can fix the initial environment issues). I've become a pretty big Rust evangelist after seeing that. We've had a lot of success writing batch processing tools in Rust to be called by our existing codebase, but haven't attempted a full production migration... yet.

I will say that many of the issues with Go in the article, especially re: nil handling are increasingly solved by thorough coding reviews with Codex. Better to not have the issue in the first place, sure, but these kinds of security bugs are becoming optional to developers who put in at least as much effort to review and understand code as they put into the initial design and execution.

Language data at https://gertlabs.com/rankings?mode=agentic_coding

J_Shelby_J 21 hours ago||
The detailed compiler errors and strong type system makes the change -> compile -> change loop simple for agents to handle. Rust provides very strong rails it forces users on to. Codex always manages to get something to compile.

The downside is that maybe it should fail sometimes when an idiomatic approach isn’t viable… instead it will implement something stupid that compiles and meets the request.

logicchains 22 hours ago||
The weakness of Rust WRT LLMs is compilation times. LLMs code faster and hence spend relatively more time waiting for compilation than humans do, so on reasonably sized projects (e.g. 100k+ lines) Rust's ~10x slower compilation starts showing up as a bottleneck. If you're writing some critical infrastructure it makes sense to pay that cost, but if you're writing some internal service that's not publicly exposed to the internet then development velocity may be a bigger concern. (I'd argue that slow compilation also influences human development velocity, but for some reason developers very rarely try to quantify this.)
Havoc 8 hours ago|||
>The weakness of Rust WRT LLMs is compilation times.

That's a more tractable problem then basically anything else around LLMs and programming. We're definitely getting more cores in the avg machine judging by roadmaps & leaks

J_Shelby_J 21 hours ago||||
10x slower is like an extra second, if that, for compilation times for the sizes of changes an agent like codex makes.
sieabahlpark 19 hours ago|||
[dead]
sgt 9 hours ago||
Meanwhile.. Java's still around. Modern, and fits the LLM paradigm quite well. It's not going to be as amazing or fast as Rust is, but close.
p2detar 9 hours ago|
> as amazing or fast as Rust

For cli tools, game engines, etc. certainly so. But what about monoliths? Do we have enough data to say Rust handles long-running monolith apps exposing web and other network services better than the JVM with its hot spot? I haven’t come to any stats on that matter, yet.

pas 7 hours ago|||
If you can encode your request processing patterns in statically sized types, then you can get the same high-level memory allocation behavior on both platforms. Arguably Rust makes this a bit easier. (Though I have no idea how much of the concepts of mechanical sympathy made it to mainstream Java.)

If you have some kind of super vague complicated patchwork of plugins that all contribute to processing, then the JVM seems to be the more convenient choice.

https://martinfowler.com/articles/mechanical-sympathy-princi...

MeetingsBrowser 7 hours ago||||
Indirect evidence, but parts of AWS and cloudflare have been running Rust in production for close to a decade now and neither company looks to be itching to move services back to Java.
nicce 7 hours ago|||
> other network services better than the JVM with its hot spot?

JVM hotspot optimization is just band-aid for something Rust does always everywhere naturally? Assuming that you use lifetimes etc properly and not going to Arc rampage.

za3faran 5 hours ago||
Rust:

    concat/string           time:   [77.801 ns 78.103 ns 78.430 ns]
                            change: [+0.0275% +0.3169% +0.6169%] (p = 0.03 < 0.05)
                            Change within noise threshold.
    formatted/string        time:   [31.471 ns 31.569 ns 31.699 ns]
                            change: [+0.1277% +0.3915% +0.6788%] (p = 0.01 < 0.05).   
                            Change within noise threshold.
Java

    Benchmarks.concat      string  avgt   15   8.632 ± 0.105  ns/op
    Benchmarks.format      string  avgt   15  64.971 ± 1.406  ns/op
Java's string concat is faster than rust's offerings.
nicce 4 hours ago|||
I would be careful with this benchmark even thought it shows JIT efficiency. This is a special case which might not really reflect realworld - string was static? What if you use random string?
Luker88 10 hours ago||
I write purely Go at $dayjob, but I write purely Rust in my projects.

I have a huge list of things that I have in Rust that I would like in Go, but I don't have a single thing I am missing from Go in Rust.

I grow tired of golang "dumb it down" approach as I find it actually just shifts more and more work onto me.

Is anyone in a different position? What does Go have that rust does not?

wanderlust123 9 hours ago|
The simplicity of Go is a feature…
Luker88 8 hours ago||
I have to come to believe that Go is simple for the compiler, not necessarily for the programmer.

`nil` is not simpler than references and Option<T>. lack of enum is complicating my code. automatic type promotion is a hidden bug waiting to happen and preventing proper strong types, lack of `?` is making things verbose. struct tags look simple, until you realize they are hiding a ton of code and creating a ton of corner cases that you still have to manually check, and are completely nonstandard (hello json and `default`, `omitempty/omitzero` etc...). `nil` and interfaces? it took decades to recognize that Generics simplify things for the programmer, no Send/Sync like in rust makes concurrent code more error prone, etc, etc...

And that is without talking about the standard library, where "simple" somehow becomes having `url.Parse` that accepts everything without errors. http body `nil` vs `NoBody`. Who hasn't had to write the Nth implementation of a pipe between reader and writer? Apparently most libraries hear "simple" and think "dumb". We could go on for hours.

Golang is much easier to learn, and rust does remain much more complicated. I don't thing golang hit his target of "simplicity" honestly.

runtime_terror 1 hour ago||
> I have to come to believe that Go is simple for the compiler, not necessarily for the programmer.

You're welcome to believe whatever you want but Go is pretty universally known as one of the simpler, easier to learn compiler languages in existence.

hebetude 17 hours ago||
Not sure the article is … accurate? Go has a large standard library. Rust leans on third party cargo libraries which fall into the supply chain attack and has a small standard library. Anyways, that feels immediately biased in the article. Also 11% use Rust? I don’t see that penetration in real long term products. Sure lots of tui apps these days but not things that you can make money working on.
whilenot-dev 16 hours ago|
> Also 11% use Rust?

These percentages are from the JetBrains State of Developer Ecosystem Report 2024 on the question "Which programming languages have you used in the last 12 months?"[0].

I think a better datapoint would be the "Primary Programming Languages" in the 2025 report[1] where Rust sits at 4% and Go at 8%.

[0]: https://www.jetbrains.com/lp/devecosystem-2024/#KeDHWJ

[1]: https://devecosystem-2025.jetbrains.com/tools-and-trends

Thaxll 22 hours ago||
"services that your organization relies on, that have high uptime requirements, that are critical to your business"

Kind of funny when your Rust service runs on Kubernetes.

jabl 10 hours ago|
Which in turn relies on a stack largely written in, shock and horror, C, such as the Linux kernel, libc, openssl, nginx, etc. etc.

Even if you believe language X to be the bees knees, are you going to stop using it until everything below it in the computing stack has been rewritten in X? Of course not.

jafffsuds 4 hours ago|
> There’s no built-in goroutine-style preemption. Long CPU-bound work in an async task starves the executor; you offload to tokio::task::spawn_blocking or rayon instead.

I don't know why anyone uses spawn_blocking for CPU-bound tasks. It's clearly designed for blocking IO tasks. There's a reason why Erlang cordons them separately into Dirty CPU and Dirty IO schedulers.

More comments...