What Remains Technical Breakdown
What Remains is a narrative adventure game for the 8-bit NES video game console, and was released in March 2019 as a free ROM, playable in emulator. It was created by a small team, Iodine Dynamics, over the course of two years of on and off development. It’s currently in the hardware phase as a limited batch of cartridges are being created from all recycled parts.
The game plays out over 6 stages, wherein the player walks around multiple scenes with 4-way scrolling maps, speaking to NPCs, collecting clues, learning about their world, playing mini-games, and solving simple puzzles. As the primary engineer on this project, I faced a lot of challenges in bringing the team’s vision to reality. Given the significant restrains of the NES hardware, making any game is difficult enough, let alone one with as much content as What Remains. Only by creating useful subsystems to hide and manage this complexity were we able to work as a team to complete the game.
Herein is a technical breakdown of some of the pieces that make up our game’s engine, in the hopes that others find it useful or at least interesting to read about.
Defeating Racket’s separate compilation guarantee
Being a self-described programming-language programming language is an ambitious goal. To preserve predictability while permitting linguistic extension, Racket comes equipped with a module system carefully designed to accommodate composable and compilable macros. One of the module system’s foundational properties is its separate compilation guarantee, which imposes strong, unbreakable limits on the extent of compile-time side-effects. It is essential for preserving static guarantees in a world where compiling a module can execute arbitrary code, and despite numerous unsafe trapdoors that have crept into Racket since its birth as PLT Scheme, none have ever given the programmer the ability to cheat it.
Yet today, in this blog post, we’re going to do exactly that.
I Built a Lisp Compiler
Malcc is an incremental and ahead-of-time lisp compiler written in C.
This is the story of my progress over the years and what I learned in the process. An alternate title for this post is: “How to Write a Compiler in Ten Years or Less”
A Road to Common Lisp
One disclaimer up front: this is a road to Common Lisp, not the road to Common Lisp. It’s what I followed (without some of the dead ends) and has a lot of my personal opinions baked in, but it is by no means the only way to learn the language.
Typed Racket supports refinement types and dependent function types. Previously an experimental feature, refinement types allow types to describe more interesting properties of values, especially integers.
An Introduction to Urn
These tutorials aim to guide you through Urn, a Lisp dialect which compiles to Lua. We’ll assume you have some prior programming knowledge. A little Lua knowledge is useful in places, though not required.
Numbers and tagged pointers in early Lisp implementations
Let’s take a tour through some early Lisp implementations, and look at how they represented data in general, and numbers in particular.
I wanted to be able to spawn a million threads on a core, to support highly-concurrent I/O servers, and Guile’s POSIX threads are just not the answer. I needed something different, and this article is about the search for and the implementation of that thing.
Some Performance Advantages of Lexical Scope
Somewhat specific to emacs lisp, somewhat generic.
CHIP-8 in Common Lisp: The CPU
In this post and a couple of future ones I’ll walk through all of my CHIP-8 emulator implementation.
Quite a lot of detail and code.
sxc - S-Expression C
sxc is an an s-expression based language source transpiler for C. By providing an S-expression based syntax, sxc adds full Lisp-like macro and code generation capabilities to the C language using Common Lisp.
Faster Elfeed Search Through JIT Byte-code Compilation
In another world we might call this “eval” instead but it does the trick.
Learn you a Lisp in 0 minutes
Probably know more than you think you do. As it happens, my first exposure to scheme was trying to cobble together some gimp automation without learning anything.
Tiny Lisp Computer
It would be much cooler if it really were a wrist mounted lisp machine, as jwz called it, but oh well. If all embedded devices provided an editable environment, we’d be living in a sci-fi movie.