Tech News
← Home  ·  All topics

C Programming

16 GoKawiil briefs on this topic · RSS for c programming

Playdate developers detail low-level C optimization tricks for emulator performance

A developer working with collaborator stonerl on a full-speed Game Boy emulator for the Playdate console has published a set of advanced optimization techniques discovered during that project. The tips cover how the Playdate's CPU and small instruction cache behave, including the finding that compiling with -Os instead of -O3 and shrinking core code to fit within the 4KB (or 16KB on Rev B) instruction cache can dramatically boost speed.

C's variable-size integers explained as portability feature, not flaw

An educational retrospective on teaching C explains why types like int, short, and long have no fixed bit-width in the language specification. The author recounts how sizeof(int) returned 2 bytes on old 386 machines versus 4 bytes on most modern systems, and recommends students use the stdint.h header for fixed-width types like int8_t and uint16_t when consistent sizes are required.

Developer builds a working Python interpreter in just 1024 bytes of C

Austin Z. Henley, a Microsoft engineer, built a minimalist Python interpreter written in C that fits within 1024 bytes of code, after an initial attempt at 512 bytes proved too small. The interpreter supports a limited subset of Python syntax—including def, colons, indentation, and parenthesis-free if statements—enough to run a FizzBuzz program, but skips CPython's full tokenizing, AST, and bytecode pipeline in favor of global variables and a fixed-length array.

Canonical backs Bristol PhD to automate C-to-Rust code conversion

Canonical is funding a three-year PhD project at the University of Bristol's Programming Languages Research Group aimed at automatically converting large C codebases into Rust. UK Research and Innovation is providing matching funds, and the project will be led by student Alex Wood under Professor Meng Wang, with Dr. Cristina David and Canonical's Jon Seager as co-supervisors.