1
头图

In December 2019, the famous educational non-profit organization Khan Academy announced a project to redesign the back end into a series of Go services-Goliath, which converts the Python 2 language originally used on the back end to the Go language. Recently, Khan Academy revealed that more than 500,000 lines of Go code have been completed.

According to reports, when the Goliath project first started, no one on the team knew about the Go language except for the experiment run by the team to verify that the Go language was a better choice. Now, all back-end and full-stack engineers in Khan Academy use the Go language, and there are currently more than 500,000 lines of Go code running in a production environment.

Why did you switch from Python to Go? Kevin Dangoor, chief software architect of Khan Academy, conducted the analysis.

Python 2 reaches the EOL stage

In 2018, the Python team announced that the EOL (deactivation) date for Python 2.7 is January 1, 2020. From now on, there will be no updates or source code security patches. This means that projects using Python 2 are facing migration.

For Khan Academy, which uses Python 2 as the back-end server language, how to migrate and which language to choose has become a top priority.

They think that it is not easy to migrate from Python 2 to Python 3, so they choose among languages such as Kotlin and Go, and finally choose Go. The reasons are as follows:

  • Go provides simplicity and consistency. The Go team is committed to developing a language that helps the team to release software reliably for a long time;
  • Go's compilation speed is amazing, which can help the team achieve faster iterations;
  • Compared with Gotlin, Go is supported by a wider range of editors;
  • Go and Kotlin (on the JVM) have similar performance, but Go uses much less memory, which means it can be reduced to a smaller instance.

So, what is the acceptance of the development team after using the Go language?

Engineers like Go language

Engineers at Khan Academy believe that Go language has excellent features such as "easy to read and write". In addition, the Go language has received praise for error handling, standard library documentation, compilers, tool chains, performance, processing speed, etc., and even its gopher mascot has won praise.

image.png

However, the Khan Academy team also expressed the need for generics. They believe that generics are especially needed when writing internal library code or processing slices. The lack of generics is the biggest complaint people have against the Go language.

At present, Khan Academy has completed more than 500,000 lines of Go code. Kevin Dangoor said that although the Go language is more verbose than Python as a whole, it is fast, easy to use, and works well in a production environment.

Reference link:

https://blog.khanacademy.org/half-a-million-lines-of-go/
https://blog.khanacademy.org/go-services-one-goliath-project/


小魔
735 声望1k 粉丝