Forem

Gabriel Anhaia profile picture

Gabriel Anhaia

Senior Software Engineer @ Monta · 10+ years in backend, distributed systems & AI agents · Creator of Hermes IDE (AI-native terminal) & Neural Playground · Author of 2 books · Open-source enthusiast

Location Berlin, Germany Joined Joined on  Personal website https://xgabriel.com github website

Work

Software Engineer and Book Author

Embeddings on the Edge: sentence-transformers vs Hosted APIs
Cover image for Embeddings on the Edge: sentence-transformers vs Hosted APIs

Embeddings on the Edge: sentence-transformers vs Hosted APIs

1
Comments
8 min read
Building a Plugin System in Go Without `plugin`: 3 Patterns That Actually Ship
Cover image for Building a Plugin System in Go Without `plugin`: 3 Patterns That Actually Ship

Building a Plugin System in Go Without `plugin`: 3 Patterns That Actually Ship

1
Comments
7 min read
Stage 3 vs Legacy TypeScript Decorators in a NestJS App
Cover image for Stage 3 vs Legacy TypeScript Decorators in a NestJS App

Stage 3 vs Legacy TypeScript Decorators in a NestJS App

3
Comments
8 min read
Generic-Heavy APIs Hurt Compile Times. Here Is How to Measure It
Cover image for Generic-Heavy APIs Hurt Compile Times. Here Is How to Measure It

Generic-Heavy APIs Hurt Compile Times. Here Is How to Measure It

1
Comments
8 min read
Mocking ESM in 2026: Vitest, Bun, and Node's mock.module
Cover image for Mocking ESM in 2026: Vitest, Bun, and Node's mock.module

Mocking ESM in 2026: Vitest, Bun, and Node's mock.module

1
Comments
9 min read
LLM Response Caching: When the 80/20 Hit Rate Saves the Bill
Cover image for LLM Response Caching: When the 80/20 Hit Rate Saves the Bill

LLM Response Caching: When the 80/20 Hit Rate Saves the Bill

1
Comments
8 min read
Stop Wrapping Errors in TypeScript. Use `cause` Instead.
Cover image for Stop Wrapping Errors in TypeScript. Use `cause` Instead.

Stop Wrapping Errors in TypeScript. Use `cause` Instead.

1
Comments
7 min read
The 7 Anthropic API Errors That Mean Different Things in Production
Cover image for The 7 Anthropic API Errors That Mean Different Things in Production

The 7 Anthropic API Errors That Mean Different Things in Production

1
Comments
8 min read
Spring Boot to NestJS: A Mental Model for Java Developers
Cover image for Spring Boot to NestJS: A Mental Model for Java Developers

Spring Boot to NestJS: A Mental Model for Java Developers

1
Comments
8 min read
Go's cmp.Or and cmp.Compare: Three-Way Comparison Without the Boilerplate
Cover image for Go's cmp.Or and cmp.Compare: Three-Way Comparison Without the Boilerplate

Go's cmp.Or and cmp.Compare: Three-Way Comparison Without the Boilerplate

Comments
7 min read
Reading -gcflags='-m=2' Output: What the Go Compiler Tells You About Inlining
Cover image for Reading -gcflags='-m=2' Output: What the Go Compiler Tells You About Inlining

Reading -gcflags='-m=2' Output: What the Go Compiler Tells You About Inlining

1
Comments
9 min read
iter.Seq in Go 1.23+: The Iterator Type Behind range-over-func
Cover image for iter.Seq in Go 1.23+: The Iterator Type Behind range-over-func

iter.Seq in Go 1.23+: The Iterator Type Behind range-over-func

1
Comments
7 min read
`Awaited<T>`, `ReturnType<T>`, `Parameters<T>`: When You're Reaching for the Wrong One
Cover image for `Awaited<T>`, `ReturnType<T>`, `Parameters<T>`: When You're Reaching for the Wrong One

`Awaited<T>`, `ReturnType<T>`, `Parameters<T>`: When You're Reaching for the Wrong One

Comments
9 min read
--isolatedDeclarations: The Build-Time Win for TS Library Authors
Cover image for --isolatedDeclarations: The Build-Time Win for TS Library Authors

