Hello! In March, a conference dedicated to the Go programming language, GopherCon Russia 2018 , was held in Moscow Technopolis. It featured speeches from the core-team - it was cool to hear firsthand how to do it right. And of course, it was not without reports on microservices, open sourcing, working with the network in Go, creating client libraries and cool tools.
We want to say "thank you" to the speakers - for the reports and to the organizers - for the opportunity to talk with live Brad Fitzpatrick and the real Ashley McNamara . Under the cut we talk about the reports, workshops and competition from Avito, as well as play a little Go-souvenir.
UPD, 12.04, 10:13 Moscow time: the reception of competitive comments has been stopped, later on an update post and we will write to all the winners.
UPD, 13.04, 13:40 Moscow time: the answers are posted at the end of the post under the spoiler, all commentators who wrote before 12.04.2018 will receive the prizes
Most of the photos we took from the report posted on the page GopherCon Russia 2018 on Facebook.
In his report, Andrei Drozdov talked about the device search engines on live examples, what has already been done in the Go community on this topic, compared the performance of the “self-made” search engine on Go and the solutions on the riot framework. During the report, they discussed how to build a search infrastructure in the company and quickly launch new search algorithms. Slides with many useful links are here . But the video of this performance:
In the course of his report, Andrei Drozdov held a master class where he could practice creating search engines.
Here is what he tells about the meeting:
Despite the minor problems with connecting the computer at the master class there were a lot of people. Most of them were able to write their search on the riot framework, download a million news headlines into it and receive stickers as a gift from Avito). The three most active ones, apart from the main task, decided on several additional ones: they held their own benchmark and implemented a custom ranker. I will be glad if in the end more people study the riot and, perhaps, join it so that it develops faster.
Within the section inside the Avito-room, Alexander Emelin talked about plans for the further development of the Centrifugo project. For the past few months, he has been working on a second version of the server, which allows serving thousands of simultaneous connections from application users and sending them real-time messages (Websocket and SockJS). An important feature of the server is that it allows you to integrate with the backend written in any programming language.
In the second version, quite complex tasks were implemented - for example, the server core was allocated to a separate library that Go developers can use. Support for transferring binary data via Websocket (Protobuf) in addition to the existing JSON protocol has been implemented, and support for GRPC as an alternative transport has been implemented.
Here is what Alexander said after the master class:
Quite a lot of people came to the Avito-room, among whom were the current users of Centrifugo. It turned out to get valuable feedback, which is extremely important at this stage of development. After the oral talk about the features of the second version, we looked at a small real-time example using this library - a very simple chat with an interesting feature: the server allowed clients to use not only the Websocket protocol as a transport, but also GRPC.
At our booth, of course, it was also crowded the whole day. Already at ∞ in the morning we were waiting for the earliest participants in the conference. Could have been photographed with Gopher ...
... Or a brave employee of our technopia department, Gosha Immortal, who was recently hired as a junior specialist (albeit, only as an inventory number) ...
Well, perhaps the most interesting activity is that the whole day at our booth there was a competition called “Golang, or There and Back”, where you can win a T-shirt, mittens or a sticker with Go symbols. It was necessary to compare snippets of code written in Golang and other programming languages. If you take a closer look, you can see how about half of the conference participants captured in this snapshot are full of snippets:
But bigger plans:
And a little bit in the lecture halls:
It seems that the game "went" to all participants: those who participated in the competition, with pleasure stretched their brains before the reports and in between them, and we enjoyed the conversation with each of the approximately 350 participants in this game.
We have a number of Go-mittens and stikpak - we want to play them here, on Habré. What's inside the sticker set? Nine "base" gofers ...
... and a set of stickers accessories to them so that you can collect your own gopher. For example:
To do this, we invite you to look at and compare snippets of code written in Golang and other programming languages. And write in the comments of the pair on the principle of 1 - A, 2 - B and so on. Hide the answers under the spoiler so as not to spoil the other fans!
We will send the first five commentators by Go-stikpak and a pair of mittens by mail or courier. Five more of the same sets will be distributed among the remaining participants using a randomizer. Enjoy!
one
2
3
four
five
6
7
eight
9
ten
A
type vertex struct { X, Y int } func f(v *vertex) { vX = 3 vY = 4 } func main() { v1 := vertex{1, 8} f(&v1) }
B
package main import "fmt" import "math" func main() { fmt.Printf("%f", 1.0/math.Sqrt(49)) }
C
package main import ( "fmt" "unicode/utf8" ) func main() { b := []byte{80, 72, 80, 32, 114, 117, 108, 101, 115} for len(b) > 0 { r, size := utf8.DecodeRune(b) fmt.Printf("%c", r) b = b[size:] } }
D
func f(x, y int64) int64 { return x + y }
E
package main import ( "fmt" ) func f(a int) func(b int) int { return func(b int) int { return a*b } } func main() { list := []int{2, 2, 2, 2} g := f(3) for i, value := range list { list[i] = g(value) } fmt.Println(list) }
F
type vt struct { X, Y int } func f(v vt) { vX = 3 vY = 4 } func main() { v1 := vt{1, 8} f(v1) }
G
package main import ( "io" "log" "net/http" ) func h(w http.ResponseWriter, r *http.Request) { io.WriteString(w, "hello, world!\n") } func main() { http.HandleFunc("/", h) log.Fatal(http.ListenAndServe(":8080", nil)) }
H
type filter func(string) bool func bf(list []string, fn filter) [][]string { valid, invalid := []string{}, []string{} for _, s := range list { if fn(s) { valid = append(valid, s) } else { invalid = append(invalid, s) } } return [][]string{valid, invalid} } func main() { l := []string{"gl", "hf", "ht", "tt"} res := bf(l, func(s string) bool { return s[0] == 'h' }) }
I
package main import "fmt" func main() { a, b := 5, 10 fmt.Println(map[bool]int{true: a, false: a-1}[a > b]) }
J
package main import ( "fmt" ) func f(a, b int) int { if a > b { return a } return b } func main() { ints := []int{1, 8, 3, 4, 5} res := ints[0] for _, v := range ints { res = f(res, v) } fmt.Println(res) }
We are waiting for your comments!
1 - G, 2 - J, 3 - A, 4 - F, 5 - H, 6 - C, 7 - E, 8 - B, 9 - I, 10 - D.
But Gopher is resting after the conference and gaining strength before the next one.
See you again!
Source: https://habr.com/ru/post/352820/
All Articles