Rust async/await vs Go goroutines
async execution models.
Go schedules goroutines on a built-in runtime transparently; Rust futures are inert until polled by an external runtime like Tokio, and async colors functions.
What's really being asked
Whether you understand two fundamentally different concurrency models: Go's runtime-managed green threads versus Rust's poll-based, runtime-agnostic futures, and the ergonomic cost called function coloring.
The full answer
Go bundles an M:N scheduler in its runtime that multiplexes many goroutines onto a few OS threads, with preemption and a growable stack. You write straight-line, blocking-looking code; the runtime handles parking and waking, and channels are the idiomatic communication tool. Rust takes a different path: an async fn compiles to a state machine implementing Future, which is lazy and does nothing until something calls poll. Rust ships no runtime, so you choose an executor such as Tokio or async-std to drive futures, manage the reactor, and handle IO readiness. Function coloring is the consequence that async and synchronous functions are different colors: you can only await inside async, so calling async code tends to force callers to become async too, splitting the ecosystem.
The mistakes people make
Claiming each future is an OS thread, or that futures begin executing when constructed. Saying Tokio is part of std. Treating goroutines as identical to async tasks despite the lazy-versus-eager distinction.
What usually comes next
What does .await actually do at the poll level? Why does Rust avoid a default runtime? How do you bridge blocking code into Tokio, for example spawn_blocking? How does cancellation differ, given dropping a future stops it?
A concrete example
A function fetch returning a future built from two awaits does not start any network IO until you tokio::spawn it or await it inside a runtime. In Go, calling go fetch() immediately schedules the work on the runtime. This eager-versus-lazy contrast captures why Rust needs an explicit executor while Go does not.
Interview question
In Rust, what happens to an async function's returned future immediately after you call the function but before awaiting or spawning it?
- a.It is scheduled automatically by the built-in Rust runtime
- b.It runs to completion on a background OS thread
- c.Nothing executes; the future is inert until a runtime polls itCorrect
- d.It blocks the calling thread until the work finishes
Why? this is the answer
Rust futures are lazy state machines that do nothing until polled by an executor like Tokio. Go's eager goroutine scheduling, not Rust's, runs work automatically when launched.
Just read this? Test yourself on what you have been reading.
Read the original → rust-lang.github.io
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on rust — each one lists the topics its interview covers.
See open roles