Programming languages: Go just received its biggest update ever - why Learn Go in 2022?
Go 1.18 is out - Google Cloud just got serious about programing.
Go. 1.18 launched on March 15th, 2022.
At Datascience Learning Center, I try to sometimes cover some programming news. Golang has become more important in recent years.
Do you think this article might be share worthy?
Why Learn Go?
Programs that are written in Golang normally run faster than programs written in other programming languages. Golang helps to develop complex and interesting software. The source code of Golang is freely available, as it is an open-source programming language. Its compiler, libraries, and tools are all free to anyone.
Golang is one of the in-demand skills and rising programming languages and it makes sense to learn Golang in 2022 to develop better software in a quicker time.
The Latest Release
The latest Go release, version 1.18, is a significant release, including changes to the language, implementation of the toolchain, runtime, and libraries. Go 1.18 arrives seven months after Go 1.17. As always, the release maintains the Go 1 promise of compatibility. They developers expect almost all Go programs to continue to compile and run as before.
Go, designed at Google, is syntactically similar to C, but with memory safety, garbage collection, structural typing, and CSP-style concurrency.
What’s Special about Go 1.18?
Go 1.18 marks the culmination of over a decade of design and delivers the features most demanded by developers, says Google.
Golang generics support is a landmark event in the language's evolution that some say could expand enterprise usage, while others are nervous about potential complexity.
Google has announced a "milestone" update to the Go programming language with the launch of Go 1.18, which introduces native support for fuzz testing – the first major programming language to do so.
What is Generics in Go you may ask? With generics, you can declare and use functions or types that are written to work with any of a set of types provided by calling code.
Generics
In Go 1.18, they’re introducing new support for generic code using parameterized types. Supporting generics has been Go’s most often requested feature, and the team announced that they are proud to deliver the generic support that the majority of users need today. Subsequent releases will provide additional support for some of the more complicated generic use cases. We encourage you to get to know this new feature using our generics tutorial, and to explore the best ways to use generics to optimize and simplify your code today. The release notes have more details about using generics in Go 1.18.
So what is Fuzzing you may ask? Fuzzing is a type of automated testing which continuously manipulates inputs to a program to find bugs. Go fuzzing uses coverage guidance to intelligently walk through the code being fuzzed to find and report failures to the user.
Put another way as Google explains it, fuzz testing or 'fuzzing' is a means of testing the vulnerability of a piece of software by throwing arbitrary or invalid data at it to expose bugs and unknown errors.
Fuzzing
With Go 1.18, Go is the first major language with fuzzing fully integrated into its standard toolchain. Like generics, fuzzing has been in design for a long time, and we’re delighted to share it with the Go ecosystem with this release. Please check out our fuzzing tutorial to help you get started with this new feature.
So what are Workspaces? A workspace, in a nutshell, is a directory on your system where Go looks for source code files, manages dependency packages and build distribution binary files. Whenever a Go program encounters an import statement, it looks for the package in the Go's standard library ( $GOROOT/src ).
Workspaces
Go modules have been almost universally adopted, and Go users have reported very high satisfaction scores in our annual surveys. In our 2021 user survey, the most common challenge users identified with modules was working across multiple modules. In Go 1.18, we’ve addressed this with a new Go workspace mode, which makes it simple to work with multiple modules.
Why Go 1.18 is Remarkable
While other languages support fuzzing, Go is the first major programming language to incorporate it into its core toolchain, meaning – unlike other languages – third-party support integrations aren't required.
Go is an open-source programming language originally developed by a team at Google, which includes Ken Thomson, creator of UNIX and C, and enhanced by many contributors from the open-source community.
The reason I see this as relevant for the future of coding is how Google frames this release. Go 1.18, which Google touts as "the culmination of over a decade of design", one which delivers a number of significant updates to the programming language that have long been requested by developers.
A Peak Into How Open Source Code Evolves
This also gives you insight into the evolution of open-source software in a community over years.
The following is a list of the most visible changes. For a more comprehensive overview, see the proposal. For details see the language spec.
The syntax for function and type declarations now accepts type parameters.
Parameterized functions and types can be instantiated by following them with a list of type arguments in square brackets.
The new token
~
has been added to the set of operators and punctuation.The syntax for Interface types now permits the embedding of arbitrary types (not just type names of interfaces) as well as union and
~T
type elements. Such interfaces may only be used as type constraints. An interface now defines a set of types as well as a set of methods.The new predeclared identifier
any
is an alias for the empty interface. It may be used instead ofinterface{}
.The new predeclared identifier
comparable
is an interface that denotes the set of all types which can be compared using==
or!=
. It may only be used as (or embedded in) a type constraint.
What Google Says about Go’s Upgrade
Google is also making much of the language's new support for generic code using parameterized types, which has been the feature most requested by Go users.
Without support for generics, Go users have to repeat similar code for each data type they use, said Steve Francia, Google's product and strategic lead for Go.
So software evolution in this way is usually tied to a powerful BigTech patron, who typically create it and scale the language up for commercial and software purposes. Goland is reaching a next level of maturity here in 2022 with this release.
Golang Adoption Goes Mainstream in the 2020s
Golang along with Rust are truly growing in adoption in the 2020s.
Google created Go in 2007 and was designed specifically to help software engineers build secure, open-source enterprise applications for modern, multi-core computing systems.
More than three-quarters of Cloud Native Computing Foundation (CNCF) projects, including Kubernetes and Istio, are written in Go, says Google. According to data from Stack Overflow, some 10% of developers are writing in Go worldwide, and there are signs that more recruiters are seeking out Go coders in their search for tech talent.
Go 1.18 includes an implementation of fuzzing as described by the fuzzing proposal.
See the fuzzing landing page to get started.
While BigTech grows the community and the adoption and development of the language, it uses the “community” as a kind of volunteer training force that also come up with good ideas. So open-source also has an architecture of scalability and a playbook in how it develops over years.
Although we have a dedicated Go team at Google, we welcome a significant amount of contributions from our community. It's a shared effort, and with their updates we're helping our community achieve Go's long-term vision. Google said.
Distributed Web
Go, also known as Golang, was created at Google in 2007 with a focus on developer productivity in distributed web application environments. The language has been adopted by many programmers since then because of the clarity of its syntax and the fact that it is usually easy for developers to learn quickly, compared with older programming languages such as Java and C++.
Here is the list of some of its advantages:
• Simplicity of code
• A large number of libraries
• Flexibility
• Straightforward build process
Support for Generic Types Within Functions
However, one of the key structural differences between the Golang's syntax and that of others commonly used among enterprise programmers has long been a source of significant debate within the Go community: support for generic types within functions.
Until this week's release, Go has been strictly a strongly-typed language, meaning programmers must specify the type of parameter they want to use within a function. In other languages, including Java and C#, programmers can instead use generic types, which don't require specifying types, such as numeric values, each time they write a function.
The Open-Source Enterprise Language of Choice?
With 1.18, Go is really able to go mainstream in the Enterprise community. Which could ultimately be good for Google Cloud.
The goals of the Go project were to eliminate the slowness and clumsiness of software development at Google, and thereby to make the process more productive and scalable.
Google is scaling in the cloud pretty well in its race to catch Azure and AWS with Google Cloud. In 2021, Google Cloud had about 8 percent market share of the U.S. market. Azure has 21 percent, while AWS has about 32 percent.
So why am I talking about the Cloud when this is a programming code release?
Google Cloud has introduced a new update to the Go programming language they are touting as the most significant release of the language to date — with features that enhance security and developer productivity and improve the performance of Go.
Go and Rust might be sisters of the future of Enterprise code, if I have to be honest. You may have noticed I have an obsession with Rust, at least for a non-programmer in this Newsletter.
A 20% CPU Performance Boost
Go's creators were always open to generics support, but it has taken time to add it without compromising the fundamental values of the language around simplicity and balance performance tradeoffs.
Key updates in Go 1.18 include the aforementioned new support for generics; fuzzing, which will be integrated into Go 1.18’s standard toolchain and CPU performance improvements of up to 20% and more, Francia said.
Go was created at Google in 2007, designed to help developers build fast, reliable and secure software. And that goal remains the same as the language maintains a six-month release cadence. There are about two million Go developers, Google said.
That’s a lot of developers. The language was designed by and for people who write — and read and debug and maintain — large software systems. It has modern features like garbage collection from Java, and it also takes advantage of powerful multi-core computer capabilities with built-in concurrency support, again similar to Java. It has pretty interested optimization features and is useful.
The average golang developer salary in the USA is $135,000 per year or $69.23 per hour. Entry level positions start at $119,553 per year while most experienced workers make up to $170,000 per year.
While others may see Rust and Go as competitive programming languages, neither the Rust nor the Go teams do. Companies are finding value in adopting both languages and in their complimentary value.
Clearly Rust and Go have a bright future.
"A critical aspect of this is being able to understand and verify the security of open-source dependency chains. The 1.18 release of Go is an important step towards ensuring that developers are able to build the most secure applications, understand risk when vulnerabilities are discovered, and reduce the impact of cybersecurity attacks."
You got to be secure in the Cloud.
These new language changes required a large amount of new code that has not had significant testing in production settings. That will only happen as more people write and use generic code. The Team believe that this feature is well implemented and high quality.
Rust and Go if you think about it were both were created as reactions to shortcomings the creators were experiencing with existing languages in the industry, particularly shortcomings of developer productivity, scalability, safety and concurrency, according to Turner and Francia.
So what do they both say about the future of code?
1. Performance and Concurrency
2. Team Scalable — Reviewable
3. Open Source-aware
4. Safety
5. Truly Portable
Want to support an independent creator that depends on the community for tips, patronage and their food money? That’s me.
Golang May be One of the Best First Languages to Learn today in 2022
I also think Golang might be one of the better programming languages to learn first, even before Python. Why is that? Golang can be quickly learned by a beginner – someone who does not know any programming language at all and wants to become a developer. Go is almost as easy as PHP or even Pascal, but at the same time as powerful as C++.
Golang Generics is widely seen as the key upgrade of 1.18.
Generics has been called the most significant change to the Go programming language since the release of Go 1.0 in 2012. It was also the most-requested feature by Go programmers.
There are three experimental packages using generics that may be useful. These packages are in x/exp repository; their API is not covered by the Go 1 guarantee and may change as we gain more experience with generics.
Constraints that are useful for generic code, such as constraints.Ordered
.
A collection of generic functions that operate on slices of any element type.
A collection of generic functions that operate on maps of any key or element type.
Golang is also one of the fastest-growing languages in terms of popularity, which means learning Go can open new doors of opportunity and can also help you to get a job in Google, given they use Go a lot.
Most of today’s popular languages were designed over 30 years ago. That’s why I often cover Newsler languages that bring new solutions.
The story goes that Google engineers designed Go while waiting for other programs to compile. Their frustration at their toolset forced them to rethink system programming from the ground up, creating a lean, mean, and compiled solution that allows for massive multithreading, concurrency, and performance under pressure.
Go ensures that your toolbox is compilable across all platforms and on all hardware. It uses a surprisingly simple package management solution that “just works” and it is extremely portable. You can easily replace your scripting languages with Go and your compiled languages will definitely get a run for their money when stacked against Go solutions.
Anyways I hope this gave you a quick into as to what the fuss is all about for the Go 1.18 update.
If you prefer to get a notification on an iOS device instead of getting an Email you can with Substack’s new iOS app.
I’m trying to write on this Newsletter a bit more often, but there will be times where this cadence drops off.
As this is my full-time gig, I need all the help I can get to keep going.