Sign in

Anton Zhiyanov

@antonz.org
339 followers 19 following 202 posts

Maintainer at github.com/nalgeon. Author at antonz.org

PostsRepliesMedia
Anton Zhiyanov @antonz.org · 02/09/2026
This esteemed function in Go's standard library reads the mantissa and exponent from a string and returns seven individual values. I guess someone really hated structs, huh 🫠
100
Anton Zhiyanov @antonz.org · 31/08/2026
Since you can call any method like a regular function, these two calls are equivalent: var err = errors․New("oops") err.Error() // "oops" error.Error(err) // "oops" So error.Error(errors.ErrUnsupported) is just "unsupported operation" 🤓
020
Anton Zhiyanov @antonz.org · 27/08/2026
I've updated the "Go features by version" list with the latest changes from 1.27. This is not a replacement for release notes, but rather a quick summary of major features in any given Go version. antonz.org/go-features/...
1243
Anton Zhiyanov @antonz.org · 26/08/2026
One of Solod's strengths is its zero-overhead C interop. So I took a break from working on the standard library and made a tool that generates Solod bindings for any C library from its headers. To get started, I also created bindings for some popular C libraries like Raylib, Sodium, and SQLite.
190
Anton Zhiyanov @antonz.org · 24/08/2026
Postgres 19 introduces native graph queries (following the SQL/PGQ spec — Property Graph Queries). It's currently in beta, but if you want to try the graphs feature, I've set up an online playground: codapi.org/embed/?sandb...
011
Anton Zhiyanov @antonz.org · 22/08/2026
I compiled a Solod program that imports 30 stdlib packages to WebAssembly and did the same with Go and TinyGo. Solod's binary is 2x smaller than TinyGo's and 16x smaller than Go's 😎 All three binaries are fully self-contained (WASIp1).
191
Anton Zhiyanov @antonz.org · 13/08/2026
Running the full Solod stdlib test suite takes 5 seconds (Clang on macOS). It's not as fast as a Go test suite of roughly the same size, but it's still fast enough to provide useful feedback while making changes.
130
Anton Zhiyanov @antonz.org · 10/08/2026
I expect the "javafication" of the Go ecosystem to continue with the addition of generic methods in Go 1.27. We probably won't see unnecessary generic abstractions in the standard library, but plenty of third-party code will gladly take advantage of this wonderful opportunity.
350
Anton Zhiyanov @antonz.org · 09/08/2026
Everyone is creating a new programming language these days, often one that's "like Go but with more features" or "like Rust but simpler". Solod, a systems language for C and Go developers, might look like one of those languages. But it takes a different approach.
261
Anton Zhiyanov @antonz.org · 07/08/2026
For example, Go uses platform-specific assembly code for the block step of SHA-256 hashing. My Solod implementation is 10% slower, even with Arm SHA-2 CPU intrinsics. If I use only pure Solod code (just C), it's 7x slower. Go's cryptography is exceptionally well done.
071
Anton Zhiyanov @antonz.org · 06/08/2026
Solod now has a logo ☀️ I hope it helps the language really shine :)
030
Anton Zhiyanov @antonz.org · 05/08/2026
I'm starting to port Go's hashing packages to Solod (a subset of Go that translates to C). At first, I thought about porting MD5, but who actually uses it anymore? So I went with SHA-2 instead.
050
Anton Zhiyanov @antonz.org · 22/07/2026
Adding concurrency to Solod (a subset of Go that translates to C) felt great. But my favorite feature in the upcoming release is preventing the most common kind of dangling pointer: returning a pointer to a local variable from a function.
140
Anton Zhiyanov @antonz.org · 21/07/2026
If you want to see something really wild, here are 13 out of 18 Go built-ins packed into one expression 🤪
010
Anton Zhiyanov @antonz.org · 21/07/2026
Go has 18 built-in functions (since Go 1.21; there were 15 before that). Personally, I use make, append and len all the time. I never use complex/real/imag or print/println. Everything else falls in between. How about you?
200
Anton Zhiyanov @antonz.org · 20/07/2026
I've put together my own crazy language ranking based on the number of sandbox runs in the Codapi playgrounds. As you can see, Lua is number one, Odin is more popular than C#, and Zig is more popular than C — which obviously doesn't quite reflect the reality 😅
100
Anton Zhiyanov @antonz.org · 16/07/2026
My Go Concurrency book is now available on Amazon: amazon.com/dp/B0H94S2G4K And, of course, it's still free to read on my website: antonz.org/go-concurrency With interactive examples!
032
Anton Zhiyanov @antonz.org · 15/07/2026
The entire Solod language implementation is under 5,000 lines of Go code, plus 700 lines of C built-ins and another 700 lines for tooling. This is only possible because Go's stdlib offers a great lexer and parser, along with a ready-made analysis package in x/tools.
0111
Anton Zhiyanov @antonz.org · 13/07/2026
I don't like the functional options pattern in Go, and I'm pretty disappointed that it ended up in the standard library with the new json/v2 package. An honest, plain Options struct is much better.
031
Anton Zhiyanov @antonz.org · 05/07/2026
You might not remember, but one of the reasons Go was appreciated in the early 2010s was that it came with great tooling right out of the box, specifically for testing and benchmarking. Now Solod (a subset of Go that translates to C) is getting a testing tool too!
011
Anton Zhiyanov @antonz.org · 02/07/2026
Solod (a subset of Go that translates to C) is getting a concurrency model. Instead of Go's M:N goroutine scheduler, it uses an M:N thread worker pool with a task queue. Much simpler, but still pretty efficient.
040
Anton Zhiyanov @antonz.org · 14/06/2026
Big day today! Solod (a subset of Go that translates to C) now comes with a networking package. It's pretty basic, but it's still an important step.
0150
Anton Zhiyanov @antonz.org · 31/05/2026
As you probably know, UUIDs — v4 and v7 — are finally coming to the Go standard library this summer! I decided to port them to Solod (a subset of Go that translates to C) right away. I also added the Version method, which the Go team chose to leave out.
0120
Anton Zhiyanov @antonz.org · 12/05/2026
Solod (a subset of Go that translates to C) now has a freestanding mode. Many standard library packages work fine without needing libc: bytes, strings, slices, maps, mem, math/bits, and utf8. Even the time package mostly works!
051
Anton Zhiyanov @antonz.org · 09/05/2026
Adding WebAssembly support to Solod (a subset of Go that translates to C) was a breeze. I especially like the size of the resulting .wasm file: — Go: 1.7MB — TinyGo: 111KB — Solod: 9.5KB Who's tiny now, huh? 😁
4423
Anton Zhiyanov @antonz.org · 02/05/2026
Many new programming languages lack practical examples. I don't want to make the same mistake. More apps are coming soon 💪
010
Anton Zhiyanov @antonz.org · 01/05/2026
Now a clanker can write Solod code for you. But where's the fun in that?
010
Anton Zhiyanov @antonz.org · 25/04/2026
Every day, Solod (a subset of Go that translates to C) gets closer to its first official release. Only two stdlib packages left to port — filepath and flag!
0141
Anton Zhiyanov @antonz.org · 16/04/2026
I've been fascinated by RISC-V lately. An open-source processor architecture is a great idea. I hope we'll see a lot more consumer devices and servers using RISC-V chips in the coming years. In the meantime, I've added support for linux/riscv64 to Solod (a subset of Go that translates to C).
080
Anton Zhiyanov @antonz.org · 14/04/2026
For me, the best way to iterate in a language like Go — very imperative, very down-to-earth — is an explicit iterator object. That's how bufio.Scanner or sql.Rows work, and that's what I chose as the standard iterator pattern for Solod (a subset of Go that translates to C). This one I like.
110
Anton Zhiyanov @antonz.org · 11/04/2026
Made a small progress bar for the first release of Solod (a subset of Go that translates to C). Not quite there yet, but a lot of work is already done!
080
Anton Zhiyanov @antonz.org · 06/04/2026
But sometimes, maps are really useful for small, local tasks like routing or counting. So, I eventually made a stack-allocated version of the map[K]V built-in. It's lightweight and super fast — sometimes even faster than Go's map (which is already state-of-the-art).
010
Anton Zhiyanov @antonz.org · 01/04/2026
Solod (a subset of Go that translates to C) shines when it comes to C interop. But it's also quite fast on regular Go code. In this strings.Builder benchmark — a common, optimized case in Go — Solod performs 2-4 times faster. And the binary is only 53K (vs. 1.6M with Go).
110
Anton Zhiyanov @antonz.org · 31/03/2026
While porting Go's standard library to C, I try to avoid heap allocations as much as possible. Of course, sometimes there's no way around them, like in os.ReadFile. But often I can use local stack allocations or a buffer provided by the caller instead. It's working pretty well.
010
Anton Zhiyanov @antonz.org · 29/03/2026
If you stare into Go's stdlib long enough, you start seeing things. Dark things. Things you weren't meant to see. Like this function that uses variables named φ and β.
2241
Anton Zhiyanov @antonz.org · 28/03/2026
In today's crazy world, writing C is the only sane thing to do. P.S. You don't need AI; you have AI in netdb.h.
050
Anton Zhiyanov @antonz.org · 26/03/2026
Solod (a subset of Go that translates to C) now has an online playground! I guess that means it's a real language now 😁 codapi.org/so
Solod playground
040
Anton Zhiyanov @antonz.org · 13/03/2026
Working on something crazy these days — using Go to write regular C code. Wish me luck :)
4353
Anton Zhiyanov @antonz.org · 08/02/2026
Fancy an allocator in C? It's not Zig, but it's honest work.
010
Anton Zhiyanov @antonz.org · 04/02/2026
The only two features I really miss in C at this point are namespaces and defer.
020
Anton Zhiyanov @antonz.org · 29/01/2026
With Go 1.26, you can easily log to multiple targets (like stdout, a file, or a remote server) using just the standard library. All thanks to slog.MultiHandler, which sends log records to any number of handlers you configure.
0325
Anton Zhiyanov @antonz.org · 20/01/2026
With Go 1.26, you can peek into a byte buffer if you're that curious. The new Buffer.Peek method in the "bytes" package returns the next N bytes from the buffer without advancing it. The slice returned by Peek is not a copy; modifying it changes the buffer.
050
Anton Zhiyanov @antonz.org · 18/01/2026
I like how the Odin folks went, "Package management? Nah. Just copy and vendor them." 😁 Brutal, but fair.
020
Anton Zhiyanov @antonz.org · 14/01/2026
Starting with version 1.26, most crypto APIs will simply ignore the reader parameter and use an internal system random source instead. You can pass nil or a reader — it doesn't matter anymore: ecdsa.GenerateKey(elliptic.P256(), nil)
100
Anton Zhiyanov @antonz.org · 11/01/2026
So the second most imported 3rd-party dependency is Google's own UUID package. I wonder what it would take to convince the Go team to add it to stdlib. Also, I don't think x/crypto and x/net should be here at all. Both are imported by stdlib itself, so they're basically included in every project.
482
Anton Zhiyanov @antonz.org · 11/01/2026
My idea was to have simd/amd64 and simd/arm64 with distinct types, each package reflecting the CPU architecture (AVX/Neon) without even trying to be portable. Then the user would create, for example, an Add function with two different implementations governed by build tags.
100
Anton Zhiyanov @antonz.org · 09/01/2026
Yes, the methods map to AVX instructions very closely.
010
Anton Zhiyanov @antonz.org · 09/01/2026
Go 1.26 brings the long-awaited vectorized operations (SIMD) in the simd/archsimd package. Since it's hard to create a portable high-level API, the Go team decided to start with a low-level, architecture-specific one and support only amd64 for now.
1205
Anton Zhiyanov @antonz.org · 08/01/2026
A typical use case is a generic type that supports operations with arguments or results of the same type as itself (like Ordered[T]). We can use such a type as a member in a generic container (like Tree[T Ordered[T]] — see the screenshot). This makes Go's generics a bit more expressive.
020
Anton Zhiyanov @antonz.org · 06/01/2026
Hey @thepudds.bsky.social! Thanks for io.ReadAll in Go 1.26 :) Why did you choose to use append-make instead of just make for the final slice? Using append-make sets the slice capacity to the next size class, which seems to go against the idea of having a "perfectly-sized slice", doesn't it?
1101