--isolatedDeclarations: The Build-Time Win for TS Library Authors

1
Comments
9 min read
Tool-Use Latency Budget: Where the 8 Seconds Actually Go
Cover image for Tool-Use Latency Budget: Where the 8 Seconds Actually Go

Tool-Use Latency Budget: Where the 8 Seconds Actually Go

1
Comments
7 min read
RAG Evaluation Beyond Recall@K: Faithfulness, Coverage, Robustness
Cover image for RAG Evaluation Beyond Recall@K: Faithfulness, Coverage, Robustness

RAG Evaluation Beyond Recall@K: Faithfulness, Coverage, Robustness

Comments
9 min read
Stop Using `interface{}` Even in Your Generic Code
Cover image for Stop Using `interface{}` Even in Your Generic Code

Stop Using `interface{}` Even in Your Generic Code

Comments
7 min read
Prompt Injection Defense: 6 Patterns That Don't Rely on the Model
Cover image for Prompt Injection Defense: 6 Patterns That Don't Rely on the Model

Prompt Injection Defense: 6 Patterns That Don't Rely on the Model

Comments
7 min read
Bun Test vs Vitest for TypeScript Library Authors in 2026
Cover image for Bun Test vs Vitest for TypeScript Library Authors in 2026

Bun Test vs Vitest for TypeScript Library Authors in 2026

Comments
9 min read
Tagged Template Literals That Type-Check SQL: A 60-Line DSL
Cover image for Tagged Template Literals That Type-Check SQL: A 60-Line DSL

Tagged Template Literals That Type-Check SQL: A 60-Line DSL

Comments
8 min read
Building Agent Memory: Episodic vs Semantic Stores
Cover image for Building Agent Memory: Episodic vs Semantic Stores

Building Agent Memory: Episodic vs Semantic Stores

Comments
8 min read
Running go test -race in Production: Sampling Strategies That Don't Kill Throughput
Cover image for Running go test -race in Production: Sampling Strategies That Don't Kill Throughput

Running go test -race in Production: Sampling Strategies That Don't Kill Throughput

Comments
8 min read
Claude Computer Use in Production: 5 Patterns That Keep Surfacing
Cover image for Claude Computer Use in Production: 5 Patterns That Keep Surfacing

Claude Computer Use in Production: 5 Patterns That Keep Surfacing

1
Comments
8 min read
Promise.withResolvers: The Pattern That Killed Half Your Deferred Helpers
Cover image for Promise.withResolvers: The Pattern That Killed Half Your Deferred Helpers

Promise.withResolvers: The Pattern That Killed Half Your Deferred Helpers

1
Comments
9 min read
Go's slices Package: 11 Functions That Replace Half Your Helpers
Cover image for Go's slices Package: 11 Functions That Replace Half Your Helpers

Go's slices Package: 11 Functions That Replace Half Your Helpers

Comments
8 min read
Effect.ts vs Plain TypeScript: When the Algebraic Effects Earn Their Keep
Cover image for Effect.ts vs Plain TypeScript: When the Algebraic Effects Earn Their Keep

Effect.ts vs Plain TypeScript: When the Algebraic Effects Earn Their Keep

1
Comments
8 min read
go.work for Real Monorepos: Setup, CI Gotchas, and the Right Layout
Cover image for go.work for Real Monorepos: Setup, CI Gotchas, and the Right Layout

go.work for Real Monorepos: Setup, CI Gotchas, and the Right Layout

Comments
7 min read
4 Types of Hallucinations: One Detection Pattern Per Type
Cover image for 4 Types of Hallucinations: One Detection Pattern Per Type

4 Types of Hallucinations: One Detection Pattern Per Type

Comments
7 min read
TypeScript's using Keyword: Explicit Resource Management for Real
Cover image for TypeScript's using Keyword: Explicit Resource Management for Real

TypeScript's using Keyword: Explicit Resource Management for Real

Comments
8 min read
errors.Join vs Multi-Return: When to Aggregate, When to Wrap
Cover image for errors.Join vs Multi-Return: When to Aggregate, When to Wrap

