Skip to content

Instantly share code, notes, and snippets.

View AugmentedFifth's full-sized avatar
🍎
apfelschusss

Zachary Comito AugmentedFifth

🍎
apfelschusss
View GitHub Profile
@AugmentedFifth
AugmentedFifth / brouwer.ebnf
Last active August 26, 2017 18:18
Rough working grammar for brouwer, written in extended Backus-Naur form.
(* brouwer *)
program =
[ module declaration ], { import }, { line } ;
module declaration =
"module", identifier, [ ( "exposing" | "hiding" ), identifier, { ",", identifier }, [ "," ] ], newline ;
import =
"import", identifier, [ "as", identifier | ( "exposing" | "hiding" ), identifier, { ",", identifier }, [ "," ] ], newline ;
#![feature(inclusive_range_syntax)]
extern crate fnv;
use fnv::FnvHashMap;
use std::cmp::min;
type Item = (usize, usize, usize);
type Opt = (usize, usize);

W H O M S ' T

Python 3

def fib(n):
    a, b = 0, 1
    for _ in range(n):
        a, b = b, a + b

chapter 8: bytecode format

mnemonic args stack mnemonic explanation semantics
nop - - no operation Does nothing.
@AugmentedFifth
AugmentedFifth / technical-description-0.md
Last active July 9, 2018 02:44
CPU Caches and Some Design Considerations Thereof

CPU Caches and Some Design Considerations Thereof

A "cache" is, in general, any structure that keeps the results of processes/computations for easy access later on. The idea is that any time a given result is required in the future, a quick and efficient lookup from the cache serves as a replacement for doing the whole (potentially expensive) process/computation over again, just to get the same result. A simple example of this is the memorization of times tables. Knowing that 12 times 12 is 144 virtually instantly is useful and worth the memorization effort, compared to requiring someone to recalculate every time, even for (commonly used) small

@AugmentedFifth
AugmentedFifth / instructions-0.md
Created July 15, 2018 02:56
Writing Polyphonic Music Using Basic Species Counterpoint

Writing Polyphonic Music Using Basic Species Counterpoint

This set of instructions will aid in writing two-voice polyphonic music from scratch using a simplified and modernized version of Fux's classic early-18th-century rules for species counterpoint. The only requirements are that the reader be competent enough with sheet music to read it and write it (even if slowly), and that the reader know basic musical terminology such as the names for intervals (major third, perfect fifth, etc.).

Writing species counterpoint serves as a technical exercise that helps to