Chapter 8 of The Anatomy of Go is now available. It discusses channels, timers, concurrency, goroutine creation and lifecycle, runtime startup, preemption, scheduling, I/O handling, the system monitor... and a bunch of other things.
The book is now complete at 873 pages, and early access will be closing soon after the editing phase, (which may add a few more pages).
As usual, here is an excerpt:
If your are interested in why VictoriaLogs is so efficient and fast, then take a look into these slides about VictoriaLogs architecture internals -
docs.google.com/presentation/d…
Enums are good. I wish Go supported "real" enums. But union types are not, at least IMO.
At the very least, I do not want union types in a TypeScript-ish form:
func F(x int | string | []byte | io.Reader) { ... }
This function accepts many unrelated shapes of input.
Inside the function, you must figure out which one you got.
It's never good to be too convenient. It loosens the language in a way that makes APIs harder to reason about.
If Go somehow were to add union types, a more Go-ish version would be:
type ParseResult[T] union {
Ok(T)
Err(error)
}
type Shape union {
Circle(radius float64)
Rect(width, height float64)
}
That is closer to an enum with payloads, or a sum type or tagged union or Rust-style enums. It keeps the set of cases closed and explicit.
Go does not need "any value can be A or B or C" union types. Go would benefit from "this domain value has one of these known variants" sum types.
You cannot pass values like in TypeScript:
f(123)
f("hello")
You need to pass explicit variants instead, assuming Input is a tagged union:
f(Input.Number(123))
f(Input.Text("hello"))
More verbose but safer and stricter.
See more at
github.com/golang/go/issu…github.com/golang/go/issu…
hot take: Go would be the greatest programming language on earth if it had enums and union types. they simplified their way into having to do really weird stuff just to represent reality.
you should still probably use it though.
"We weren't gambling on a new technology — we were promoting one we'd already been operating in production against our own workload, and that consistently outperformed Loki in our side-by-side testing on the kinds of queries we and our users actually run."
The dedicated logger service inside every Zerops project is now using VictoriaLogs.
- 100x more log retention
- 3x faster queries
- VictoriaLogs UI embedded into Zerops
- Already rolled out to every existing project
Full story below.
Something is seriously wrong with how people contribute to open source these days.
People submit AI-generated code they clearly don't understand. When reviewers comment, they feed it back to the AI and submit again. The loop never ends.
Low-effort PR requires extremely high effort to review. That math is never fair.
You think this is how you build a reputation in open source? No, no, and no. You're just burning out maintainers.
---
Use AI to understand the codebase instead. Ask it to explain things. Build your own judgment. It's ok to use AI as a tool for coding, but make sure you filter out any AI slop before submitting.
You gain the skills. You gain the reputation. The project actually benefits.
Is it that hard?
@HSVSphere@JustDeezGuy Because you don't need that level of concurrency abstraction most of the time. context, waitgroup, errgroup, clear ownership patterns cover many common cases well
@raghavan_srini Agreed, though most backend systems people build aren't mission-critical at that level. Go ofc can, it just shifts responsibility to developers or to higher-level tooling
Go is not bad at concurrency. A more factual take is Go is excellent at making concurrency cheap, explicit, and approachable (and approachable, and approachable), especially for common backend patterns.
But Go gives you relatively low-level primitives, a lot of correctness around cancellation, task lifetimes, cleanup, error propagation, and backpressure is left to us, the programmer.
So the fair comparison is not "Go vs JVM, who wins?" It is: Go optimizes for simple pragmatic concurrency, the modern JVM ecosystem has stronger tools for structured and resource-safe concurrency. Which one is better depends on how complex the concurrency problem is. This is just a "depends on the problem" discussion.
Generally developers think of Go as being great for concurrency. Its not. JVM approaches are vastly superior. And even some of the best in the whole industry when you include virtual threads, structured concurrency & Effects.
Chapter 8 of The Anatomy of Go is ready for review. It goes into concurrency, the Go scheduler, threads, the system monitor thread, goroutine preemption, what happens at startup, how channels work, how the select statement works, and how timers work behind the scenes, a lot and a lot, with visual explanations.
This is the final chapter, it is near the end of the journey.
Who's the biggest Victoria-stack bull in my feed that wants to say why they love it?
I'm yolo porting from Prom/Loki etc in a project because I saw some nice numbers in the past and want to try it out but want to hear some people that are excited by it geuinely
105 Followers 62 FollowingSoftware Engineer, Blockchain Curiosity Engineer, Solving technical problems for a living..., Long Distance Driving as a hobby, Pro-Quiet
104K Followers 174 FollowingTurn ideas into professional videos in minutes. #1 on G2 for Most Realistic AI Avatars. Try it for free at https://t.co/xhvVUYZXQ2
58K Followers 709 FollowingMaking commerce better for everyone. Follow us for technical discussions and updates on how engineers build @Shopify.
Explore open roles: https://t.co/NFSvvCJBXt
14K Followers 36 FollowingWe're the engineers behind Pinterest, building a visual discovery engine powered by the latest in machine learning, 300+ billion ideas and 500+ million users.
25K Followers 78 FollowingScaling education somehow. Formerly @khanacademy. Now making things at https://t.co/O7StbNzWXo, https://t.co/wxK2GObTmU, and sometimes https://t.co/hZEJcP4Lr9
214K Followers 197 FollowingEngineering at Meta is a technical news resource for engineers interested in how we solve large-scale technical challenges at Meta.
47K Followers 508 FollowingSystem Design made me a better engineer. Now I help others do the same.
System Design • Backend • Databases • Scalability • AI
1.3M Followers 36 FollowingWe're an AI safety and research company that builds reliable, interpretable, and steerable AI systems. Talk to our AI assistant @claudeai on https://t.co/FhDI3KQh0n.
1.4M Followers 2 FollowingClaude is an AI assistant built by @anthropicai to be safe, accurate, and secure. Talk to Claude on https://t.co/ZhTwG8d1e5 or download the app.
2K Followers 507 FollowingEngineer on cloudy things at Google.
@[email protected]
💙 Serverless, QR codes, ≡Go.
https://t.co/oH541S5xqu
Try https://t.co/qJd5LQiKaZ 📱➡️💻
7K Followers 125 FollowingTeaching you how to edit like the pros ⊛ Worked with @logitech, @elgato, @microsoft & @raycast ⊛ Join Waitlist → https://t.co/wWusuVaJ6f 🕷️
131 Followers 256 FollowingI'm working on @VictoriaMetrics
He/Him | tweeting my own opinions.
Posting to https://t.co/z3H3Qd1ejR
https://t.co/7iN7A0Aqkp
24K Followers 96 FollowingThe premier gathering of Go enthusiasts will convene at the Seattle Convention Center | Summit from August 3rd - 6th. Grab a pass & join us in the Emerald City!