Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member200902
Discoverer
0 Kudos
This years GopherCon UK has been kicked off at The Brewery in the City of London. After almost two years of working with Go in the BOSH Europe team at SAP, I was really excited about this conference. The three day event with over 600 delegates is very technical and known for up-to-date content about the Go programming language.


As with almost every conference several talks were held in parallel and you had to decide for one. In the following I will only resume a subset of great talks that I liked best to not go beyond the scope of this report.

 

The Unconference


This years pre-conference social included a special episode of the GoTimeFM podcast with the hosts @markbates and @matryer, along with special guests @gautamrege, @lizrice and @kasiazien. At the same time it was a meetup of the London Gophers, a london-based user group with a special interest in the Go programming language. I met some of them in the pub later in the evening and was surprised how open-minded the people were and had the opportunity to talk about some problems around logging. The Unconference itself was surrounded by free food and drinks and offered the opportunity to chat with other Go enthusiasts during the breaks.

 
Unconference

 

Finding dependable packages


At some point, we all find ourselves wanting to use a third-party Go package in our Go code. This talk discusses strategies for discovering, evaluating and maintaining Go packages and modules. It also introduces a site that the Go team is building to streamline the process for finding dependable Go packages.

 
The first day of the main conference started with a keynote on dependable Go packages from jqiu25. Using the example of a recipe book, this talk explained how best to proceed to discover and evaluate Go packages and modules. When working with third-party open source libraries, the usability of a package can be assessed according to the following criteria:


  • verifying that the package has a license that is appropriate.

  • checking the popularity by means of the number of downloads, stars, forks, watchers, contributors, dependents. The latter is one of the best indicators that a package is usable.

  • evaluating the code quality by navigating through the documentation. If it's clear how to use the package and the code is understandable, the code quality might be okay. You should also ask yourself whether you want to pull the code of the package into your own codebase. This can also be evaluated with tooling such as goreportcard.

  • verifying the upkeep of a package on the basis of maintainer activity, commit history, issue tracker, and the maintainers themselves.

  • reviewing the transient dependencies that would be introduced when consuming the package.


As already announced in this blog, jqiu25 shared some mockups of a major revamp of godoc.org to make the discoverability of available modules easier. The tracking issue for the progress on this tool can be found here.

 

Robotics with Go is a Breeze


Ever wanted to control a drone with Go? Of course, who wouldn’t want to do that?! With gobot that’s as easy as goblin pie. Here, let me show you how you can build your own face tracking drone.

 


This talk by @Skarlso was supposed to be about how to control drones in Go. Actually, it was the funniest talk of the conference with a high level of entertainment factor: numerous drones were knocked out of the air, go routines said goodbye with panics and there was a speaker who managed to stay cool as ice and saved the situation well.





Unfortunately, the drone constantly lost its connection and could no longer be controlled as a result. Nevertheless, @Skarlso was able to mediate what one can achieve with a few lines of code. Since the drone had a camera integrated there was even a small demo of the face detection and classification functionality. Although it didn't work reliably it was still a good demonstration.





The drone being used is available for less than $100 and the frameworks used (i.e., gobot) are open source. I'm definitely curious to try it out as soon as I get to it.


 
Robotics

 

Go as a Scripting Language in Linux


Do you like Go so much and use it in every software project? Do you think Go is a truly universal language? How about taking it to the next level and trying Go as a scripting language for your favourite Linux distribution?

 


This talk by @secumod was especially interesting to me, as I have faced the exact same issues in the past. Without contacting the StackOverflow community and trying it by my own, I spent half an hour to get my Go script working but at the end I gave up and switched back to ruby, which is (at least for me) a bit more convenient for scripting. One of the problems you run into is already the first line of a script: the shebangline. Go does not support shebang.





@secumod guided through all the possible mistakes that can be made and even analyzed the linux kernel to alleviate the problems. As he pointed out, one possible workaround is gorun, a package which wraps the built-in go run command. However, gorun has the caveat that the go files cannot be compiled with go build anymore.





The final approach sets up a binary format description for *.go files by using the Linux Kernel function binfmt_misc. With this configuration of the OS the standard go run can be used. More details about how the speaker runs .go scripts can be found on the original blog post.


 
Scripting

 

Impossible Go


You know how to code in Go, don’t you? Let’s see! This talk shows Go snippets that seem easy, difficult, wrong or impossible. Through these different obfuscated Go constructs and code, we not only have fun but also learn about various nuances of Go to improve our Go coding skills and practices!

 


