Skip to content

Instantly share code, notes, and snippets.

View GalileoCap's full-sized avatar

Galileo Cappella GalileoCap

View GitHub Profile
@GalileoCap
GalileoCap / option.c
Last active April 8, 2025 23:07
Rust's Option<T> and Result<T, E> implemented in C
#include <stdio.h>
#define Option_t(T) struct option__ ## T
#define Option_td(T) \
Option_t(T) { \
char some; \
T value; \
}
@GalileoCap
GalileoCap / code.txt
Created November 28, 2023 09:29
Implementation of Rule110 on D--
SALAD //* S: Machine definitions ***********************************
SALAD // Enable execution
TACOS INIT 0 NUM
SALAD // General registers
TACOS R0 0 NUM
TACOS R1 0 NUM
TACOS R2 0 NUM
SALAD // Return registers, used to pass the label to jump to on return and get the return value