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)
Sanstun is Firezone’s Rust implementation of the WireGuard state machine, designed around sans-IO principles: protocol logic is separated from networking, time, and randomness so it can be tested and composed more easily. Firezone developed it after more than two years of patching boringtun to meet product needs, including deterministic time handling, configurable behavior, and fixes for edge cases. Sanstun also avoids buffering packets internally; applications decide what to queue when no session exists. Its API separates interfaces, which receive and validate datagrams, from tunnels, which handle messages for individual peers. This structure makes essential safeguards harder to bypass: inbound traffic passes through interface-level parsing, cookie checks, and rate limiting before reaching a tunnel.
The design also lets applications parallelize encryption and decryption within a single tunnel. WireGuard’s packet counters and session state require coordinated bookkeeping, but the expensive cryptographic work can run independently. Sanstun reserves counters and updates state in a brief setup step, then returns a transferable pending operation for a worker thread to encrypt or decrypt. Benchmarks report that for 1,280-byte packets, the bookkeeping for outbound encryption takes about 21 nanoseconds, compared with roughly 933 nanoseconds for encryption; inbound decryption takes about 915 nanoseconds, with similarly small setup and commit costs. This split suggests substantial throughput gains from worker-thread offloading, though real-world speedups will be lower because of thread-transfer and scheduling overhead.
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.