errors.Join vs Multi-Return: When to Aggregate, When to Wrap

Comments
7 min read
Why JSON Mode Slows Your Streaming UX (And When That Tradeoff Makes Sense)
Cover image for Why JSON Mode Slows Your Streaming UX (And When That Tradeoff Makes Sense)

Why JSON Mode Slows Your Streaming UX (And When That Tradeoff Makes Sense)

Comments
7 min read
Streaming JSON in Go With encoding/json/v2: What's Different, What's Faster
Cover image for Streaming JSON in Go With encoding/json/v2: What's Different, What's Faster

Streaming JSON in Go With encoding/json/v2: What's Different, What's Faster

Comments
7 min read
Why Your Go Microservice Spends 40% of CPU on runtime.mallocgc
Cover image for Why Your Go Microservice Spends 40% of CPU on runtime.mallocgc

Why Your Go Microservice Spends 40% of CPU on runtime.mallocgc

Comments
8 min read
`Object.groupBy` and `Map.groupBy`: Stop Hand-Rolling Aggregation in 2026
Cover image for `Object.groupBy` and `Map.groupBy`: Stop Hand-Rolling Aggregation in 2026

`Object.groupBy` and `Map.groupBy`: Stop Hand-Rolling Aggregation in 2026

Comments
9 min read
Claude Opus 4.7 Adaptive Thinking: When the Reasoning Tokens Pay Off
Cover image for Claude Opus 4.7 Adaptive Thinking: When the Reasoning Tokens Pay Off

Claude Opus 4.7 Adaptive Thinking: When the Reasoning Tokens Pay Off

Comments
7 min read
PHP Traits in TypeScript: 4 Idioms That Replace Them
Cover image for PHP Traits in TypeScript: 4 Idioms That Replace Them

PHP Traits in TypeScript: 4 Idioms That Replace Them

Comments
7 min read
Why Your Production Agent Costs 5 More on Mondays (And the Fix)
Cover image for Why Your Production Agent Costs 5 More on Mondays (And the Fix)

Why Your Production Agent Costs 5 More on Mondays (And the Fix)

Comments
7 min read
errgroup vs WaitGroup vs Channels: Pick the Right Concurrency Primitive
Cover image for errgroup vs WaitGroup vs Channels: Pick the Right Concurrency Primitive

errgroup vs WaitGroup vs Channels: Pick the Right Concurrency Primitive

Comments
6 min read
Caching Pre-Computed Embeddings: TTL, Versioning, and the Cold-Start Problem
Cover image for Caching Pre-Computed Embeddings: TTL, Versioning, and the Cold-Start Problem

Caching Pre-Computed Embeddings: TTL, Versioning, and the Cold-Start Problem

Comments
8 min read
Why JSR Should Be Your Default Registry for New TypeScript Libraries in 2026
Cover image for Why JSR Should Be Your Default Registry for New TypeScript Libraries in 2026

Why JSR Should Be Your Default Registry for New TypeScript Libraries in 2026

1
Comments
9 min read
A Lock-Free Counter in Go: atomic, sync.Map, or Just a Mutex?
Cover image for A Lock-Free Counter in Go: atomic, sync.Map, or Just a Mutex?

A Lock-Free Counter in Go: atomic, sync.Map, or Just a Mutex?

Comments
7 min read
Function-Calling Schemas That Survive Model Upgrades
Cover image for Function-Calling Schemas That Survive Model Upgrades

Function-Calling Schemas That Survive Model Upgrades

Comments
7 min read
go.mod replace Directives: When They Save You and When They Trap You
Cover image for go.mod replace Directives: When They Save You and When They Trap You

go.mod replace Directives: When They Save You and When They Trap You

Comments
8 min read
Train-Test Contamination in LLM Evals: How to Detect It in Your Own Set
Cover image for Train-Test Contamination in LLM Evals: How to Detect It in Your Own Set

Train-Test Contamination in LLM Evals: How to Detect It in Your Own Set