The first conference day finished with an inspiring keynote from @gautamrege who is co-founder of Jos Software. He presented a collection of code snippets that produced more or less surprising results after execution. The talk itself was very interactive and for correct answers there was a chance to win a t-shirt. In addition to the coding examples, the speaker also gave some advice and wisdom which helped him founding his company. He shared some of the pitfalls that can bite you when starting your own business and emphasized that there is one disposition that matters the most: passion.





This was the very last talk of the first conference day, which was then closed with a social event at the bowling hall.


 
Bowling

 

Improving Dependencies for Everyone


Go 1.11 introduced modules, the new standard package management system for Go. It’s a massive step forward for the community, especially because we can build proxy servers instead of just using Github to fetch code. Athens is leading the way to solve some painful problems we’ve had for years.

 


The second conference started with a keynote about the Athens project by @arschles. In short, Athens is a proxy server and Go module datastore for all the dependency packages in a Go project. Everyone can host an own public or private mirror, which allows organizations to manage their public and private code in the same way. In addition, Athens approaches the problem of not having immutable code in the dependencies of a Go project. Since commits and tags can be changed in code version control systems (VCS), you might see checksum verification errors in your project from time to time. The Athens database stores an immutable copy of the dependencies after invoking go get. This works by Athens first looking into the local memory and only if a module was not found fetching the module from the VCS. Athens never changes anything once it saves a module to storage. This means that even if the remote version or tag changes, the module remains stable in the database and thus also in the project.





All in all, Athens seems to be a good extension for the built-in dependency system of Go. There is good documentation available with lots of examples. The #athens channel in the gophers slack is very active and you get immediate help with your questions.


 
Athens

 

Tackling Contention


Go is all about parallelism and concurrency, but they don’t come for free. This talk is about measuring their contention price, and being able to reduce it.

 


One of the few sessions that were classified as advanced at the GopherCon schedule was the talk about contention from @empijei. Since BOSH, the project our team is working on, is a highly distributed system, we also had to look at concurrency issues every once in a while, which is why I was particularly interested in this presentation.





To have a common understanding of the terminology, the speaker defined contention as the competition between different processes to acquire a lock. Contention might be caused when writing parallel concurrent code. It turned out that there are different sorts of contention, e.g. cache contention, mutexes. In a brief summary, the following steps should be considered if you want to reduce contention:




  1. Measure by using Go's profiling tools pprof and -trace.

  2. Understand your underlying data structures

  3. Fix your code if necessary with
    sharding: decentralize the state if jobs take the same time and if queue is stable
    batching: contend less by reducing the number of accesses to shared state (if latency is not critical and consistency is ensured)
    padding: add additional bytes to fields in your struct. This can prevent false sharing

  4. Measure again.



All in all, this talk was excellent and I really enjoyed it. A difficult problem in parallel programming has been highlighted and best practices that everyone should consider were presented. You can find the slides at https://clap.page.link/contention.

 

Gio


Gio is a new open source Go library for writing immediate mode GUI programs that run on all the major platforms: Android, iOS/tvOS, macOS, Linux, Windows and WebAssembly. The talk will cover Gio’s unusual design and how it achieves simplicity, portability and performance.

 


The event has been finished with a stunning live coding demo held by @elias_naur who demonstrated gio, a portable framework to build GUI programs on all the major platforms. This demo was by far the most impressive I've ever seen because Elias not only did an incredibly comprehensive live coding session, but also because everything worked right away and after the talk the audience had a good understanding of what can be done with the framework. They thanked with a loud applause at the end of the demo.





Gio is 100% Go and only depends on lowest-level platform libraries. Another nice thing is the portability which allows developers to write the code once and run it (almost) everywhere - iOS/tvOS, Android, Linux (Wayland), macOS, Windows and browsers (Webassembly/WebGL). The speaker demonstrated this by running his demo code on both his macbook and the iOS simulator.


 
Gio

 
After this closing keynote the conference was duly closed with free drinks at the bar, food, live band, foosball tables, and air hockey.

 

Conclusion


This was my first GopherCon and I really enjoyed the welcoming atmosphere, inspiring talks about Go and especially talking to other like-minded people with different technical backgrounds from all over the world. From organizers to participants to sponsors, everyone has done their best to make the conference an inclusive place. In comparison to other conferences I've attended before it was very easy to get in touch with the community during the event and especially at the socials. To sum it up, you should definitely go to the next GopherCon if you have an interest in Go and if you want to get to know the community which stands behind this great programming language.