Programming
An Introduction to the io_uring Asynchronous I/O Framework | linux
Interrupt driven – By default, the io_uring instance is setup for interrupt driven I/O. I/O may be submitted using io_uring_enter() and can be reaped by checking the completion queue directly. Polled – Perform busy-waiting for an I/O completion, as opposed to getting notifications via an asynchronou…
added Jul 21, 2026
Read article →Lecture 11: Type Inference
The key is to reframe the question ... type is, yet, but we can deduce certain facts about it. This process is called type-inference, and we will follow the classic Hindley-Milner algorithm to deduce types for our programs....
added Jul 19, 2026
Read article →How to Build an LSM Tree Storage Engine from Scratch – Full Handbook
We’ll discuss this again below when we’re talking about compaction. With this approach, we either have the old valid MANIFEST or the new valid MANIFEST, never a partially written corrupted file. From an integration standpoint, NewDB will read the manifest and set its SSTable slice based on that. The…
added Jul 18, 2026
Read article →Algebraic Effects for Functional Programming
Figure 6. Type rules for explicitly typed Koka · too much resources to run reliably. A better approach was ... System F [15] extended with the effect annotations. In par- ticular, lambda’s carry the effect of the body as ϵ. Similarly, handlers are annotated with the handled effect type l.
added Jul 16, 2026
Read article →Rust Borrow Checker
Instead of taking Vec<i32>s as our arguments, we take a reference: &Vec<i32>. And instead of passing v1 and v2 directly, we pass &v1 and &v2. We call the &T type a ‘reference’, and rather than owning the resource, it borrows ownership. A binding that borrows something does not deallocate the resourc…
added Jul 14, 2026
Read article →Raft Consensus Algorithm: A Complete Guide for Modern Distributed Systems | by aman kohli | Medium
Make consensus understandable. Where Paxos is notoriously complex, Raft breaks the problem down into three simple components: Leader Election — Choosing a single leader to manage operations · Log Replication — Keeping all nodes’ logs consistent · Safety Mechanisms — Guaranteeing that committed data …
added Jul 13, 2026
Read article →Swift 6 & Safe Concurrency: Understanding async/await, Actors, and Structured Concurrency | by Bhanu Pratap | Medium
func fetchMultipleUsers() async { await withTaskGroup(of: String.self) { group in for id in 1...3 { group.addTask { return "User \(id)" } } for await user in group { print(user) } } } // Calling the async function Task { await fetchMultipleUsers() } 🔹 Why is Structured Concurrency better? ✅ No need …
added Jul 12, 2026
Read article →Functors · OCaml Documentation
Module System Modules Functors First-Class Modules Libraries With Dune · Data Structures Options Arrays Maps Sets Hash Tables Sequences CS3110 Memoization CS3110 Monads · Advanced Topics Preprocessors and PPXs Operators Objects · Runtime & Compiler RWO Memory Representation of Values RWO Understandi…
added Jul 10, 2026
Read article →C++ move semantics and rvalue references explained | by iteo | Medium
As we can see copy operations take ... the reference type. And this is what std::move function does — it just converts lvalue reference to rvalue reference....
added Jul 9, 2026
Read article →All About Monads - HaskellWiki
Any instance of the Monad class can be used in a do-block in Haskell. In short, the do notation allows you to write monadic computations using a pseudo-imperative style with named variables. The result of a monadic computation can be "assigned" to a variable using a left arrow <- operator.
added Jul 8, 2026
Read article →Fearless Concurrency
When we run the code in Listing 16-8, we’ll see the value printed from the main thread: ... The ownership rules play a vital role in message sending because they help you write safe, concurrent code. Preventing errors in concurrent programming is the advantage of thinking about ownership throughout …
added Jul 6, 2026
Read article →Rust Ownership, Borrowing, and Lifetimes | integralist
The above code states all the references in the signature must have the same lifetime, and it tells the borrow checker it should reject any values that don’t adhere to these constraints.
added Jul 5, 2026
Read article →Coroutines | Kotlin Documentation
Most coroutine features are provided by the kotlinx.coroutines library, which includes tools for launching coroutines, handling concurrency, working with asynchronous streams, and more. If you're new to coroutines in Kotlin, start with the Coroutine basics guide before diving into more complex topic…
added Jul 4, 2026
Read article →Building Fault-Tolerant Systems: Inside the OTP Design Principles of Erlang | by Matheus de Camargo Marques | Medium
Its foundation: process-oriented programming + let it crash philosophy + automatic fault recovery. A supervision tree is a hierarchical arrangement of processes where supervisors monitor their child processes (workers or other supervisors).
added Jul 2, 2026
Read article →Python 3.13's Free-Threaded Mode: What No-GIL Actually Means for Your Code - Java Code Geeks
It works, but at the cost of high ... removes that tax entirely. Released on October 7, 2024, Python 3.13 did not remove the GIL from the regular build....
added Jul 1, 2026
Read article →Tutorial | Tokio - An asynchronous Rust runtime
When writing asynchronous code, you cannot use the ordinary blocking APIs provided by the Rust standard library, and must instead use asynchronous versions of them. These alternate versions are provided by Tokio, mirroring the API of the Rust standard library where it makes sense.
added Jun 30, 2026
Read article →Basic MetaProgramming in Zig
The first part, the switch, ensures that T is a struct, union, enum of an opaque, else it returns false. We saw how hasFn returns false for other types, whereas @hasDecl gives a comptime error. Here we see how @typeInfo can be used to turn that compile time error into value.
added Jun 27, 2026
Read article →Understanding Python’s asyncio: A Deep Dive into the Event Loop | by Hyunil Kim | 딜리버스 | Medium
Coroutines are the fundamental unit of async programming in Python. When you define an async function, Python creates a coroutine object. Let’s look at what happens behind the scenes: async def fetch_data(): await asyncio.sleep(1) return "data"
added Jun 25, 2026
Read article →Rust Ownership, Borrowing & Lifetimes Explained (2025): The Core Concepts | by Ali Aslam | Medium
Rust’s borrow checker is like having unique_ptr, const, and a static lifetime analyzer all rolled into one.
added Jun 24, 2026
Read article →Routing Enhancements for Go 1.22 - The Go Programming Language
In accordance with HTTP semantics, a net/http server will reply to such a request with a 405 Method Not Allowed error that lists the available methods in an Allow header. A wildcard can match an entire segment, like {id} in the example above, or if it ends in ...
added Jun 23, 2026
Read article →How to Use sync.Pool for Object Reuse in Go
/* Benchmark Analysis Guide: 1. ns/op (nanoseconds per operation) - Lower is better - Pool typically shows 2-5x improvement 2. B/op (bytes allocated per operation) - Pool should show significant reduction - Target: 0 or near-zero for hot paths 3. allocs/op (allocations per operation) - Pool should r…
added Jun 22, 2026
Read article →The Go Memory Model - The Go Programming Language
The go statement that starts a ... world" at some point in the future (perhaps after hello has returned). The exit of a goroutine is not guaranteed to be synchronized before any event in the program....
added Jun 20, 2026
Read article →Go synctest: Solving Flaky Tests
synctest is a new feature introduced in Go 1.24. It enables deterministic testing of concurrent code by running goroutines in controlled, isolated environments.
added Jun 19, 2026
Read article →Fixing For Loops in Go 1.22 - The Go Programming Language
For Go 1.22, we plan to change for loops to make these variables have per-iteration scope instead of per-loop scope. This change will fix the examples above, so that they are no longer buggy Go programs; it will end the production problems caused by such mistakes; and it will remove the need ...
added Jun 18, 2026
Read article →reflect package - reflect - Go Packages
SliceOf returns the slice type with element type t. For example, if t represents int, SliceOf(t) represents []int. ... StructOf returns the struct type containing fields. The Offset and Index fields are ignored and computed as they would be by the compiler. StructOf currently does not support promot…
added Jun 17, 2026
Read article →errgroup package - golang.org/x/sync/errgroup - Go Packages
Package errgroup provides synchronization, error propagation, and Context cancellation for groups of goroutines working on subtasks of a common task.
added Jun 16, 2026
Read article →Stack or Heap? Going Deeper with Escape Analysis in Go for Better Performance
If a variable doesn't escape (it remains within the scope of the function where it is defined and isn't returned or referenced outside), it is stack-allocated. Otherwise, it is allocated on the heap.
added Jun 15, 2026
Read article →Data Race Detector - The Go Programming Language
The fix is to introduce new variables in the goroutines (note the use of :=): ... _, err := f1.Write(data) ... _, err := f2.Write(data) ... If the following code is called from several goroutines, it leads to races on the service map. Concurrent reads and writes of the same map are not safe:
added Jun 12, 2026
Read article →Memory Efficiency and Go’s Garbage Collector - Go Optimization Guide
GOMEMLIMIT=X tells the runtime to aim for a specific memory ceiling. For example, GOMEMLIMIT=2GiB will trigger garbage collection when total memory usage nears 2 GiB. GOGC=off disables the default GC pacing algorithm, so garbage collection only runs when the memory limit is hit.
added Jun 11, 2026
Read article →Profile-guided optimization - The Go Programming Language
The standard approach to building is to store a pprof CPU profile with filename default.pgo in the main package directory of the profiled binary. By default, go build will detect default.pgo files automatically and enable PGO. Committing profiles directly in the source repository is recommended as p…
added Jun 10, 2026
Read article →How to Implement Token Bucket Rate Limiting in Go
Always initialize buckets with full capacity. Otherwise, legitimate clients get rate limited on their very first request. Not handling time drift. If your server's clock jumps forward (NTP sync, VM migration), you might add way too many tokens.
added Jun 9, 2026
Read article →Getting Started with Distributed Tracing in Go Using OpenTelemetry and Tempo Part 1 | by Jirawan.C | Medium
Usage: Call InitOpenTelemetry(ctx) at the start of your application to initialize tracing. The server handles graceful shutdown on receiving an interrupt signal. This code demonstrates setting up an HTTP server in Go with OpenTelemetry for ...
added Jun 7, 2026
Read article →Mastering Go's Select Statement: Timeout Patterns, Fan-In, and Cancellation
Learn how to use Go's select statement to handle timeouts, cancellations, and concurrency patterns like fan-in and fan-out effectively.
added Jun 7, 2026
Read article →WebAssembly using Go (Golang) | Run Go programs in the browser
The following command will cross compile this Go program and place the output binary inside the assets folder. cd ~/Documents/webassembly/cmd/wasm/ GOOS=js GOARCH=wasm go build -o ../../assets/json.wasm
added Jun 6, 2026
Read article →How to Handle HTTP Client Timeouts Properly in Go
// Create a custom transport with fine-grained timeout control transport := &http.Transport{ // Maximum time to wait for a TCP connection to be established DialContext: (&net.Dialer{ Timeout: 10 * time.Second, // Connection timeout KeepAlive: 30 * time.Second, // TCP keepalive interval }).DialContex…
added Jun 6, 2026
Read article →How to Bundle Static Assets into Go Binaries with go:embed
Learn how to use Go's built-in embed directive to bundle static files like HTML, CSS, JavaScript, and images directly into your compiled binary for simpler deployments and distribution.
added Jun 5, 2026
Read article →Graceful Shutdown in Go: Practical Patterns
It is a good practice to reserve about 20 percent of the time as a safety margin to avoid being killed before cleanup finishes. This means aiming to finish everything within 25 seconds to avoid data loss or inconsistency. When using net/http, you can handle graceful shutdown by calling the http.Serv…
added Jun 5, 2026
Read article →Tutorial: Getting started with multi-module workspaces - The Go Programming Language
With multi-module workspaces, you can tell the Go command that you’re writing code in multiple modules at the same time and easily build and run code in those modules. In this tutorial, you’ll create two modules in a shared multi-module workspace, make changes across those modules, and ...
added Jun 4, 2026
Read article →Basics tutorial | Go | gRPC
Use the Go gRPC API to write a simple client and server for your service. It assumes that you have read the Introduction to gRPC and are familiar with protocol buffers. Note that the example in this tutorial uses the proto3 version of the protocol ...
added Jun 4, 2026
Read article →Go Fuzzing - The Go Programming Language
Go supports fuzzing in its standard toolchain beginning in Go 1.18. Native Go fuzz tests are supported by OSS-Fuzz. Try out the tutorial for fuzzing with Go.
added Jun 3, 2026
Read article →Go Wiki: TableDrivenTests - The Go Programming Language
More importantly, map iteration order isn’t specified nor is it even guaranteed to be the same from one iteration to the next. This ensures that each test is independent of the others and that testing order doesn’t impact results. Parallelizing table tests is simple, but requires precision to avoid …
added Jun 3, 2026
Read article →Logging in Go with Slog: A Practitioner's Guide · Dash0
While slightly more verbose, using slog.AttrCopy is the only right way to log in Go. It ensures your logs are always well-formed, reliable, and safe from runtime surprises. While using slog.AttrCopy is the safer approach, there’s nothing stopping ...
added Jun 3, 2026
Read article →Profiling Go Programs - The Go Programming Language
Benchmarks are only as good as the programs they measure. We used go tool pprof to study an inefficient Go program and then to improve its performance by an order of magnitude and to reduce its memory usage by a factor of 3.7. A subsequent comparison with an equivalently optimized C++ program ...
added Jun 2, 2026
Read article →How to Implement Middleware Chains in Go HTTP Servers
Middleware is one of those patterns ... handlers together. In Go, the standard library gives us everything we need to build clean, composable middleware without relying on external frameworks....
added Jun 2, 2026
Read article →How to Use Context in Go for Cancellation and Timeouts
package main import ( "context" "fmt" "net/http" "time" ) func handler(w http.ResponseWriter, r *http.Request) { // r.Context() is cancelled when: // - Client disconnects // - Request times out // - Handler returns ctx := r.Context() // Add our own timeout ctx, cancel := context.WithTimeout(ctx, 5*t…
added Jun 1, 2026
Read article →Go 1.23 Iterators Tutorial | TutorialEdge.net
In this tutorial, we'll be exploring the new range-over-func syntax introduced in Go 1.23 and how to use iterators in your Go applications.
added May 31, 2026
Read article →Tutorial: Getting started with generics - The Go Programming Language
To support this, you’ll write a function that declares type parameters in addition to its ordinary function parameters. These type parameters make the function generic, enabling it to work with arguments of different types.
added May 31, 2026
Read article →How to Handle Errors Effectively in Go
package main import ( "errors" "fmt" "net" ) func connectToServer(addr string) error { conn, err := net.Dial("tcp", addr) if err != nil { return fmt.Errorf("connecting to server: %w", err) } defer conn.Close() return nil } func main() { err := connec…
added May 31, 2026
Read article →How to Use Goroutines and Channels for Concurrent Processing
Master Go concurrency with goroutines and channels, learning patterns for parallel work without race conditions including worker pools, fan-out/fan-in, and pipeline patterns.
added May 31, 2026
Read article →Scala vs. GO. Introduction | by Javier Ramos | ITNEXT
Go, in the other hand, is a newer, simpler language created by Google to overcome the criticisms of C++; designing a language with multi core processors in mind. Both are great languages that can achieve great performance for concurrent applications and stream processing but their design is quite di…
added May 31, 2026
Read article →Go vs Scala | Know The 8 Most Amazing Differences
Back to Scala vs Go based on this model, GO provides a more straightforward and smaller set of orthogonal primitives that easily interact with ease and are expected. A developer can quickly build his need by learning a small number of primitives, ...
added May 31, 2026
Read article →