Could Go be a better C? I think so!
Meet Solod — a strict subset of Go that translates to C, without hidden memory allocations and with source-level interop.
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 🫠
This Go expression is a bit unconventional, but it's completely valid:
error.Error(errors.ErrUnsupported)
"errors.ErrUnsupported" is a real, though less well-known, error value defined in the errors package.
"error" is a real interface type, and "Error" is its method.
And
I have no idea why developers hate examples so much.
Sometimes, I'll see a Go proposal discussion with 50 comments where people argue back and forth, but no one gives a single example about what they're talking about.
To me, that's just crazy — these kinds of discussions go