1
Comments
7 min read
PHP Magic Methods to TypeScript Proxy: 5 Idioms That Translate
Cover image for PHP Magic Methods to TypeScript Proxy: 5 Idioms That Translate

PHP Magic Methods to TypeScript Proxy: 5 Idioms That Translate

Comments
8 min read
From Java's Optional<T> to TypeScript: Three Idioms That Replace It Cleanly
Cover image for From Java's Optional<T> to TypeScript: Three Idioms That Replace It Cleanly

From Java's Optional<T> to TypeScript: Three Idioms That Replace It Cleanly

Comments
7 min read
Test Doubles in Go Without a Mocking Framework: 4 Patterns
Cover image for Test Doubles in Go Without a Mocking Framework: 4 Patterns

Test Doubles in Go Without a Mocking Framework: 4 Patterns

Comments
8 min read
Logprobs in Production: 4 Things You Can Actually Do With Them
Cover image for Logprobs in Production: 4 Things You Can Actually Do With Them

Logprobs in Production: 4 Things You Can Actually Do With Them

Comments
8 min read
Distributive Conditional Types: Why T extends X Splits on Unions
Cover image for Distributive Conditional Types: Why T extends X Splits on Unions

Distributive Conditional Types: Why T extends X Splits on Unions

Comments
6 min read
A Worker Pool That Actually Drains on Shutdown: A Pattern for Go Services
Cover image for A Worker Pool That Actually Drains on Shutdown: A Pattern for Go Services

A Worker Pool That Actually Drains on Shutdown: A Pattern for Go Services

Comments
8 min read
RAG Re-Indexing Without Downtime: A Dual-Write Pattern for Embeddings
Cover image for RAG Re-Indexing Without Downtime: A Dual-Write Pattern for Embeddings

RAG Re-Indexing Without Downtime: A Dual-Write Pattern for Embeddings

1
Comments
8 min read
type vs interface in 2026: Stop the Religious War
Cover image for type vs interface in 2026: Stop the Religious War

type vs interface in 2026: Stop the Religious War

Comments
9 min read
Why time.After Is a Memory Leak in a Hot Path (And the Fix)
Cover image for Why time.After Is a Memory Leak in a Hot Path (And the Fix)

Why time.After Is a Memory Leak in a Hot Path (And the Fix)

Comments
7 min read
Anthropic Message Batching: When 50% Off Is Worth the Latency
Cover image for Anthropic Message Batching: When 50% Off Is Worth the Latency

Anthropic Message Batching: When 50% Off Is Worth the Latency

Comments
6 min read
Const Type Parameters in TypeScript 5: One Less Annotation
Cover image for Const Type Parameters in TypeScript 5: One Less Annotation

Const Type Parameters in TypeScript 5: One Less Annotation

Comments
8 min read
Goroutine Leaks Don't Show Up in CPU Profiles. Here's What to Read Instead
Cover image for Goroutine Leaks Don't Show Up in CPU Profiles. Here's What to Read Instead

Goroutine Leaks Don't Show Up in CPU Profiles. Here's What to Read Instead

Comments
7 min read
Speculative Decoding for Self-Hosted LLMs: When the Math Pays Off
Cover image for Speculative Decoding for Self-Hosted LLMs: When the Math Pays Off

Speculative Decoding for Self-Hosted LLMs: When the Math Pays Off

Comments
6 min read
TypeScript's noUncheckedIndexedAccess: Turn It On, See What Breaks
Cover image for TypeScript's noUncheckedIndexedAccess: Turn It On, See What Breaks

TypeScript's noUncheckedIndexedAccess: Turn It On, See What Breaks

Comments
8 min read
Generic Constraints in Go: comparable, ~int, and the Trap of Underlying Types
Cover image for Generic Constraints in Go: comparable, ~int, and the Trap of Underlying Types

Generic Constraints in Go: comparable, ~int, and the Trap of Underlying Types

Comments
7 min read
Tool-Result Truncation: The Silent Bug That Makes Agents Lie
Cover image for Tool-Result Truncation: The Silent Bug That Makes Agents Lie

Tool-Result Truncation: The Silent Bug That Makes Agents Lie

Comments
8 min read
loading...