There are many reasons to be excited about generics in Go. In this blog post I’m going to show how, using the generics, we got a 40% performance gain in an already well optimized package, the Google B-Tree implementation. A B-Tree is a kind of self-balancing tree. For the purpose of this blog post it’s sufficient to say that it is a collection. You can add, remove, get or iterate over its elements
Published on 04/24/2022, 2363 words, 9 minutes to read Go 1.18 added generics to the language. This allows you to have your types take types as parameters so that you can create composite types (types out of types). This lets you get a lot of expressivity and clarity about how you use Go. However, if you are looking for good ideas on how to use Go generics, this is not the post for you. This is fu
Recently, a new set of sorting functions has landed in Go's golang.org/x/exp/slices package [1]. These functions leverage Go generics to provide a more ergonomic API for sorting (without requiring users to implement sort.Interface), and also deliver a nice performance improvement, as the CL demonstrates. In this post, I'll dive deep into why these generic functions are faster than the existing one
The Go 1.18 release adds support for generics. Generics are the biggest change we’ve made to Go since the first open source release. In this article we’ll introduce the new language features. We won’t try to cover all the details, but we will hit all the important points. For a more detailed and much longer description, including many examples, see the proposal document. For a more precise descrip
Ian Lance Taylor Robert Griesemer July 31, 2019 SupersededWe will not be pursuing the approach outlined in this design draft. It has been replaced by a new proposal. This document exists for historical context. AbstractWe suggest extending the Go language to add optional type parameters to types and functions. Type parameters may be constrained by contracts: they may be used as ordinary types that
Ask questions and post articles about the Go programming language and related tools, events etc. I'm in the process of learning Go, and I was wondering why there's such a large debate of generics, especially since one of the original "features" of the language was the lack of generics for simplicity's sake. I guess the real thing I want to know is variations on a single question: What are the spec
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く