Rust async and the tokio Scheduler

Calling an async fn runs none of its body; it only produces a Future value. A Future is a state machine that advances to the next await each time it is polled, and when it cannot advance it leaves a Waker behind and returns Pending. After the first poll its state depends on its own address, so Pin keeps it from being moved. On a tokio runtime with two workers, four std::thread::sleep(100ms) jobs occupied both workers and delayed a task that wakes every 10ms by about 200ms; moving the same jobs to spawn_blocking brought the delay back to the few milliseconds seen without blocking. The tenth and final post in a Rust study series.

November 17, 2026 · 20 min read

Rust Closures and Iterators

A closure is a struct whose fields are the values it captures, and whether its body reads, mutates, or consumes those values decides whether it is Fn, FnMut, or FnOnce. Iterator adapters only stack up structs that hold such closures; elements pass through the chain one at a time when a consuming method like collect calls next. The sixth post in a Rust study series.

November 17, 2026 · 19 min read

Rust Memory Layout and Allocation

The same three-field struct takes 12 bytes when it keeps declaration order and 8 when the compiler picks the order. Option<&T> is 8 bytes like the pointer itself, with no tag, and a Vec keeps 24 bytes on the stack and its elements on the heap. Sizes were checked with size_of and the effect of removing allocations with criterion. The eighth post in a Rust study series.

November 17, 2026 · 18 min read

Rust Smart Pointers

A linked list written as a plain enum fails with E0072, and an Rc sent to a thread fails with E0277. Box lifts the rule that sizes must be known at compile time, while Rc, RefCell, Arc, and Mutex each relax the one-owner, no-overlapping-borrows rule, paying with a heap allocation, count updates, run-time checks, or locking. The seventh post in a Rust study series.

November 17, 2026 · 20 min read

Rust Traits, Generics, and dyn

Generics (including argument-position impl Trait) compile a copy of the function for each type it is called with and call it statically. dyn Trait compiles one function that reads the implementation’s address from a vtable. I treat the choice as depending on whether types must be mixed, and on whether the cost of extra copies or of indirect calls is the one that hurts. The fifth post in a Rust study series.

November 17, 2026 · 17 min read

Rust unsafe Boundaries

The borrow checker still runs inside an unsafe block, so two mutable borrows there still give E0499. What unsafe opens is operations the compiler cannot check, such as dereferencing a raw pointer (the Rust Book lists five), and the author has to supply the reason each one is safe. I wrapped split_at_mut in a safe function and implemented Send by hand for a type holding a raw pointer, to see where that responsibility splits. The ninth post in a Rust study series.

November 17, 2026 · 17 min read

Rust Lifetimes

A lifetime annotation 'a does not make a value live longer. It is a contract stating which input a returned reference borrows from, and the borrow checker combines that contract with each reference’s last use to compute borrow regions. The fourth post in a Rust study series.

November 14, 2026 · 11 min read

Rust References and Borrowing

A Rust reference borrows a value without taking ownership. The compiler allows many shared references &T or a single mutable reference &mut T at a time, rejecting code that changes a borrowed value, and it also rejects references that would outlive their owner, all at compile time. The third post in a Rust study series.

October 29, 2026 · 13 min read

Rust Move, Copy, and Clone

In Rust, assignment and passing a function argument move ownership by default. Only Copy types are bitwise-copied and leave the original usable, and the cost of duplicating heap data shows up in the code as a clone() call. The second post in a Rust study series.

October 15, 2026 · 11 min read

Rust Ownership and Freeing Memory

Rust has no garbage collector. Every value has a single owner, and the value is dropped where that owner’s scope ends. Because the drop point is fixed by scopes in the source code, files and locks are cleaned up by the same rule as memory. The first post in a Rust study series.

October 8, 2026 · 9 min read

JPA Persistence Context and Dirty Checking

A managed entity from findById gets UPDATEd through dirty checking, with no save() call. The three entity states, how snapshot comparison works, what save() actually does, and the persistence context lifetime that all of it depends on.

July 6, 2026 · 4 min read

@Transactional Only Works Through the Proxy

@Transactional doesn’t work just because it’s declared. Spring wraps the bean in a proxy and intercepts only the calls that go through it. Why the annotation is silently ignored on private methods and self-invocation, and how @DataJpaTest’s test transaction hides the defect.

July 5, 2026 · 5 min read

Three Type Systems and Runtimes — JVM, CPython, and the Go Compiler

Java pairs static strong typing with JVM bytecode and adaptive JIT optimization. Python combines dynamic typing with an interpreter and declarative type hints. Go ships static structural typing and a single compiler. The type-system decision drives the runtime mechanism.

June 16, 2024 · 6 min read

Three Concurrency Models — GIL, Virtual Thread, and Goroutine

CPython’s GIL serializes multithreaded execution and pushes work onto multiprocessing or asyncio. Java pinned threads 1:1 to the OS until virtual threads (Java 21) reopened the thread-per-request model. Go shipped with an M:N scheduler from day one. The model you start from decides whether your service goes thread-per-request, reactive, or multiprocess.

June 15, 2024 · 6 min read

Three Garbage Collectors — How Java, Python, and Go Reclaim Memory

All three languages use a garbage collector, but the priorities differ. Java leans on generational + region GCs (G1, ZGC), Python combines reference counting with a cyclic detector, and Go runs a single concurrent tri-color mark-and-sweep. What each GC gave up is what shapes its operational profile.

June 14, 2024 · 6 min read

Everything Is Pass by Value — Memory Transfer in Go, Java, and Python

Calling a function with an object is often described as pass by reference, but in memory all three languages copy values. Java copies a reference value, Python binds a new name to the same object (call by sharing), and Go copies a struct header — escape analysis decides where the values live.

June 13, 2024 · 7 min read

Go Concurrency Model

Go’s concurrency model builds on CSP, providing Goroutines and Channels as core tools. An overview of how each works and when to choose what.

April 5, 2024 · 4 min read

Spring WebFlux Fundamentals — Non-blocking I/O and the Reactive Stack

Spring MVC assigns one thread per request. When I/O waits pile up, threads sit idle. WebFlux replaces this with an event loop-based non-blocking model. A summary of the structural differences from MVC, the Reactor pattern, and when to choose which.

March 25, 2024 · 4 min read

Nest.js Fundamentals — DI and Module System

Nest.js provides a DI container and Module system at the framework level in the Node.js ecosystem. A summary of its core design principles: IoC, DI, Module, and Provider.

February 26, 2024 · 5 min read