Go

Scala on Go

Scala on Go

Scala on Go. Sealed types, pattern matching, Option/Either/Try/Future, and immutable collections — transpiled to plain Go with full third-party interop, zero-reflection JSON, and a GoLand plugin. -...

Lobsters Lobsters · Go · General Discussion ·
0
WD

How I use HTMX with Go

When I want to add sprinkles of interactivity to a web application, I'm a big fan of using HTMX. I like that it makes it easy to give interactions a smooth app-like feel, I like that it minimizes the amount of JavaScript that I have to write, and I like that it allows me to keep the consistency a...

Lobsters Lobsters · Web Development · Go ·
0
Mapping Strings to Float Arrays in Go: How Fast Can We Go?

Mapping Strings to Float Arrays in Go: How Fast Can We Go?

A common pattern in modern software is to map a string key to a small array of floating-point numbers. Word embeddings, feature vectors, lookup tables for physical constants: all variations on the same theme. In Go, the obvious way to write this is a map[string][]float32. But how fast is it, real...

Daniel Lemire Daniel Lemire · Go ·
0
A Fast Immutable Map in Go

A Fast Immutable Map in Go

Consider the following problem. You have a large set of strings, maybe millions. You need to map these strings to 8-byte integers (uint64). These integers are given to you. If you are working in Go, the standard solution is to create a map. The construction is trivial, something like the followin...

Daniel Lemire Daniel Lemire · Go · Backend ·
0
Go 1.26 is released

Go 1.26 is released

Go 1.26 adds a new garbage collector, cgo overhead reduction, experimental simd/archsimd package, experimental runtime/secret package, and more.

The Go Blog The Go Blog · Go ·
0
G

Microblog: TestMain can cause one to question reality

This morning a one line change had several of us tearing up the fabric of reality trying to understand why a failing test wasn’t failing, or, in fact, being run at all. Increasingly frantic efforts to upgrade/downgrade Go, run the tests on another machine, run the tests in CI, all served to only...

Dave Cheney Dave Cheney · Go ·
0
Ultimate Go Tour

Ultimate Go Tour

Ardan Labs is trusted by small startups and Fortune 500 companies to train their engineers and develop business software solutions and applications.

Ardan Labs Blog Ardan Labs Blog · Go ·
0
Generics can make your Go code slower

Generics can make your Go code slower

Go 1.18 is here, and with it, the first release of the long-awaited implementation of Generics is finallyready for production usage. Generics are a frequently requested feature that has been highly contentiousthroughout the Go community.

PlanetScale Blog PlanetScale Blog · Go ·
0
GIS in Go

GIS in Go

Ardan Labs is trusted by small startups and Fortune 500 companies to train their engineers and develop business software solutions and applications.

Ardan Labs Blog Ardan Labs Blog · Go ·
0
G

Ensmallening Go binaries by prohibiting comparisons

Conventional wisdom dictates that the larger the number of types declared in a Go program, the larger the resulting binary. Intuitively this makes sense, after all, what’s the point in defining a bunch of types if you’re not going to write code that operates on them. However, part of the job of a...

Dave Cheney Dave Cheney · Go ·
0
G

Mid-stack inlining in Go

In the previous post I discussed how leaf inlining allows the Go compiler to reduce the overhead of function calls and extend optimisation opportunities across function boundaries. In this post I’ll discuss the limits of inlining and leaf vs mid-stack inlining.

Dave Cheney Dave Cheney · Go ·
0
G

go test -v streaming output

The testing package is one of my favourite packages in the Go standard library, not just because of its low noise approach to unit testing, but, over the lifetime of Go, it has received a steady stream of quality of life improvements driven by real world usage.

Dave Cheney Dave Cheney · Go · General Discussion ·
0
G

The Zen of Go

This article was derived from my GopherCon Israel 2020 presentation. It’s also quite long. If you’d prefer a shorter version, head over to the-zen-of-go.netlify.com.

Dave Cheney Dave Cheney · Go ·
0
G

Use internal packages to reduce your public API surface

In the beginning, before the go tool, before Go 1.0, the Go distribution stored the standard library in a subdirectory called pkg/ and the commands which built upon it in cmd/. This wasn’t so much a deliberate taxonomy but a by product of the original make based build system. In September 2014, t...

Dave Cheney Dave Cheney · Go ·
0
Concurrency Trap #2: Incomplete Work

Concurrency Trap #2: Incomplete Work

One of the traps of concurrency is "incomplete work" which occurs when a program terminates before outstanding Goroutines complete. Depending on the program, this may be a serious problem. This post demonstrates the trap and discusses possible solutions.

Ardan Labs Blog Ardan Labs Blog · Go · Backend ·
0
Goroutine Leaks - The Abandoned Receivers

Goroutine Leaks - The Abandoned Receivers

Goroutine Leaks are a common cause of memory leaks in Go programs. In my previous post, I presented an introduction to Goroutine leaks and provided one example of a common mistake that many Go developers make. Continuing that work, this post presents another scenario on how Goroutines could be le...

Ardan Labs Blog Ardan Labs Blog · Go · Backend ·
0
Loading more…