VOOZH about

URL: https://thenewstack.io/this-week-in-programming-has-the-time-finally-come-for-generics-in-golang/

⇱ This Week in Programming: Has the Time Finally Come for Generics in Golang? - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2020-06-20 06:00:35
This Week in Programming: Has the Time Finally Come for Generics in Golang?
this-week-in-programming,
Software Development

This Week in Programming: Has the Time Finally Come for Generics in Golang?

And updated design draft for adding generics to Golang has received broad community support and is open for feedback.
Jun 20th, 2020 6:00am by Mike Melanson
👁 Featued image for: This Week in Programming: Has the Time Finally Come for Generics in Golang?
Feature image via Pixabay.

The debate around adding generics to the Go programming language has been going on for years now, often with much resistance, but it’s starting to look like one proposal finally has some backing and general acceptance from the greater Go community — much to the surprise of some involved.

Introduced this week in a blog post looking at the next step for generics, penned by Golang team members Ian Lance Taylor and Robert Griesemer, the first update in nearly a year on the topic explains that the generics design draft previously submitted for feedback has been refined, resulting in an updated design draft. The authors summarize the primary difference between the two proposals:

The biggest change is that we are dropping the idea of contracts. The difference between contracts and interface types was confusing, so we’re eliminating that difference. Type parameters are now constrained by interface types. Interface types are now permitted to include type lists, though only when used as constraints; in the previous design draft type lists were a feature of contracts. More complex cases will use a parameterized interface type.

For the time being, the team has introduced an experimentation tool that “permits people to type check and run code written using the version of generics described in the design draft” by translating generic code into ordinary Go code. It is meant to give users a feel of how the proposed design would, if accepted work, and they note that it will be implemented differently if so.

I’ve done over 1000 (mostly API design) reviews when I was working on Go. You might be wondering who needs generics, here are my three categories:
– Data layers, database APIs
– Collections
– Container types

Lack of generics is not just copy/paste but causing error-prone APIs.

— Jaana Dogan (@rakyll) June 17, 2020


As for the proposal itself, it offers several levels of detail, from an abstract, to a high-level overview, to the full level of detail you might expect from such a document. As with everything Go, the design is intended to be fully backward compatible with Go 1, and the authors note that “as the term generic is widely used in the Go community, we will use it below as a shorthand to mean a function or type that takes type parameters. Don’t confuse the term generic as used in this design with the same term in other languages like C++, C#, Java, or Rust; they have similarities but are not the same.”

The team says that they are, as usual, looking for feedback from the Go community at large, with the best way being to use the golang-nuts@googlegroups.com mailing list. In this effort, they are looking to learn two primary things:

“First, does generic code make sense? Does it feel like Go? What surprises do people encounter? Are the error messages useful?

Second, we know that many people have said that Go needs generics, but we don’t necessarily know exactly what that means. Does this draft design address the problem in a useful way? If there is a problem that makes you think ‘I could solve this if Go had generics,’ can you solve the problem when using this tool?”

“Go is a toy language because there are no generics”
*Adds generics*
“Real languages use <T>”

— Miek Gieben (@miekg) June 17, 2020

This Week in Programming

  • Go Package Repository Goes Open Source: One more bit of Go news before we move on, the team also announced this week that pkg.go.dev is now open source, and accepting contributions. For those interested in getting involved, the repository lives at go.googlesource.com/pkgsite, mirrored to github.com/golang/pkgsite, and you are encouraged to read the contribution guidelines. Currently, design issues are on the top of the list for what to tackle next, including a more cohesive search and navigation experience.
  • GitHub Gets “Super Linter”: GitHub has introduced its “one linter to rule them all”, the GitHub Super Linter, which it was originally built internally to maintain consistency in its own documentation and code. The team has open sourced the tool, which helps prevent broken code from being uploaded to master branches, establish coding best practices across multiple languages, build guidelines for code layout and format, and automates the process to help streamline code reviews. The Super Linter itself is packaged into a Docker container and called by GitHub Actions, allowing for any repository on GitHub.com to call it. For full details, check out the README.md.

C programmers are like pic.twitter.com/8sREwhgVVh

— Graham Christensen (@grhmc) June 17, 2020

  • Azure Offers Free Course, Scholarship in Machine Learning: Microsoft Azure has come out with Udacity to announce the Azure Machine Learning scholarships and courses, which it says will help address the rising demand for artificial intelligence (AI) and data science roles. The free, introductory course is based on Azure Machine Learning and offers a low-code experience using Azure Machine Learning’s automated ML and drag-and-drop capabilities. The companies will also offer a new machine learning Nanodegree Program, in which students will build and deploy ML solutions using tools and frameworks such as PyTorch, TensorFlow, scikit-learn, and ONNX. The top 300 performers in the free introductory course will be offered scholarships to the Nanodegree Program, and more details are available on the course page.
  • AWS Adds EFS For Lambda Functions: AWS has introduced a shared file system for Lambda functions with the ability to “mount an Amazon Elastic File System (EFS), a scalable and elastic NFS file system storing data within and across multiple availability zones (AZ) for high availability and durability.” The feature will let you store and share data across all concurrent execution environments of Lambda functions and access the same EFS file system from multiple functions. Users will also be able to share the same EFS file system with Amazon Elastic Compute Cloud (EC2) instances, containerized applications using Amazon ECS and AWS Fargate, and on-premises servers.

git push origin andtonic

— Leah Culver (@leahculver) June 17, 2020

  • Flash EOL On The Way: SDTimes writes that Adobe is reminding its users that the Flash end of life is coming up at the end of 2020, with the company ceasing distribution and updates. I don’t know about you, but I’m glad my pursuit of Flash ended about fifteen (or so) years ago — as did Flash’s real popularity, as SDTimes notes began with the release of the iPhone, which didn’t support Flash. Adobe announced the end of Flash back in 2017, citing open standards such as HTML5, WebGL, and WebAssembly. On its Flash Player End of Life page, Adobe says that it will not only remove downloads for all versions, but also that “Flash-based content will be blocked from running in Adobe Flash Player after the EOL Date.”

remember logging off?

— Owen Williams ⚡ (@ow) June 16, 2020

TRENDING STORIES
Mike is a freelance writer, editor, and all-around techie wordsmith. Mike has written for publications such as ReadWriteWeb, Venturebeat, and ProgrammableWeb. His first computer was a "portable" suitcase Compaq and he remembers 1200 baud quite clearly.
Read more from Mike Melanson
SHARE THIS STORY
TRENDING STORIES
Amazon Web Services is a sponsor of The New Stack.
TNS owner Insight Partners is an investor in: Leah, Docker, Real.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.