Topic

Low-Level Programming

Low-level programming discussions covering assembly, memory management, systems programming, and hardware interaction from developer communities.

What this topic tracks

  • Engineering practices and ecosystem debates
  • Tools, architecture, and implementation lessons
  • Relevant discussions from developer communities

Low-Level Programming · 429 stories

Recent stories

Each story's summary, with the places it was discussed.

Summaries are written by AI from the linked sources. Open the source for full context.

20 stories

Type Safe Generic Data Structures in C

danielchasehooper.com · 3 Oct

Algorithms · C · Low-Level Programming · Programming Languages

A C technique creates type-safe generic data structures by combining inline storage with a union that carries compile-time type information.

A List(type) union exposes both a runtime node head and a type-specific payload pointer; macros use the ternary operator to reject mismatched elements while automatically supplying sizes. Flexible array members keep each node and its data in one allocation. The approach supports lists, maps, and trees, with typedefs needed when passing instantiated types between functions.

Show HN: Zero C# – C# without a runtime or GC

onurgumus.github.io · 21 Nov

C# · Low-Level Programming · Programming Languages

Zero C# is a bflat fork that compiles C# directly into small native programs without the .

NET runtime, garbage collector, or installation requirements. It retains C# 15 features, generics, interfaces, virtual methods, records, lambdas, queries, and threads, while using manually freed arenas and a small library for strings, collections, and I/O. The same source targets Linux, macOS, Windows, WebAssembly, and DOS on a 386; Hello World builds range from 10,752 bytes on Windows to 64,728 on macOS.

C++26: Trivial infinite loops are no longer undefined behaviour

sandordargo.com · 15 Sept

C++ · Low-Level Programming · Programming Languages

Before C++26, a side-effect-free `while (true);` had undefined behaviour because it violated C++’s forward-progress guarantee, allowing compilers to remove it.

This endangered embedded halt-on-error handlers. P2809R3 makes narrowly defined trivial infinite loops well-defined by assigning them `std::this_thread::yield()` semantics, though freestanding implementations may opt out.

Hacking the Xbox 360 Hypervisor Part 3: Bad Update Improvements

icode4.coffee · 4 Nov

Cybersecurity · Low-Level Programming · Performance · Operating Systems

Bad Update evolved from a 20-minute exploit with roughly 30% success into an almost instantaneous attack with near-100% reliability. ihatecompvir and InvoxiPlayGames added the Rock Band Blitz DaTArrest entry point, removing the Tony Hawk disc requirement.

Máté improved the hypervisor race using a ciphertext hash table, stronger cache flushing, hardware-thread scheduling, and block-counting detection. Further tuning prevented cache-pressure crashes, making USB-based execution practical; source code is available on GitHub.

A 40ms Go garbage collector pause caused by swap

frn.sh · 5 Oct

Backend · Go · Low-Level Programming · Performance · Operating Systems

Running swap in production caused Go’s stop-the-world garbage-collector pauses to reach 40ms when GC metadata was paged out.

A Hetzner test with kernel 6.8 and MGLRU found 228 page faults consuming 39ms during GC bookkeeping; median pauses were 51μs. Reused, non-freed metadata is evicted by age and faulted back during sweep and mark termination, halting every P. Building a 511KiB message also rose from 3–5ms to 105ms on NVMe and 903ms on network storage. Go 1.26’s Green Tea GC had negligible impact.

Ten Lines Of Code That Changed My World

pixelambacht.nl · 25 Sept

CSS · Low-Level Programming · Programming Languages

The author revisits ten memorable code snippets spanning Hello World, JavaScript quirks, self-modifying 6502 assembly, Windows batch scripting, CSS debugging and art, game cheats, Linux pranks, and crude account scanning.

Together, they capture formative lessons about computer control, low-level power, programming humor, experimentation, security risks, and the lasting emotional impact of code.

XOR'ing a register with itself is the idiom for zeroing it out. Why not sub?

devblogs.microsoft.com · 21 Apr

Low-Level Programming · Programming Languages · Computer Science

Matt Godbolt and others discuss why xor eax, eax is preferred over sub eax, eax to zero out registers in x86 architecture.

While both are functionally equivalent and compact, xor became the industry standard. Modern CPUs now optimize both instructions via the front-end, making them effectively zero-cycle operations, but xor maintains dominance due to legacy adoption and developer convention.

the lost malloc()

napcakes.nekoweb.org · 29 Oct

C · Low-Level Programming · History

Unix’s early memory management evolved from simple linear allocators to explicit-region first-fit allocation and eventually conventional malloc/free.

Unix V4’s compiler used sbrk-based allocation without freeing; kernel malloc/mfree operated on separate coremap and swapmap regions for main memory and swap. Later code showed rollback, new-like macros, and garbage collection experiments. Hardware limits and simple program lifetimes shaped these designs, but explicit regions and lifetime-oriented allocation offered advantages largely lost as malloc/free became standard.

Exploiting System Management Mode with a very long interrupt

github.com · 6 Aug

Cybersecurity · Hardware · Low-Level Programming

Researchers discovered an exploit that breaks SMM security by using an extremely slow machine instruction to bypass the required all-core synchronization.

By stalling a core for over a second, an attacker can create a window where one core operates outside SMM while others are inside, turning previously dormant SMM potential vulnerabilities into exploitable software-based attacks.

Solod: Go can be a better C

solod.dev · 13 Jul

C · Low-Level Programming · Programming Languages

Solod (So) is a strict subset of Go that compiles to standard C, offering systems-level control with stack-allocated memory.

It supports core Go features like structs, interfaces, and methods while remaining familiar to Go and C developers. Currently in active development, version 0.2 introduces networking and WebAssembly support, with more concurrency features planned.

