Anton Zhiyanov
@ohmypy
Followers
7K
Following
2K
Media
280
Statuses
2K
Open source maintainer at https://t.co/lVeVYa0cGf. Author & educator at https://t.co/WIgisTWNrF
Joined March 2013
Gist of Go: Concurrency is out! Learn Go concurrency from the ground up with 50 auto-tested exercises and tons of interactive examples. It's a full course + book in one. https://t.co/aBlt4BLEq1
18
110
731
The Go team is well aware of this: https://t.co/hPpsp3WmGk But I don't think the fix is coming in 1.26, despite what the issue says.
github.com
With swissmaps in 1.24, a map[int64]struct{} requires 16 bytes of space per slot, rather than the expected 8 bytes. This is an unfortunate side effect of the way the storage is defined internally h...
0
0
0
Apparently, the map[T]struct{} trick for implementing sets doesn't save memory in Go 1.24+ You can just use map[T]bool π€
Wrote a new blog post about my experience debugging hash tables in Go. https://t.co/MnnVNqOgEU
2
6
115
For interpreted languages, the times shown are only for running the program, since there's no separate compilation step. I had to shorten the Kotlin bar a bit to make it fit within 80 characters π
Of course, this ranking will be different for real-world projects with lots of
2
0
27
Here's a little unscientific chart showing the compile/run times of a "hello world" program in different languages. I used single-core, containerized sandboxes on an ancient CPU, so the exact times aren't very interesting, but relative timings are.
73
11
225
I've updated all code sandboxes (say hello to Python 3.14 and Java 25), and added more languages β Dart, Swift, Haskell and Prolog. Handy for trying a new language online or embedding interactive snippets into your writing. https://t.co/fmVcEXVMvw
2
4
50
I've created Docker sandboxes for dozens of languages, from Python and Java to Odin and Zig. Running a "hello world" program in these sandboxes takes between 500 ms and 2 sec. But there is one language that takes a full SEVEN seconds to compile "hello world" π It's Kotlin.
29
14
641
Here are some book stats: β 15 months from the first chapter to release. β Uses Go version 1.25. β Over 500 interactive examples. β 50 auto-tested exercises (with solutions). β 448-page PDF. I'd say it feels more like a 200-page book β the high page count is mostly because of
0
0
17
I added an important part that was missing from the Go Accepted series: the contributors! These are the people who design and implement the proposals, making it possible for us to enjoy new features and improvements in future Go versions π«‘ https://t.co/wUVVENb9El
0
0
27
Go developers fall into three groups: 1. Those who use context for cancellation. 2. Those who use context to pass values. 3. Those who use context for both cancellation and passing values. It turns out the last group wasn't happy because sometimes you want to cancel the parent
25
27
352
Accepted! Go 1.26 will include a SECRET package. Don't tell anyone about it π€« Just kidding. The package wipes the memory to keep secrets safe β hence the name. https://t.co/UolNcIOO0M
antonz.org
Automatically erase memory to prevent secret leaks.
5
22
221
Thank you all for helping me choose the cover for the Go Concurrency book. I didn't expect so much participation, and I really appreciate it! Here's the final version, along with the table of contents.
8
39
560
The new chapter of my Go Concurrency book covers the scheduler and its implementation details. It's not meant to be a deep dive. But it's short, easy to understand, and will teach you more about goroutine scheduling than many other developers know. https://t.co/iPmrnl1zej
antonz.org
CPU cores, threads, goroutines, and the scheduler.
0
28
310
Naming things is indeed one of the hardest tasks in computer science. Go proposal for errors.AsType (the generic version of As) is another example of this. People suggested all kinds of names: IsA, AsA, AsOf, AsT, Has, and even Find. The committee voted for AsType π
2
2
72
I'm working on the final chapter of the Go Concurrency book, and I'm rethinking the cover. Which one do you like better?
47
5
133
Accepted! Go 1.26 will introduce errors.AsType β a modern, type-safe alternative to the clunky errorsβ€As. No reflection. No runtime panics. Concise code. This is big! https://t.co/PQ40uSCw9T
antonz.org
errors.AsType is a modern alternative to errors.As.
18
74
542
When I wrote about the maphash.Hasher proposal in Go, some people replied saying that Go is turning into Java. I'm not sure why. First, In Java, equals and hashCode are part of the base Object type that everything inherits from. In Go, Hasher is non-intrusive and will only be
2
9
137
Apparently, in the initial version of this wonderful post, the devs were also called "losers." Later, they were promoted to "rookies". I guess it says quite a lot about the President and Lead Developer π
2
0
103
Personally, I think GitHub's UI is getting worse, unfortunately. Still, I'm thankful for Actions, Pages, and the other services GitHub offers.
5
0
187
Is it normal in the Zig community to call other programmers "monkeys"? No one deserves to be called names just because they work on a product you don't like. Neither an SDE I developer at Microsoft, nor the President and Lead Developer of the Zig Software Foundation.
276
25
754