Eli Bendersky's website

https://eli.thegreenplace.net/ (RSS)
visit blog
ML in Go with a Python sidecar
11 Nov 2024 | original ↗

Machine learning models are rapidly becoming more capable; how can we make use of these powerful new tools in our Go applications? For top-of-the-line commercial LLMs like ChatGPT, Gemini or Claude, the models are exposed as language agnostic REST APIs. We can hand-craft HTTP requests or use client libraries (SDKs …

Ranging over functions in Go 1.23
2 Nov 2024 | original ↗

Go 1.23 shipped with a new major feature: ranging over functions (also known as "iterators"), per this proposal. This feature is nicely covered in the official Go blog post from August. This article is a rewrite of my older post that described this feature when it was still in …

Bloch sphere
30 Oct 2024 | original ↗

When learning the basics of quantum computing, the Bloch sphere comes early on as a visualization technique of quantum states. It shows the state of a single qubit as a point on this sphere: This post explains how the Bloch sphere works and also why it works. Mapping 4 dimensions …

Calculating the norm of a complex number
18 Oct 2024 | original ↗

In this quick post I'll dispel a common confusion in the basic math of complex numbers. It's often useful to calculate the norm-square (also known as absolute square) of a complex number z. This norm-square is denoted |z|^2. One could naively expect that: \[|z|^2=zz\] However, that's false …

Notes on running Go in the browser with WebAssembly
11 Oct 2024 | original ↗

Recently I've had to compile Go to WebAssembly to run in the browser in a couple of small projects (#1, #2), and in general spent some time looking at WebAssembly. I find WebAssembly to be an exciting technology, both for the web and for other uses (e.g. with WASI …

Implementing Raft: Part 4 - Key/Value Database
11 Oct 2024 | original ↗

This is Part 4 in a series of posts describing the Raft distributed consensus algorithm and its complete implementation in Go. Here is a list of posts in the series: Part 0: Introduction Part 1: Elections Part 2: Commands and log replication Part 3: Persistence and optimizations Part 4: Key …

Linearizability in distributed systems
8 Oct 2024 | original ↗

Linearizability is a strong consistency model in concurrent and distributed systems. From the paper introducing it [1]: Linearizability provides the illusion that each operation applied by concurrent processes takes effect instantaneously at some point between its invocation and its response. On first reading (and probably on the second and third …

Summary of reading: July - September 2024
1 Oct 2024 | original ↗

"A City on Mars" By Kelly and Zach Weinersmith - actual discussion of building settlements on Mars occupies maybe 1% of this book. The authors have an uncanny talent of focusing on all the least interesting aspects of space exploration; whatever little is dedicated to science and engineering is fairly shallow …

Asking an LLM to build a simple web tool
14 Sept 2024 | original ↗

I've been really enjoying following Simon Willison's blog posts recently. Simon shows other programmers the way LLMs will be used for code assistance in the future, and posts full interactions with LLMs to build small tools or parts of larger applications. A recent post caught my attention; here Simon got …

Notes on the Euler formula
8 Sept 2024 | original ↗

The Euler formula states that for any real x: \[e^{ix}=cos(x)+i sin(x)\] Where i is the imaginary unit. This formula is extremely important in many branches of mathematics and engineering, but at first glance it's puzzling. What does a complex exponent even mean, and how can …

SentencePiece BPE Tokenizer in Go
24 Aug 2024 | original ↗

Earlier this year I wrote a post about implementing BPE tokenization in Go, which made it possible to reproduce OpenAI's tokenizer. Today I want to mention a new project I've been hacking on recently: go-sentencepiece - a pure Go implementation of the SentencePiece tokenizer that's used for Google AI's models like …

Building static binaries with Go on Linux
31 Jul 2024 | original ↗

One of Go's advantages is being able to produce statically-linked binaries [1]. This doesn't mean that Go always produces such binaries by default, however; in some scenarios it requires extra work to make this happen. Specifics here are OS-dependent; here we focus on Unix systems. Basics - hello world This post …

Notes on Taylor and Maclaurin series
24 Jul 2024 | original ↗

A Maclaurin series is a power series - a polynomial with carefully selected coefficients and an infinite number of terms - used to approximate arbitrary functions with some conditions (e.g. differentiability). The Maclaurin series does this for input values close to 0, and is a special case of the Taylor series …

↑ these items are from RSS. Visit the blog itself at https://eli.thegreenplace.net/ to find other articles and to appreciate the author's digital home.