Spivee's Works

Here is a hierarchical list of software projects I have designed or worked on. The source code is hosted on my GitHub, but I will start porting design documents from there to this site, and might start hosting my Git repositories here as well.

City Simulation

City simulation is something that I have been trying to do since I was about fourteen years old, designing and redesigning the same program every few years. The program is meant to be highly data driven, and so naturally as a teenager my attempts to implement this thing used to degenerate into general purpose programming languages (see below). In 2020 I made some great realizations about what the program is really about, and started working on a prototype that actually displays entities doing things! This project is available on GitHub, and so far the bulk of my Twitter content has taken the form of poorly recorded GIFs of this project in action.

The program is written to compile with Tiny C Compiler, using Vulkan and GLFW for a nice, simple development environment while I'm learning how these low level things work. For fun I use integers/fixed point arithmetic for everything CPU side, right up until vertex/command-buffer generation.

Past attempts, in reverse chronological order:

Tactical Game

Ever since playing Frozen Synapse by Mode 7, I have wanted a multiplayer tactical game with no turn timers, where the game is interrupted as soon as either player experiences something unexpected, allowing for both players to play the ultimate game of tactical, multiplayer SUPERHOT. In the December of 2018 I implemented the most basic version of this using Rust and Piston, with source code available on GitHub. It is such an obvious design, and took a weekend to implement, I can only assume Mode 7 didn't do it this way because it seemed harder to design for. This is a shame because it means the Frozen Synapse we know is ultimately rock paper scissors with extra steps. This game concept would still be amazing to explore, and maybe I should pick it up again, seeing as it would probably be more profitable than my city simulation idea.

More Circles and Squares

In addition to the various circle-and-square prototypes that I have made for my city simulation and tactical goals, I also made a playable game during a local game jam in 2019. The source code is also available on GitHub, another Rust/Vulkan game with no text and a single render pass. The game has a very simple design, and it's kind of interesting to work out how to achieve the gradually more subtle game states possible within the game. Game jams are fun, and sure, making something quickly is interesting, but I much prefer my big ambitious city simulation ideas.

Numerical Approximations

Being interested in fixed point arithmetic, I lose access to traditional math libraries. Most math algorithms are quite straight forward and would port easily to a fixed point system, but being interested in mathematics I would like to implement the Remez algorithm, in order to find polynomial approximations for any function I like. I have not done this but I have started it here, where I have also implemented arctan, logb, arcsin, and arccos, based on a method I worked out which is a simple generalization of the standard binary logarithm algorithm. These implementations all give arbitrary accuracy, filling an array of integers with as many bits as you like. I plan to invert these functions using the bisection method, and then of course find polynomials to approximate all of these functions and their inverses using the Remez algorithm.

Experimental Programming Languages

I have a lot of concepts for language ideas floating around. My interest in languages has declined a lot since I realized that C99 is the best programming languages there is, but the academic aspects of these languages are still kind of interesting.

The main language that I actually implemented was a type checker/symbolic evaluator for a dependently typed programming languag/proof checker that I called lofer. The design was focussed on impredicative/Church encoded data, with postulates, and plans for special type checking rules, allowing one to add more sophisticated functionality. The readme on GitHub has some code samples that might demonstrate better what that means, but dependent types are a mess so I still wouldn't recommend reading it.

The other language I sometimes think about working on is a low level language designed to experiment with alternatives to the l-values and r-values of C, with anonymous data types and subtyping, and maybe also with some more advanced type checking inspired by dependently typed languages, which might allow one to express and check constraints that can't be expressed in languages like Rust. In 2019 I started an interpretor in Rust, and then an llvm frontend in C. There's a lot of features that I could make for this, potentially inserting all of Lofer as a compile-time module system the way ML does, and with appropriate command line arguments this could really evolve into a whole family of separate programming languages. Unfortunately all of them would be purely aesthetically/academically motivated, and so not really worth the effort.

One of my attempts at implementing a city simulation let to an interesting interpretted, object oriented language idea with a system of interfaces/abstract classes/traits that would allow for multiple implementations by the same base data type. I never actually implemented type checking in this language, and of course this language lost all of its appeal once I discovered the glory of simple C programs. Multiple implementations of an abstract class is a feature that exists for free in dependently typed languages, so if Object Oriented Programming had any merit at all, then this innovation on the paradigm would be quite valuable I think.

Another language idea that is aesthetically pleasing to me, but with no clear advantage to using or making, is just a referentially transparent language that isn't afraid of imperative style, but is afraid of mutation of aliased data. Essentially an interpretted/memory managed Rust type language, with no borrow checker, just pure functional programming without recursion or higher order functions. If you started to put pool-based memory management back in then you could even make something that compiles natively, or runs as the compile time of a procedural language.