Afterglow: Run classic After Dark screen savers on modern macOS

morphing.cloud · 27 Aug

Low-Level Programming · macOS · Software Architecture

Afterglow is a dependency-free emulator for running original 68k After Dark screen saver modules on modern macOS.

Built for software preservation, it imports modules from files, disk images, archives, or the Internet Archive, and offers a screen saver, fullscreen mode, randomization, multimodule support, CRT shaders, and inspection tools—without requiring Apple ROMs or Classic Mac OS.

Solo – a .so loader for static Linux binaries

github.com · 14 Aug

Linux · Low-Level Programming · Software Architecture

SoLo enables a single statically linked musl Linux executable to load and use host glibc-linked Vulkan/OpenGL drivers without containers, AppImage, or a second libc.

Its embedded ELF loader and glibc-to-musl ABI bridge support relocations, TLS, symbol versioning, exceptions, and introspection. A tested Vulkan compute demo and broad CI validation demonstrate practical compatibility on x86-64 and aarch64.

Linux on the Atari Jaguar

cakehonolulu.github.io · 5 Jul

C · Linux · Low-Level Programming

Running Linux on an Atari Jaguar is a challenging technical project that requires using uClinux for the Motorola 68000 processor because the system lacks an MMU.

By leveraging XIP, custom console drivers via the DSP, and flat binaries, the author successfully ported a minimal kernel and BusyBox to the 64-bit console.

Show HN: Decomp Academy – Learn to decompile GameCube games into matching C

decomp-academy.dev · 28 Jun

C · Low-Level Programming · Computer Science

This interactive platform teaches GameCube reverse engineering by challenging users to decompile assembly code into byte-matching C.

It features a comprehensive curriculum ranging from basic idioms to complex ABI and optimization patterns, using the actual 2001 compiler to grade submissions against real functions from Star Fox Adventures.

The x86 CPU: From 4004 to 486

pikuma.com · 18 Nov

Hardware · Low-Level Programming · History

The x86 architecture accumulated through compatibility-driven decisions from the 4004 to the 486, rather than being designed as a coherent whole.

The 8008 inherited little-endian order and a parity flag from the Datapoint 2200; the 8080 established register pairs and I/O; and the 8086 mapped these into AX, BX, CX, and DX while adding segmentation. The 8088 powered the IBM PC, the 286 added protected mode and the A20 workaround, the 386 added 32-bit operation, paging, and virtual 8086 mode, and the 486 mainly improved performance with cache, an integrated FPU, and pipelining.

Bringing application context to full-host eBPF profiling

datadoghq.com · 1 Dec

Backend · Low-Level Programming · Observability · Performance · Software Architecture

OpenTelemetry standardized process and thread context protocols that let the OpenTelemetry eBPF Profiler connect full-host profiles to applications, requests, and traces.

Process context publishes resource attributes through a discoverable Linux memory mapping, while thread context exposes trace, span, and request attributes through a compact ELF thread-local record. The design handles fork(), multiple TLS access models, and runtime differences across Java, Python, Go, Ruby, .NET, and Node.js. Java benchmarks reduced context-update costs to 91.2 ns.

Inkling 2 mini pp degradation just got fixed in llama.cpp (Vulkan)! Vulkan vs ROCm comparison

github.com · 27 Nov

Artificial Intelligence · C++ · Large Language Models · Low-Level Programming · Machine Learning

llama.cpp’s Vulkan backend fixes Inkling 2 mini prompt-processing degradation by adding indexed bias support throughout Flash Attention shaders and pipeline selection.

The patch introduces BiasBins, bias-table and bias-index buffers, query/head mapping for GQA, staged bias loading for cooperative-matrix paths, and bias-aware handling of zero masks, sparse masks, and flip paths. It also accounts for bias_bins in pipeline-state comparisons and tracks reserved shared memory. No ROCm measurements or direct Vulkan-versus-ROCm results are provided.

C vs. C#: racing VLC's Gaussian blur

martinfinkel.com · 21 Oct

C# · Low-Level Programming · Performance · Programming Languages

A line-by-line C# port of VLC's Gaussian blur, built with .

NET Native AOT, ran 23% slower than VLC's C implementation on 1080p frames, despite producing byte-identical output and allocating nothing per frame. Two small edits brought it within 8%. Shared algorithmic optimizations made C# 2.5x faster than current VLC code; AVX2 SIMD tuning reached 236 fps versus C's 240 fps at sigma 4, while both were about 30x faster than the original. C still leads on some loops.

Linus Torvalds's first LLM-assisted patch series

lwn.net · 14 Oct

C · Linux · Low-Level Programming · Performance · Operating Systems

Linus Torvalds posted his first LLM-assisted Linux patch series: ten patches that optimize folio lookup by detecting hot folios, delaying their release until after an RCU period, and performing folio data accesses under RCU.

When user copies cause no page faults, the fastpath avoids refcount acquisition. The changes produced an order-of-magnitude speedup in a read()-heavy benchmark, but reviewers found a race condition requiring further work.

Writing Efficient C++ Code

asawicki.info · 25 Sept

C++ · Low-Level Programming · Performance

Efficient C++ requires more than choosing a native language: prioritize data layout, cache locality, contiguous structures, and parallelizable operations.

Prefer Data-Oriented Design and AOS/SOA based on access patterns, minimize allocations and costly I/O, understand STL and compiler behavior, reuse objects, and measure performance while avoiding unnecessary abstraction and premature micro-optimization.

Where it came fromHacker NewsLobstersDatadog EngineeringRedditCreate a Snapbyte.dev digest and choose Low-Level Programming as one of your topics.Build your digest