πŸ‡ΊπŸ‡¦ Go for two :)
1.18K subscribers
22 photos
3 files
184 links
Telegram channel about tricks and engineering practices in the Go programming language over a cup of coffee β˜•οΈ.

author: @a_soldatenko
personal blog: https://asoldatenko.org

#golang #go #kubernetes #debugging
加ε…₯钑道
Discussion of 1BRC in Go https://github.com/gunnarmorling/1brc/discussions/67

Context: https://twitter.com/gunnarmorling posted a problem https://www.morling.dev/blog/one-billion-row-challenge/ the idea is pretty simple and from another side not so simple:

>write a Java program for retrieving temperature measurement values from a text file and calculating the min, mean, and max temperature per weather station. There’s just one caveat: the file has 1,000,000,000 rows!
Go’s CompareAndSwap is not always Compare-and-swap

>Go's standard package sync/atomics provides programmers with functions to use the underlying CPU-level atomic operations such as compare-and-swap (CAS), through atomic.CompareAndSwapT (where T is an integer type).

> Problem: Not all CPU architectures offers a CAS instruction to rely on to implement atomic.CompareAndSwapT. However, Go must compile that function code to something semantically equivalentβ€”let's see what.

https://lu.sagebl.eu/notes/go-cas/
For all GO haters :) https://juli1.substack.com/p/why-i-fell-in-love-with-go

Nice quote and summary:
>Technologies like JavaScript or Go are like a good burger: it’s an option that the majority understand and choose regularly. It may not be the most elegant option, but it does the job and allows us to focus on problems that matter.
What do you think if I start posting not only about Golang, but some related topics like k8s/containers?
Anonymous Poll
50%
Yes
20%
No
16%
Strong Yes
14%
i don't care
TIL: strings.Split returns [""] if s does not contain sep and sep is not empty πŸ˜…

package main

import (
"fmt"
"strings"
)

func main() {
fmt.Printf("%q\n", strings.Split("", ","))
}


Split returns a slice of length 1 whose only element is s:

[""]