Symbolfoto
High-Level, kein Go-Kurs
Große, verteilte, nebenläufige Systeme
Java und C++ dominant
Frustration, geringe Produktivität
statisch typisiert und effizient
einfach zu verwenden, leicht lesbar
networking und nebenläufigkeit als Kernkompetenz
Any fool can write code that a computer can understand. Good programmers write code that humans can understand. – Kent Beck
Nur ein Teilaspekt!
keine
zeige ich im Projektbeispiel
10 MiB Docker Image from scratch
5 MiB Speicher Footprint
ms Kompilierzeit
ms Startzeit
keine GC lags
Geringe Hürde für effizienten Code
Erfahrung der Autoren zeigt sich hier
Für Go relativ klar
go
Marcin Wichary from San Francisco, U.S.A. / CC BY
I'm sorry that I long ago coined the term "objects" for this topic because it gets many people to focus on the lesser idea. The big idea is messaging.
http://wiki.c2.com/?AlanKayOnMessaging
chan
keine Zeit tiefer zu gehen :(
Photograph by Rama, Wikimedia Commons, CC BY-SA 2.0 FR
Don’t communicate by sharing memory, share memory by communicating. – go proverb
package main
import "fmt"
func main() {
messages := make(chan string)
messages <- "ping"
msg := <-messages
fmt.Println(msg)
}
package main
import "fmt"
func main() {
messages := make(chan string)
go func() { messages <- "ping" }()
msg := <-messages
fmt.Println(msg)
}
package main
import "fmt"
func main() {
messages := make(chan string)
go func() { messages <- "ping" }()
select {
case msg := <-messages:
fmt.Println(msg)
case <-time.After(1 * time.Second):
fmt.Println("timeout 1")
}
}
func main() {
jobs := make(chan int, 5)
done := make(chan bool)
go func() {
for job := range jobs {
fmt.Println("received job", j)
}
done <- true
}()
for j := 1; j <= 3; j++ {
jobs <- j
}
close(jobs)
<-done
}
https://www.hermesworld.com/de/content/karriere/hf/standortbroschuere-haldensleben.pdf
Nachteile aus Zweisprachigkeit, nicht Gos exzellenz
Meine Einschätzung
renehabermann.gitlab.io/presentations/go2