Show HN: NES Contra (1987) port (ASM –> C and then C –> WebAssembly)
A browser-based port of the 1987 NES game Contra converts its assembly code to C and then WebAssembly. It supports solo play and online two-player games. (epoyraz.github.io)
Tailscale’s iOS VPN runs as a Network Extension, which can use only about 15 MB of memory - far less than a regular iOS app. When the extension exceeds that limit, iOS may terminate it and interrupt VPN access. Its baseline use was already 10-12 MB, leaving little room for features or for users with large networks. The team first reduced allocations through profiling and code changes, then made Go’s garbage collector more aggressive. Running with GOMAXPROCS=1 also helped: it reduced thread costs and limited the allocator’s per-CPU memory slabs. Other allocator changes saved memory but seemed too fragile to adopt, and these runtime and code-level measures did not solve the problem.
The key insight came from examining the memory iOS actually counts, rather than relying only on application-level usage. A memory report showed a 13 MB footprint, with a large share attributed to VM_ALLOCATE and another substantial portion to DATA_CONST. That category contains data made read-only after the operating system applies relocations to support position-independent executables. Although constant afterward, relocated pages are marked dirty and count toward the process’s footprint. The investigation therefore shifted from shrinking Go’s runtime allocations to reducing the executable’s relocations. A script that modeled the binary’s relocations matched iOS’s memory accounting, giving the team a concrete way to study whether linker changes could reclaim some of the scarce memory.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.
A browser-based port of the 1987 NES game Contra converts its assembly code to C and then WebAssembly. It supports solo play and online two-player games. (epoyraz.github.io)
PostgreSQL’s TOAST storage made the table much smaller, and counting or scanning rows was faster than with the larger uncompressed table. But reading a field inside every toasted value required far more buffer reads, showing that TOAST can trade space savings for slower access to large values. (pgedge.com)
Large GROUP BY hash tables cause frequent slow RAM accesses, leaving CPUs stalled even when monitoring shows 100% usage. Processing data in smaller chunks can improve cache use and speed up aggregation, even if it requires more CPU work. (pivotlake.io)
Enlightenment 0.28 adds initial NetBSD support, a NetworkManager module, and native PipeWire mixer support while retaining PulseAudio compatibility. The release also improves window management, display handling, and X11 and Wayland support, alongside numerous fixes and code cleanups. (phoronix.com)
Nonna is a TypeScript dependency-injection framework and ahead-of-time compiler that avoids reflection and runtime dependencies. It supports Node.js, Deno, Bun, edge runtimes, and major frontend frameworks, with request scoping and deterministic lifecycle hooks. (nonna.nodeboot.io)
Jepsen found 96 bugs in ParticleDB versions 1.1.4 through 1.1.18.11.rc-22, including crashes, data loss, and serious transaction anomalies. Most issues were fixed, but committed writes could still disappear and serializable transactions still had anomalies; Orkes says a later release resolves the remaining problems. (jepsen.io)
Today's best Hacker News stories, summarized and screenshotted, one email a day.