Let's Golang!
Parallel programming for python developers
We are JΓ©ssica and Dominik from Ecosia
In our life before Ecosia we were both mostly working with Python
. In this workshop we want to show you what Go is about and how things work on the other side of the language divide from the perspective of two long-time Python developers.
Why should you even care about Go?
Well, when you're reading/listening to this, you probably already have some initial interest, but here are some points that we really like about Go and why we are using it at Ecosia:
- It's fast
π and can do system-level programmingπ§ but is still much more accessibleπͺ than C - It has web
π and parallelismβΈοΈ built right into the language - It's a typed
β¨οΈ language with an interesting concept of interfacesπ₯ - It has an extensive standard library
π , including things like a html template rendering engineπ - It's heavily inspired by Python
π
The title promised parallel programming, so why do we think Go is a good choice for that, especially when coming from Python?
Python sadly has some shortcomings when trying do things in parallel. The most commonly used Python implementation, CPython, has a Global Interpreter Lock multiprocessing (using system processes) instead of threading (using OS threads), but at the cost of slower startup time queue.Queue and threading.Lock) can be rather intimidating and hard to understand and read
Go on the other hand has parallel execution as one of its core language features. That manifests in three ways. Firstly, Go uses a very efficient implementation of threads called goroutines that can run several light-weight go keyword)
What will we do?
This workshop will try to illustrate two of the strengths of Go: strong web libraries and parallelism. For this we will built a simplified version of a service that we are running at Ecosia in production. The web service that we will build is supposed to call several APIs in parallel while enforcing a maximum timeout for all calls and will return a JSON response made up from the APIs' responses.
If you are attending a live session: there will be two people running the workshop, please ask the one not presenting and they will walk over to you. If they feel your question is relevant for everyone they will share it with everyone.
Let's Golang now!
Start with step 0.