Skip to content

Instantly share code, notes, and snippets.

#![feature(min_const_generics)]
use std::ops;
#[derive(Debug)]
struct Matrix<T, const W: usize, const H: usize>([[T; W]; H]);
impl<T, const W: usize, const H: usize> Matrix<T, W, H>
where
T: Copy + Default,
@SebastiaanYN
SebastiaanYN / brainfuck.s
Last active September 17, 2021 13:22
Brainfuck JIT written in Assembly
# Brainfuck JIT
#
# The brainfuck code is directly compiled to machine code.
# In the machine code, the register r13 is used to store the cell index.
.global brainfuck
# Uncomment to write the JIT code to a file
.equ DEBUG, 1
@SebastiaanYN
SebastiaanYN / js-multi-inheritance.ts
Last active November 11, 2019 16:26 — forked from junlarsen/js-multi-inheritance.ts
Implementation of multi inheritance output for a transpiler in JS
interface Parents {
[parent: string]: Class;
}
abstract class Class {
$child?: Class;
readonly $parents: Parents;
constructor($parents: Parents) {