Top
Best
New

Posted by database64128 16 hours ago

Go 1.27(go.dev)
661 points | 197 comments
e4m2 14 hours ago|
Not mentioned: Floating-point parsing and formatting now uses Russ Cox's uscale algorithm.

https://research.swtch.com/fp

https://github.com/golang/go/blob/go1.27.0/src/internal/strc...

jeremyloy_wt 14 hours ago||
I’m so happy Russ still contributes even though he isn’t lead anymore. I always enjoy reading his blog posts
dvt 13 hours ago||
One of my engineering highlights was Russ reviewing a few of my contributions to Golang (to the core http library). He's a super cool and nice guy. I don't really write that much Go anymore, but it was a fun & cute language when it first came out.
dekdrop 1 hour ago||
I once wrote him an email asking what font was used in the plan9 papers. He replied. It's Lucida Sans Unicode. He even provided a url to paper published by the maker of the font.
dolmen 1 hour ago|||
I seriously wonder why this isn't mentioned in release notes.
dolmen 42 minutes ago|||
See also this recent (Aug 6th) interview of Russ Cox:

https://www.acm.org/articles/people-of-acm/2026/russ-cox

https://news.ycombinator.com/item?id=49327408

cornstalks 8 hours ago||
I’d love to see how that compares to zmij: https://github.com/dtolnay/dtoa-benchmark
e4m2 54 minutes ago||
The upstream fmtlib dtoa-benchmark integrates uscale (https://fmtlib.github.io/dtoa-benchmark/results/). It uses C code from Russ Cox's original fpfmt repository (https://github.com/rsc/fpfmt/tree/main/bench/uscalec), which is slightly different from the Go code upthread.

Zmij and xjb are in a league of their own. Broadly speaking, dtoa first has to find the shortest decimal representation of the floating-point input, and then format that decimal representation into a string. Zmij and xjb pull far ahead of the others mostly by speeding up the second part of that process.

uscale is quite good without the stringification, as are many other algorithms. I would say uscale's main strength isn't its speed, but rather its simplicity and, more importantly, the fact that it does both formatting and parsing using a single ~11 KiB table, which no other state-of-the-art algorithm offers (although yy comes close).

teabee89 15 hours ago||
I love how proactive the crypto team is about post quantum. They released https://pkg.go.dev/crypto/mldsa. The lead maintainer Filippo Valsorda wrote a nice piece here[1] to urge the tech world to start deploying good enough versions of post quantum crypto.

[1] https://words.filippo.io/crqc-timeline/

halJordan 15 hours ago||
While I'm highly sympathetic to competing priorities crowding out movement to pq cryptography. At the same time it's not sudden at all. It's been 10 years since nist first said "move shit over"?
Valodim 14 hours ago|||
Yes, and at that time the answer was "move over where?" now it's 2026 and x-wing is a draft still
halJordan 13 hours ago||
Ah. This is a bold faced lie. There were plenty of options in 2016. Nist released final candidates in 2024 and published the candidates this year.

ssh (as noted in tfa) has had pq defaults since 2022.

blandflakes 13 hours ago|||
In case you wanted to know, the expression is actually "bald-faced lie", i.e. unmasked, shameless.
stryan 10 hours ago|||
"bold-faced lie" and "bald-faced lie" are both valid expressions. The original expression is "bare-faced lie" but they're all pretty similar to each other.
kqp 6 hours ago|||
Yes but only one of them makes most people who hear it think you don’t know the expression you’re trying to use. There’s no objective reason it has to be this way, but it is, and at least personally I appreciate being told when I’ve got something stuck to my back.
blandflakes 10 hours ago||||
bold-faced lie is just the usual English drift that was actually questioned as incorrect when it first surfaced. If a lie is bold, you don't have to suggest that the user's face is bold when doing it. You can in thirty seconds of google searching find numerous sources explaining that "bold-faced" is a malapropism.
stryan 10 hours ago||
It's the usual English drift perhaps, but "bold faced lie" has been used since the 17th century, which is also apparent from "thirty seconds of Google searching". Three hundred years is enough usage for me to count it as correct.

On a side note, "bold faced" does not mean the persons face is bold, only that it is said boldly, which implies a level of rudeness that "bald-faced" or "bare-faced" does not.

Joel_Mckay 8 hours ago||
Colloquialisms and slang have unstable meaning over history, location, and cultures.

Generally, something to be avoided by people striving for clearer communication. =3

gjvc 3 hours ago|||
no

see also https://www.reddit.com/r/BoneAppleTea/

Joel_Mckay 12 hours ago|||
They are also lying, it is an Italics-Faced lie... thank you, I will see myself out. =3
taybin 12 hours ago|||
Calling it a lie is pretty heavy.
hoppp 11 hours ago||||
Yeah the deadline to move everything is drawing near I am actually not impressed by how fast things are going but all progress is good.
calvinmorrison 9 hours ago|||
its ok we are still rawdogging ftp every day in the business world. The fax machines of the future truly
eterm 13 hours ago|||
The .NET team have been similarly busy on post-quantum lately, it completely dominated the .NET API reviews for the dotnet 11 release.

It seems there's a big push happening behind the scenes.

pjmlp 1 hour ago|||
And Java implementations as well.
stackskipton 12 hours ago||||
US Government is starting to push hard so code first needs to support it.
amelius 12 hours ago|||
Ok, but when is it coming to our web browsers and email clients?
Retr0id 12 hours ago|||
I don't know about mail clients, but it's in most web browsers already.
amelius 3 hours ago||
Then I'm wondering why they don't simply use the same crypto libraries as the web browsers.
Retr0id 16 minutes ago|||
Chromium uses BoringSSL, which opens its readme as follows:

> BoringSSL is a fork of OpenSSL that is designed to meet Google's needs.

> Although BoringSSL is an open source project, it is not intended for general use, as OpenSSL is. We don't recommend that third parties depend upon it. Doing so is likely to be frustrating because there are no guarantees of API or ABI stability.

OpenSSL itself is a clusterfuck that doesn't really meet anyone's needs: https://cryptography.io/en/latest/statements/state-of-openss...

dolmen 1 hour ago||||
Go features cleaner crypto APIs (than OpenSSL for example) with less footguns.
OoooooooO 1 hour ago|||
Preventing CGO overhead maybe?
adastra22 9 hours ago|||
It’s been on by default for 2 years in Chrome.
purpleidea 7 hours ago||
This person was public on the recent nist list against hybrid solutions. I simply don't understand why they would oppose the safer option. Yes I've read the mailing list, it just all seems quite suspicious.
guessmyname 15 hours ago||
Brace for a wave of drive-by pull-requests swapping google/uuid [1] out for the now-standard uuid package [2].

Kubernetes project will be the first one [3] I guarantee it.

[1] https://pkg.go.dev/github.com/google/uuid

[2] https://go.dev/pkg/uuid

[3] https://github.com/kubernetes/kubernetes/blob/2220c3853a2402...

[4] https://github.com/google/uuid/issues/221

iaaan 14 hours ago||
Unfortunately for people SELECTing UUIDs out of a DB directly into a uuid struct, the built-in uuid structs don't implement the necessary interface for that, so you'll have to continue using the google package, or a plain string.
agwa 14 hours ago|||
The database/sql package gained native support[1] for the uuid.UUID type so it will Just Work even without the methods. This probably should have been mentioned in the release notes and database/sql package docs.

[1] https://cs.opensource.google/go/go/+/refs/tags/go1.27.0:src/...

semiquaver 11 hours ago||
Doesn’t the type name uuid.UUID violate go’s style guide for type naming? I seem to recall a fairly specific prohibition on stutter-types.
kbolino 11 hours ago|||
Repeating the package name is fine if it's exactly the same name (modulo capitalization) and there's nothing better to name the type anyway. The style issue would arise with e.g. uuid.UUIDVersion, which should just be named uuid.Version. There used to be a gopls lint that would flag names like uuid.UUID but it got relaxed awhile ago.
coder543 11 hours ago||||
No. What else could it reasonably be named? Hard to imagine.

The rule has always been intended to cover types that have another word in them but still choose to pointlessly repeat the package name.

`uuid.UUIDGenerator` is a hypothetical example of the anti-pattern that would instead be better named as `uuid.Generator`.

whateveracct 8 hours ago|||
> No. What else could it reasonably be named? Hard to imagine.

Ocaml often just has it be T

so uuid.T

tomjakubowski 8 hours ago|||
uuid.Entifier
markusw 4 hours ago|||
Yeah, I would have gone with uuid.V4 or something. But oh well, as long as it works. :D
dolmen 1 hour ago||
V4 or V7 are just how you initialize them (constructor), but then this the same representation, so they don't need specific types.
deepsun 14 hours ago||||
Or just a number (128-bit).
reactordev 14 hours ago|||
Oooof… well played go team, well played.
dabber21 14 hours ago||
will 'go fix' take care of this?
pjmlp 4 hours ago||
Struct literal changes while welcomed, have the issue of being a possible source of bugs, if there are overlapping fields,

type Habitat struct { Burrow string }

type Gopher struct { Name string Burrow string Habitat }

It will not initialise what one expects, here it is a contrived example, however it may not be easy to spot in more complex source code.

https://go.dev/play/p/dsY6tK5S8Ie

Better generics and improved SIMD are nice additions as well.

amiga386 2 hours ago||
Go has had this behaviour for promoting fields (provided they don't clash) for some time, this is just extending the language feature to initialisers.

Your contrived example doesn't initialise the embedded struct that also contains a "Burrow" field. If it did that at all, even without naming the Burrow field... you would not be allowed to initialise the struct, because of the ambiguity.

https://go.dev/ref/spec#Composite_literals

> A key must not denote a promoted field inside an embedded struct if that struct is also specified by another key.

> Given the declarations

    type Object  struct { name, color string }
    type Point3D struct { Object; x, y, z float64 }
    type Line    struct { Object; p, q Point3D }
> .... field selectors may not denote overlapping fields:

    obj   := Object{"edge", "black"}
    line3 := Line{Object: obj, name: "diagonal"} // invalid: name denotes a field inside Object
pjmlp 1 hour ago||
Which error?

https://go.dev/play/p/CFWVXkFBOEX

Note that I added a name field to Line.

    Data:  {edge black}  --  {{edge black} {{ } 0 0 0} {{ } 0 0 0} diagonal}
Oops now Object.name is empty, which is my point.
amiga386 1 hour ago||

    ./prog.go:20:29: cannot specify promoted field name and enclosing embedded field Object
Which is what you get if you don't add a direct "name" field to Line, because it's then completely unambiguous, the deeper "name"s are not promotable.
pjmlp 1 hour ago||
Yeah, but that isn't what I am talking about.

The whole point is the implicit bug, when the field is added and initialisation code rewritten to take advantage of this feature, without the developer realising the clash in first place.

amiga386 37 minutes ago||
I'm not sure what I can say. One man's "source of bugs" is another man's "convenient syntax".

The rule errs in favour of the developer and the struct they can see. Initialising (or accessing!) a named field always picks the one in the top-level struct if you have one there. It'll be there because you added it. Promoted fields can only get promoted if they are unambiguous.

If you don't want to take advantage of that, you can write in full:

    g := Gopher{
        Name:    "Gopher",
        Burrow:  "Burrow #42",
        Habitat: Habitat{Burrow: "Wild Acres"},
    }
    fmt.Println("Your burrow: ", g.Burrow)
    fmt.Println("I mean your _real_ burrow: ", g.Habitat.Burrow)
... but most Go programmers would look at the fact you named two fields the same and then nested them as an unforced error, a rookie mistake.

Most of them are very happy that they can embed some other type they don't know the full contents of, knowing they can access (and now initialise!) fields in it they care about, and thus don't give the fields in their own types the same name, while resting assured that if that other type later gains new fields they've never heard of, it's not going to clash with their own naming choices and break their code and force them to rename something. Their types' field names always come out on top, in their code.

You're doing "but what if I deliberately named my type's fields the same as the embedded type's fields?", which is like "but what if I deliberately stuck my hand in the meat grinder?" -- don't do that

j3nz 3 hours ago|||
I'd say it is as expected https://go.dev/play/p/sy6SMrOiw4y
pjmlp 3 hours ago||
I would at least expect a go vet warning in such cases.
0x696C6961 3 hours ago||
Mhm, probably worth a golang-ci check for duplicate field names which are accessed by methods on the embedded type.
pjmlp 3 hours ago||
Better would be a got vet check.

I understand the need not to break existing code that might have such fields.

0x696C6961 3 hours ago||
I think that's a no-go because vet checks have no-false-positive policy. Ie, when go vet flags something, its a bug.
pjmlp 2 hours ago||
I would say that initialising the wrong field because a dev is unaware of a clash between Gopher.Burrow and Gopher.Habitat.Burrow (naturally in more complex code), when upgrading to 1.27 and taking advantage of the feature without realising it, is a bug.
Xeoncross 15 hours ago||
> First, generic methods are now supported > Generic functions can now be used without explicit type arguments

Great! This was an ergonomic code issue I hit when trying to create a universal handler/controller generic that could hydrate/populate function arguments (from a request body) without having an actual copy of the arguments: https://github.com/xeoncross/mid/blob/main/handler.go#L12

knocte 6 hours ago||
Can proper Result/Option types be created for Go now?
dgunay 2 hours ago||
You can do pipelined option/result manipulation now, but without sum types/pattern matching it's not going to be quite as useful as Rust's.
iaaan 14 hours ago||
Neat, stealing this.
Xeoncross 12 hours ago||
I wrote a blog on it if you're interested: https://xeoncross.com/2026/better_go_handlers.html
greg9381 10 hours ago||
Thanks for the link, looks like a very pleasant framework to use! I was interested to see "Mid-fasthttp" on the slower end in the benchmarks at the bottom, do you know why that is?

Btw, the Gin and Echo examples reference an "input" variable but it doesn't seem to be defined there? Maybe it was intentional, since the examples are just to give a general idea of how the handler looks in each library, but thought I would let you know just in case it wasn't.

Xeoncross 9 hours ago||
Due to the fact that fasthttp is not net/http compatible it is due to the conversion being required from a https://pkg.go.dev/net/http#Handler. It was included for information purposes as I though someone would be curious.
xavdid 13 hours ago||
I love these release notes but I really wish they would add syntax highlighting to the Go blog. I'm always a little bit surprised/disappointed whenever I land on a go.dev link since I know the code will be just a little harder to visually parse than it needs to be.
Cthulhu_ 29 minutes ago||
I get the why, kind of - if you need colors to make sense of code, maybe the code isn't clear enough. If you send blobs of code through email and other systems that don't necessarily have syntax highlighting, it also makes sense. But on a website, whyever not?

Personally I can't say when I was last actually aware of syntax highlighting. The only time I'm actively engaged with it is to change the default low contrast comment color that a lot of themes have (for some reason, as if comments are unimportant / noise) to something better. For Go, I don't really notice when it has or doesn't have syntax highlighting, at least not on e.g. go's website.

treyd 13 hours ago|||
There's a reason for this. Rob Pike was asked about it and said that syntax highlighting reminds him of the bright colors of children's toys and he personally disables it so that he can focus on the text.

I don't know why it's still like that but that's the original reasoning.

tester457 13 hours ago|||
> Syntax highlighting is juvenile. When I was a child, I was taught arithmetic using colored rods (http://en.wikipedia.org/wiki/Cuisenaire_rods). I grew up and today I use monochromatic numerals.

https://groups.google.com/g/golang-nuts/c/hJHCAaiL0so/m/kG3B...

whack 9 hours ago|||
Wow, that thread is a piece of work

> Gofmt was written to reduce the number of pointless discussions about code formatting. It succeeded admirably. I'm sad to say it had no effect whatsoever on the number of pointless discussions about syntax highlighting, or as I prefer to call it, spitzensparken blinkelichtzen.

> When I was a child, I used to speak like a child, think like a child, reason like a child; when I became a man, I did away with childish things.

I sincerely hope Rob Pike was being sarcastic/ironic, because otherwise, he sounds insufferable

gizzlon 3 hours ago|||
> because otherwise, he sounds insufferable

Oh come on, I like syntax highlights, but this is not "insufferable". It's just opinions expressed strongly, with probably some tounge-in-cheek

whateveracct 8 hours ago|||
he is insufferable. it's his thing lol.
IshKebab 12 hours ago||||
That must be why traffic lights and electrical wires and transit maps are all black and white...
abtinf 12 hours ago||
That’s an interesting point.

The reason traffic lights are colored is because they are showing distinct states of the same thing and the color is the means of differentiating.

Same for transit maps: different routes are colored to distinguish them from other routes, which is especially useful if they overlap.

But that’s not what syntax highlighting does.

The equivalent of your examples would be to not highlight the syntax at all, but only use color coding to distinguish variables.

The equivalent of how syntax highlighting currently works for your examples would be if the light fixture was one color, and the light pole was another, but then all the actual lights were the same color.

I actually think highlighting only the variables with distinct colors could be extremely valuable. Would certainly help avoid mistakes with nested i/j loop counters.

Edit to add: come to think of it, it would have been even more valuable in Go, until recently anyway. The variable color coding would expose the common loop variable instance bugs, because a programmer would be instantly puzzled by the unexpected coloring.

wgrover 6 hours ago|||
Your comment makes me think of LabVIEW - if you're not familiar with it, it uses a visual programming language ("G") in which data flows down wires. The color of the wire indicates the wire's data type (blue for ints, orange for floats, green for bools, pink for strings) and the width of the wire indicates the dimensionality of the data (thin line = scalar, thick line = 1D array, double-thick = 2D array). The color is more than decorative or even assistive - it's essential to understanding the program.
DeepSeaTortoise 4 hours ago||
I still wonder why every open-source visual programming language is either a toy for teaching or straight up awful, often not implementing but even loops, when LabVIEW has been doing it right for decades.

Despite its huge size and it installing several services that constantly run in the background, it's still one of my favorite "languages" of all time. It's the only one I've ever seen people going from never having programmed before to making simple but meaningful contributions in within a single day.

nopurpose 1 hour ago||||
> The reason traffic lights are colored is because they are showing distinct states of the same thing and the color is the means of differentiating

I wonder if traffic lights were invented today, would it be just one light changing colour?

IshKebab 11 hours ago||||
That does exist, it's called semantic highlighting.

In any case, my analogy was not perfect, but neither was Russ's! The point is it's totally normal and not "childish" to use colours to help distinguish things. Traffic lights do not technically need colours (you can use the position of the lights - I assume that's what badly colourblind people do). Nor do transit maps technically need colours - you could just label the lines, or use patterns.

https://www.flickr.com/photos/gywst/1407078279

It's completely absurd to say that colours are childish because they can help children.

sneak 2 hours ago|||
There are a bunch of identical things on my screen called lines. They contain a bunch of mostly identical things called tokens. Syntax highlighting uses different colors to identify the different purposes of all of these tokens blasted onto my screen.
wredcoll 9 hours ago|||
I want to downvote this for being one of the stupidest things I've read this week but you're just quoting it so I guess I'll just seethe silently.
mathisfun123 8 hours ago||
never discount the possibility of so called brilliant people having dumb AF takes.
jeremyjh 11 hours ago||||
What is childish is holding up one guy's editor preferences as a religious sacrament when 99.9% of your readers have different preferences.
dotwaffle 9 hours ago||
Well, there's kind of a precedent at least...

> Gofmt's style is no one's favorite, yet gofmt is everyone's favorite.

saturn_vk 23 minutes ago||
That's been a major success
xavdid 13 hours ago||||
That makes sense as a personal preference for him, but it's odd for that to still be the company/project stance. Like, surely he knows he's the minority for not wanting highlighting?
jeremyjh 11 hours ago||
Oceania had always been at war with Eastasia.
tgv 4 hours ago||
Apart from the fact that your comment is against the rules: please don't trivialize that quote. It has a profound meaning, and is completely out of place here.
mparnisari 13 hours ago||||
that's an extremely odd explanation and it makes me think that he has some hidden PTSD. it's also insane that one person's preference trumps the rest of the world's.
pigeonhole123 13 hours ago|||
He also doesn't capitalize his sentences.
Groxx 4 hours ago|||
I like to alternate. or use constructions that make it ambiguous.
8-prime 4 hours ago|||
Maybe he was talking in private.
zanderwohl 13 hours ago|||
Welcome to Go as a project.
catlifeonmars 4 hours ago|||
Born out of C++ trauma apparently, for context
tayo42 12 hours ago|||
Child hood trauma led to if err != nil and now the rest of us get to share that trauma? Makes slight sense I guess.
parsd 12 hours ago|||
I understand and respect this position. I think syntax highlighting is a highly subjective matter, bordering on personal preference with regard to shell interactions, editor configurations, bindings, shortcuts, snippets, and the like. It's also... insignificant somehow, like quibbles over formatting rules that Go settled once and for all with `go fmt`.

I often prefer not to enable syntax highlighting just for color. Occasionally I'd choose some minimal theme that only highlights string literals and keywords. So it has two or three colors. But some of the color schemes I see are a festival of lights where every special element of syntax has its own color. I don't understand how that is supposed to help me parse anything and why the rules are complex. The `range` keyword needs to be purple, and `chan` must be navy blue. Why exactly? And every site has a different color scheme? There is no consensus, and there shouldn't be.

For a serious community-driven project like Go, dealing with the question of syntax highlighting is strange. The creators deliberately avoided the questions of IDEs and editors for Go, leaving them to the community. I think the same principle applies here.

catlifeonmars 4 hours ago||
> The creators deliberately avoided the questions of IDEs and editors for Go, leaving them to the community. I think the same principle applies here.

Exactly. This is fundamentally about accessibility (in the broadest sense). Do people have opinionated screenreader settings they like to force on others too?

dolmen 1 hour ago|||
The Go official web site doesn't even use the Go fonts: https://go.dev/blog/go-fonts

I wonder if the Go fonts has been created just to get a trademark on the "Go" word...

amiga386 7 minutes ago||
The Go language is by itself more than enough to get a trademark. They only additional thing you can do with a font is get a design patent... for the font.

It's more likely that they don't feel the need to use the font they gave you (for your code editor) on code samples on their own web pages. As it's a custom font, the text would be susceptible to pop-in, or would visibly switch from one font to another, both of which are ugly.

Their CSS says this:

    #blog .Article[data-slug='/blog/go-fonts'] code {
      font-family: 'Go Mono', monospace;
    }
    #blog pre,
    #blog code {
      font-family: monospace;
    }
So they have no specific font preference for code samples, they only show their Go-specific font on the blog post about it. They prefer fast loading and no jank over custom font.
theplumber 7 hours ago|||
When I started learning Go I went all in including using the recommended editor (acme editor) which has no syntax highlighting, no autocomplete and a very different way of writing code. My production went down a lot but the quality of the code went up a lot.

I think the lack of syntax highlighting was one reason for that. It makes you think more about the code you write and how it should compose, while a fully fledged IDE encourages you to just throw more code at the problem.

I think the ACME way should be used for love of code and ideally when you want to create libraries that stand the test of time. When you just want to get things done fast bring the full IDE and now some LLM vibes and it’s done.

catlifeonmars 4 hours ago|||
I go through intervals of turning autocomplete on and off. I think autocomplete is useful for boilerplate (similarly LLMs are useful for boilerplate), but I prefer not to use either when writing code where correctness is particularly important. This is because it’s easier for me to internalize what something is doing by typing it out. It’s actually more effort for me to understand code by reading it rather than writing it.

I experience something similar with system design, where the act of creating a diagram helps me to understand much faster than trying to read someone else’s diagram. It’s not because only I can create good diagrams (I cannot) but again because the act of creating one helps me internalize the design.

dolmen 1 hour ago|||
Are you using the Go fonts?

https://go.dev/blog/go-fonts

ClikeX 13 hours ago||
I just have a tampermonkey profile for go.dev to fix that for me.
olingern 15 hours ago||
> Second, a key in a struct literal may now be any valid field selector for the struct type, allowing fields in nested or embedded structs to be initialized directly

It's been a while since I've written more than anything trivial in golang, but this seems like a big deal to me. As in, I can define a struct that is consistent and reusable in other structs

andreimackenzie 13 hours ago||
This will shorten many test files!
konart 15 hours ago||
This is quite a QoL issue, but is it big? Nothing changes from functional point of view.
onionisafruit 13 hours ago||
It will be very nice working with code generators like oapi-codegen that can generate either nested structs or very unwieldy struct names. So big in that context, but like you said just a nice qol improvement most of the time.
piinbinary 15 hours ago||
This makes me want to find a side project for an excuse to give Go another try (I last used it professionally pre-generics).

I do still wish it had discriminated unions (algebraic data types) and some better error handling ergonomics.

ainar-g 15 hours ago||
Re unions:

https://github.com/golang/go/issues/76920

You might want to follow this proposal, if you aren't already. It's the most recent one, and it's supported by quite a few “core members” of the Go Team. I don't think it'll land in 1.28, but I like the fact that it's still a feature that's being actively discussed.

catlifeonmars 4 hours ago|||
Having worked a couple of greenfield go shops post generics, it’s still quite rare to find them in first party code. They’re just not that useful outside of library APIs. Proper algebraic data types would be a huge game changer.
codegeek 15 hours ago|||
Do it. It is just a beautiful language to write and much simpler to pickup than many others. I am a fan boy of course but I love Go.
osigurdson 14 hours ago||
Go is extremely easy to pickup. If you know any language you probably know Go already for the most part (channels notwithstanding).

I wouldn't say it is a "beautiful" language however. Though that is in the eye of the beholder, I don't think the Go designers were even really going for beauty.

fragmede 14 hours ago||
They were going for readability. You can make some impossible to read code with C++ because the programmer was too clever, and the designers of golang wanted to avoid that.
atomicnumber3 8 hours ago||
They were, very unfortunately, outsmarted by said too-clever programmers. As such I would like to request my enums and ternaries be returned to me. Trust me, they will not make a dent in the messes people have still managed to create.
Splizard 15 hours ago||
Tagged unions can be implemented in user code, you dont actually need language support to use them.

https://github.com/splizard/tagged

mirashii 14 hours ago|||
This is only a small piece of the story for what people say when they want tagged unions. Without all of the ancillary support in the language, like exhaustive pattern matching, it really doesn't count.
Splizard 14 hours ago||
You can also add support for exhaustive switches on tags.
catlifeonmars 4 hours ago||
Just as a linter config though?
kccqzy 13 hours ago||||
The C++ committee said the same thing, and gave us std::variant. They are painful to work with and do not really deliver most of the benefits people want.
shhsshs 14 hours ago|||
That is a LOT of code (very ugly code, I would add) that could be replaced by `type Float = float32 | float64` in a language with actual support for union types.
kccqzy 13 hours ago|||
Tagged unions are not union types. A union type is a supertype for any arbitrary collection of types, but a tagged union aka sum type is a single type with multiple data constructors, and does not require subtyping to be implemented.
tyho 14 hours ago||
The SIMD stuff is incredible. I have been having lots of fun with it. You can use LLMs as a scalar to SIMD transpiler, it works amazingly well.

Sure a SIMD expert writing assembly can probably do a better job than an LLM using these new intrinsics, but it’s still massively faster.

nasretdinov 5 hours ago||
I still believe that SIMD support is one of the most underrated new features in Go.

It's relatively straightforward to read and to write code using Go's SIMD package (the caveat being that you have to convert your data to SoA manually), and it gives comparable performance to other languages, since there's little in the way of GC overhead, bounds checking, etc, in this case.

So SIMD not only increases performance on its own, but it also closes the performance gap between Go and C++ / Rust, which has been a major cause for rewrites in the past. The memory usage overhead due to GC doesn't go anywhere of course, so there are still performance reasons to "Rewrite in Rust", but it's now become much easier to just optimise the hell out of Go code instead.

thiht 21 minutes ago||
Are rewrites from Go to Rust for performance reasons really that common?
nkanaev 14 hours ago|||
Agreed. I've recently translated a pangram generator project written in Rust [1] leveraging SIMD to do the same in Go [2] to see how it fairs in terms of speed - the results are pretty close. In my local machine I'm getting ~3GHz in Rust vs ~2.4GHz in Go, which I think is really impressive.

[1]: https://github.com/tuzz/pangram-machine

[2]: https://github.com/nkanaev/pangram-machine-go

drivebyhooting 8 hours ago||
“Do a breakthrough and make this SIMD fastest”
patabyte 15 hours ago|
I'm so glad the new uuid package landed - it's overdue but a very welcome addition! I've already replaced github.com/google/uuid with `uuid` in several projects
More comments...