社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
本文讨论了服务器领域常见的并发等问题,也涉及到了工程化相关的问题,也整理了C背景程序员对于Go的GC以及性能的疑问,探讨了Go的错误处理和类型系统最佳实践,以及依赖管理的难处,接口设计的正交性,当然也包含我们在服务器开发中对于Go实践的总结,有时候也对一些有趣的问题做深度的挖掘,也列出了Go重要的事件和资料集合,还有Go2的进展和思考。我更想从问题本身出发,不局限于Go语言,探讨服务器中常常遇到的问题,最后回到Go如何解决这些问题,提供Go开发的关键技术指南。
The Go Programming Language到底是该叫GO还是GOLANG?Google搜Why Go is called Golang
能搜到几篇经典帖子。
Rob Pike在Twitter上特意说明是Go,可以看这个The language is called Go:
Neither. The language is called Go, not Golang. http://golang.org is just the the web site address, not the name of the language.
那么在另外一个地方也说明了也是Go,可以看这个The name of our language is go:
The name of our language is Go
Ruby is called Ruby, not Rubylang.
Python is called Python, not Pythonlang.
C is called C, not Clang. No. Wait. That was a bad example.
Go is called Go, not Golang.
Yes, yes, I know all about the searching and meta tags. Sure, whatever,
but that doesn't change the fact that the name of the language is Go.
Thank you for your consideration.
这里举了各种例子说明为何不加lang的后缀,当然有个典型的语言是加的,就是Erlang
。于是就有回复说“Erlang Erlang, Let's just call it Er.”
那么为何很多时候Go和Golang都很常用呢?在Why is the Go programming language usually called Golang中说的比较清楚:
It’s because “go domain” has been registered by Walt Disney and so Go creators couldn’t use it.
So, they have decided to use golang for the domain name. Then the rest came.
Also, it’s harder to search things on search engines just using the word Go. Although, Rob Pike is
against this idea but I disagree. Most of the time, for the correct results you need to search for
golang.
It’s just Go, not golang but it sticked to it.
讲个笑话先,用百度搜下为何Go叫做Golang,一大片都是类似本文的鸡汤煲,告诉你为何Go才是天地间最合适你的语言,当然本文要成为鸡汤煲中的战斗煲,告诉你全家都应该选择Go语言。
为何Go语言名字是Go,但是经常说成是Golang呢?有以下理由:
为什么在名字上要这么纠结呢?嗯嗯,不纠结,让我们开始干鸡汤吧。
考虑一个商用的快速发展的业务后端服务器,最重要的是什么?当然是稳定性了,如果崩溃可能会造成用户服务中断,崩溃的问题在C/C++服务器中几乎是必然的:
Go的使命愿景和价值观:
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Go is a concurrent open source programming language developed at Google. Combines native compilation and static types with a lightweight dynamic feel. Fast, fun, and productive.
Go is an attempt to make programmers more productive. The first goal is to make a better language to meet the challenges of scalable concurrency. The larger goal is to make a better environment to meet the challenges of scalable software development, software worked on and used by many people, with limited coordination between them, and maintained for years.
Go语言的关键字:
参考The Path to Go1: What is Go?和Another Go at Language Design。
Go是面向软件工程的语言,Go在工程上的思考可以读Go at Google: Language Design in the Service of Software Engineering和Less is exponentially more。Go最初是解决Google遇到的大规模系统和计算的问题,这些问题如今被称为云计算,参考Go, Open Source, Community。
GITHUT上显示Go的项目和PR一直在上升,如下图所示。
2014云计算行业中使用Go的有:Docker, Kubernetes, Packer, Serf, InfluxDB, Cloud Foundry’s gorouter and CLI, CoreOS’s etcd and fleet, Vitess, YouTube’s tooling for MySQL scaling, Canonical’s Juju (rewritten in Go), Mozilla’s Heka, A Go interface to OpenStack Swift, Heroku’s Force.com and hk CLIs, Apcera’s NATS and gnatsd。
2018年全球使用Go的公司数目有:US(329), Japan(79), Brazil(52), India(49), Indonesia(45), China(32), UK(32), Germany(28), Israel(24), France(17), Netherlands(16), Canada (15), Thailand(14), Turkey(14), Spain(12), Poland(11), Australia(9), Russia(9), Iran(8), Sweden(7), Korea(South)(6), Switzerland(6), Ukraine(5)。
参考Go as the emerging language of cloud infrastructure,以及The RedMonk Programming Language Rankings: June 2018,还有GoUsers,以及Success Stories。
参考Nine years of Go: Go Contributors,社区贡献的代码比例。
我们一起看看这些Go牛逼的特性,详细分析每个点,虽然不能涵盖所有的点,对于常用的Go的特性我们做一次探讨和分析。
看看Go做到了哪些,Go的重要事件:
sort.Slice
使排序使用更简单。for
支持三种迭代写法。Data Race Detector
等。由于简书限制了文章字数,只好分成不同章节:
欢迎加入SRS流媒体服务器钉钉群:
或者用微信扫二维码加公众号,然后在公众号中点加微信群:
推荐加钉钉群哦,有各种实时消息,有直播和回看,还有机器人等你撩~
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!