This is a creation in Article, where the information may have evolved or changed.
Anyone who has Zapier or heard my quick speech in Friday can attest that I think Go is a great programming language. In this article, I'll share some of the drawbacks of why I think it's great, use it, and why it's not part of our Zapier stack.
Go is a programming language developed by Google, designed to help large development teams successfully build and maintain high-performance software projects. It was open source in 2009 and released in 2012 Go 1.0. Since then, many organizations, including prominent companies such as Docker and Hashicorp, have begun to use the language successfully in their projects.
tocy translated 3 days ago 1 people top Top Well translated!
My first go at go
I wrote the first line Go program about 4 years ago. In the beginning, I could not "essentials". The language seems interesting and programmers are bragging about going well, but I don't have a notion of these benefits. Until I ported a Python real project to go, the real-world needs made me appreciate the beauty of go.
The project I ported was a very small REST API implemented using Redis. It's just a simple caching system that moves "inactive" data to disk and keeps "active" data in Redis. I need an easy way to distribute this API and configure the Redis server so that it doesn't consume a lot of memory and keep it fast. After using Go, it is found that spoiler Alert is well suited for this requirement.
Viyi translated 3 days ago 1 people top Top Well translated!
Why is Go great?
I think Go is a great programming language for a number of reasons. I was able to prototype, test, and deploy a production system in a few days if the real world needed it, and the CPU and memory overhead would be small if I could handle 5 times times more requests per second.
This is because GO is simple, with only a very small (but very full) standard library. I was able to master most of the language concepts, embedded packages, and common statements within a few hours.
no translation 3 days ago 1 people top Top Well translated!
In addition, Go has some other things:
Static type
Compile
Separate binary release
Garbage collection
Built-in concurrency and primitives
Can be connected to the popular C library
Rich documentation
Have a vibrant and growing community
Zapier started out as a Python store. When the content listed above is only partially implemented in Python, the Go to the entire list is very appealing. We deal with thousands of API calls per hour, and performance is very important to us. So why not switch to Go?
Viyi translated 3 days ago 1 people top Top Well translated!
Why isn't Go so good ?
There is no perfect programming language; everything needs to be weighed. Go is good at compiling speed and application performance, but this is at the cost of programmer productivity.
The most controversial part of the tradeoff is that Go provides a static type system, but no generics. This means that container class data structures cannot be freed from the type conversions of unknown type pointers (types) except lists and hash tables interface{} .
Viyi translated 3 days ago 1 people top Top Well translated!
Go also has some things that are bad for programming:
Using third-party code can make dependency management difficult.
The type system is simple, but differs greatly from the classic object-oriented and inheritance models. It's very much like C. Structure + interface. No class. No inheritance.
There are no canonical exceptions or Try/catch. This may be considered a positive architecture, but Go often lets developers fall into their panic (critical error)/recover (recovery) system.
Some people recognize garbage collection and are not suitable for system programming languages like Go. I'm the kind of person who likes garbage collection.
Viyi translated 3 days ago 1 people top Top Well translated!
Go! Where is the better use?
Go is ideal for system programming. It is touted as an intermediate language, somewhere between low-level languages like C and high-level languages like Python. Here are some of the types of apps that Go fit to build:
Command line Application
Network Services
Daemons (daemon)
Database
But even people use it to do these things:
Go is flexible enough to solve most problems, sometimes even better than other languages. Here's an impressive list of companies that use Go, including Docker, Cloudflare, Dropbox, Intel, Hashicorp, and, of course, Google.
Viyi translated 3 days ago 1 people top Top Well translated!
However... Why does Zapier still not use it?
Zapier is a huge monolithic application built on Python and Django. It has a lot of key points to do with Python, and it's hard to seamlessly switch to other programming languages while the service is running, although that's not impossible!
We are very (very!) Early stage to split the entire application into a microservices architecture. These services are performed on demand. However, I think Go is a choice when we find that a system is critical and requires a high-performance rewrite. We will follow a process:
Viyi translated 3 days ago 0 People top Top Well translated!
Measure the current system and identify bottlenecks.
Develop a Go solution for this bottleneck.
This solution is measured as a canary service in the product.
Start All Things
(Repeal and) replace
Using a programming language is a difficult decision, and Go is not the only language we think about. There are other languages in the list, and there are pros/cons as well:
Viyi translated 3 days ago 0 People top Top Well translated!
In summary: Go is a great programming language that we can use to build high-performance systems. When it comes to tradeoffs like most languages, the key considerations are stability and ease of use. Go is easy to learn, and most programmers can use it to program efficiently after a few weeks of use.
Maybe one day you will read another article that mentions that we are using Go development ZYX instead of XYZ. If you want to be part of a team, consider the new language you might use and improve our existing applications, take a look at our position.
Viyi translated 3 days ago 1 people top Top Well translated!