<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>antonau.tech</title>
    <link>https://antonau.tech/</link>
    <description>Recent content on antonau.tech</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 03 Jun 2026 12:00:00 +0200</lastBuildDate>
    <atom:link href="https://antonau.tech/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Tricky parts of Golang. The Nil Interface Trap</title>
      <link>https://antonau.tech/posts/2026/06/nil-interface-trap/</link>
      <pubDate>Wed, 03 Jun 2026 12:00:00 +0200</pubDate>
      <guid>https://antonau.tech/posts/2026/06/nil-interface-trap/</guid>
      <description>&lt;p&gt;Few bugs in Go are as disorienting as this one: you return &lt;code&gt;nil&lt;/code&gt; from a function, check the result against &lt;code&gt;nil&lt;/code&gt;, and the check fails. No type assertion panic, no runtime error — just a quiet wrong answer that sends you down a debugging rabbit hole.&lt;/p&gt;&#xA;&lt;p&gt;This article breaks down why it happens, what Go is doing under the hood, and how to make sure you never ship this bug.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tricky parts of Golang. Goroutine Leaks: Patterns, Detection, and Prevention</title>
      <link>https://antonau.tech/posts/2026/05/goroutine-leaks/</link>
      <pubDate>Thu, 28 May 2026 10:00:00 +0200</pubDate>
      <guid>https://antonau.tech/posts/2026/05/goroutine-leaks/</guid>
      <description>&lt;p&gt;A goroutine leak is one of the most insidious bugs in Go. Unlike a memory leak in C, nothing crashes. No panic, no OOM killer. Your service just slowly grows in memory and CPU usage over hours or days until it falls over — or someone notices the goroutine count in a dashboard.&lt;/p&gt;&#xA;&lt;p&gt;This article covers the three root causes, how to find leaks with the tools built into the standard library, and API design patterns that make leaks structurally impossible.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tricky parts of Golang. The defer Trap in Loops</title>
      <link>https://antonau.tech/posts/2026/05/defer-traps/</link>
      <pubDate>Tue, 12 May 2026 10:00:00 +0200</pubDate>
      <guid>https://antonau.tech/posts/2026/05/defer-traps/</guid>
      <description>&lt;p&gt;&lt;code&gt;defer&lt;/code&gt; is one of Go&amp;rsquo;s most useful features and one of its most misunderstood. The documentation is precise: a deferred call runs &lt;em&gt;when the surrounding function returns&lt;/em&gt; — not when the surrounding block or loop iteration ends. That single sentence is responsible for resource leaks, silent data corruption through named returns, and unnecessary performance overhead that persists until you know to look for it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;misconception-1-defer-runs-at-the-end-of-a-block&#34;&gt;Misconception 1: defer Runs at the End of a Block&lt;/h2&gt;&#xA;&lt;p&gt;This is the most common mistake, and it almost always appears inside loops:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tricky parts of Golang. Escape Analysis and Heap Allocations</title>
      <link>https://antonau.tech/posts/2026/04/escape-analysis/</link>
      <pubDate>Fri, 24 Apr 2026 10:00:00 +0200</pubDate>
      <guid>https://antonau.tech/posts/2026/04/escape-analysis/</guid>
      <description>&lt;p&gt;Two functions. Nearly identical code. One puts your variable on the stack; the other sends it to the heap, adding GC pressure every time it runs. You cannot tell which is which by reading the code — you need to ask the compiler.&lt;/p&gt;&#xA;&lt;p&gt;This article explains how Go decides where variables live, how to read the compiler&amp;rsquo;s decision, and which patterns silently force allocations you did not intend.&lt;/p&gt;&#xA;&lt;h2 id=&#34;stack-vs-heap-why-it-matters&#34;&gt;Stack vs. Heap: Why It Matters&lt;/h2&gt;&#xA;&lt;p&gt;Memory in a Go program lives in two places:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tricky parts of Golang. The Slice Header and the Shared Backing Array</title>
      <link>https://antonau.tech/posts/2026/03/slice-internals/</link>
      <pubDate>Sat, 21 Mar 2026 10:00:00 +0200</pubDate>
      <guid>https://antonau.tech/posts/2026/03/slice-internals/</guid>
      <description>&lt;p&gt;Slices are the bread and butter of Go programming. Most developers use them daily without thinking twice — and that comfort is exactly where subtle, load-dependent bugs come from. This article pulls back the curtain on how slices are represented in memory and explains the class of bug that emerges when two slices quietly share the same underlying array.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-surprise&#34;&gt;The Surprise&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;original&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; []&lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt;{&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;3&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;4&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;5&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;sub&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:=&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;original&lt;/span&gt;[&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;:&lt;span style=&#34;color:#ae81ff&#34;&gt;3&lt;/span&gt;] &lt;span style=&#34;color:#75715e&#34;&gt;// [2, 3]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;sub&lt;/span&gt;[&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;] = &lt;span style=&#34;color:#ae81ff&#34;&gt;99&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;fmt&lt;/span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;Println&lt;/span&gt;(&lt;span style=&#34;color:#a6e22e&#34;&gt;original&lt;/span&gt;) &lt;span style=&#34;color:#75715e&#34;&gt;// [1 99 3 4 5] — original changed!&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We modified &lt;code&gt;sub&lt;/code&gt;, but &lt;code&gt;original&lt;/code&gt; changed too. No pointer was explicitly shared. This is not a bug in Go — it is the feature working exactly as designed. The surprise comes from not knowing what a slice &lt;em&gt;is&lt;/em&gt; at the memory level.&lt;/p&gt;</description>
    </item>
    <item>
      <title>MXFP4 Quantization</title>
      <link>https://antonau.tech/posts/2026/01/mxfp4-quantization/</link>
      <pubDate>Sun, 11 Jan 2026 19:19:35 +0100</pubDate>
      <guid>https://antonau.tech/posts/2026/01/mxfp4-quantization/</guid>
      <description>&lt;h3 id=&#34;1-quick-look-in-a-nutshell&#34;&gt;1. Quick-look, &amp;ldquo;in a nutshell&amp;rdquo;&lt;/h3&gt;&#xA;&lt;p&gt;&lt;strong&gt;MXFP4 quantization&lt;/strong&gt; is a &lt;em&gt;microscaling, 4-bit floating-point&lt;/em&gt; compression scheme designed to shrink the memory footprint of deep-learning models without hurting accuracy.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;MX&lt;/strong&gt; = &lt;strong&gt;Microscaling&lt;/strong&gt; — each block of 32 values shares a single scaling factor, giving the block adaptive dynamic range&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;FP4&lt;/strong&gt; = floating-point values stored in &lt;strong&gt;4 bits&lt;/strong&gt; each (E2M1 format: 1 sign + 2 exponent + 1 mantissa)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The format was standardised in 2023 by the Open Compute Project (OCP), backed jointly by AMD, Arm, Intel, Meta, Microsoft, NVIDIA, and Qualcomm.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tricky parts of Golang. Preemption in Go</title>
      <link>https://antonau.tech/posts/2025/08/golang-tricky-parts.preemption-in-go/</link>
      <pubDate>Mon, 18 Aug 2025 19:01:19 +0000</pubDate>
      <guid>https://antonau.tech/posts/2025/08/golang-tricky-parts.preemption-in-go/</guid>
      <description>&lt;p&gt;In the Go runtime, the scheduler is the engine that manages how thousands of goroutines are multiplexed onto a limited number of operating system threads. To ensure system responsiveness and prevent &amp;ldquo;resource hogging,&amp;rdquo; Go employs a mechanism called &lt;strong&gt;preemption&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This article explores the internal mechanics of the Go scheduler, the transition from cooperative to non-cooperative preemption, and real-world case studies from high-scale systems.&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-do-we-need-it&#34;&gt;Why do we need it?&lt;/h2&gt;&#xA;&lt;p&gt;Imagine you’re running a tight loop that never calls anything else. In a cooperative system, that goroutine would hog the CPU forever. With preemption, the runtime periodically interrupts it, giving other goroutines a chance to run. That’s how Go keeps the “green threads” from starving each other.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Search</title>
      <link>https://antonau.tech/search/</link>
      <pubDate>Mon, 24 Mar 2025 23:00:00 -0300</pubDate>
      <guid>https://antonau.tech/search/</guid>
      <description>&lt;h1 id=&#34;search&#34;&gt;Search&lt;/h1&gt;&#xA;&lt;p&gt;Here you can search for indexable pages, like posts and alike. There&amp;rsquo;s also support for URL param &amp;ldquo;q&amp;rdquo; which then auto searches upon page load event.&lt;/p&gt;&#xA;&lt;p class=&#34;hidden&#34;&gt;It&amp;#39;s necessary to enable Javascript&lt;/p&gt;&#xA;&lt;p class=&#34;search-loading hidden&#34;&gt;Loading...&lt;/p&gt;&#xA;&#xA;&lt;form id=&#34;search-form&#34; class=&#34;search-form&#34; action=&#34;#&#34; method=&#34;post&#34; accept-charset=&#34;UTF-8&#34; role=&#34;search&#34;&gt;&#xA;  &lt;div class=&#34;search-bar&#34;&gt;&#xA;    &lt;label for=&#34;query&#34; class=&#34;hidden&#34;&gt;&lt;/label&gt;&#xA;    &lt;input id=&#34;query&#34; class=&#34;search-text&#34; type=&#34;text&#34; placeholder=&#34;Search...&#34;/&gt;&#xA;  &lt;/div&gt;&#xA;&lt;/form&gt;&#xA;&#xA;&lt;div class=&#34;search-results&#34;&gt;&lt;/div&gt;&#xA;&#xA;&lt;template&gt;&#xA;  &lt;article class=&#34;search-result list-view&#34;&gt;&#xA;    &lt;header&gt;&#xA;      &lt;h2 class=&#34;title&#34;&gt;&lt;a href=&#34;#&#34;&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;      &lt;div class=&#34;submitted&#34;&gt;&#xA;        &lt;time class=&#34;created-date&#34;&gt;&lt;/time&gt;&#xA;      &lt;/div&gt;&#xA;    &lt;/header&gt;&#xA;    &lt;p class=&#34;content&#34;&gt;&lt;/p&gt;&#xA;  &lt;/article&gt;&#xA;&lt;/template&gt;</description>
    </item>
  </channel>
</rss>
