Skip to content

Instantly share code, notes, and snippets.

💜
GitHub seems like the wrong place to put a status?

Cassie Jones porglezomp

💜
GitHub seems like the wrong place to put a status?
Block or report user

Report or block porglezomp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@porglezomp
porglezomp / 00 add baseline
Created Dec 14, 2018
Eggman Scheme Bytecode Examples
View 00 add baseline
function (+ a b) entry=bb0
bb0:
v0 = lookup 'assert
v1 = typeof v0
v2 = Binop.SYM_EQ v1 'function
brn v2 non_function
v3 = arity v0
v4 = Binop.NUM_EQ v3 1
brn v4 wrong_arity
v5 = lookup 'number?
View about.md

An Allocator

This is a working memory allocator for C++! It was written as test code for an operating systems class project, we were implementing a virtual memroy system, and so I built an allocator on top of that. To work, it needs access to a vm_map call which will return a fresh 4KB page, and it needs to return consecutive addresses for consecutive calls (at least most of the time, or else we can't allocate large blocks).

It is based on a linear search through a free list, with a best-fit allocation scheme.

View SketchSystems.spec
# Memory Eviction
Start*
swap page -> NoRW
file page -> NoRW
NoRW
read -> Read
write -> ReadWrite
queue -> Start
@porglezomp
porglezomp / bowser.txt
Last active Oct 3, 2018
pictures of bowser and others
View bowser.txt
Bowser:
https://twitter.com/ayyk92/status/1042465252221181954
https://twitter.com/GurepyonArt/status/1044287471226441729
https://twitter.com/Matilda_Fiship/status/1044311156930818049
https://twitter.com/spacegarbage/status/1044332916929712133
https://twitter.com/Pan_Neji/status/1044212272346918912
https://twitter.com/barachan/status/1044326502228275200
https://twitter.com/iDoodlerz/status/1044302585790959616
https://twitter.com/ZA1F0N/status/1044268102005874689
https://twitter.com/lazymimium/status/1044001136636825601
@porglezomp
porglezomp / passdiff.py
Last active Sep 7, 2018
View LLVM optimizer pass diffs, inspired by John Regehr's blog post https://blog.regehr.org/archives/1603
View passdiff.py
import sys
import subprocess
import tempfile
if len(sys.argv) < 2:
print(f"Usage: {sys.argv[0]} <llvm args...>")
sys.exit(1)
script = sys.argv[1:]
result = subprocess.run(
@porglezomp
porglezomp / About.md
Last active Aug 30, 2018
Proving reverse correct with Idris, following the challenge at https://twitter.com/arntzenius/status/1034919539467677696
View About.md

Proving About reverse in Idris

I saw a challenge on Twitter from @arntzenius, in response to some discussion about the limits of dependent types.

Hey Agda fans! In the spirit of @Hillelogram's verification challenges: How would you prove that reversing an ascending list produces a descending one?

(Also accepting answers in other languages/systems.)

@porglezomp
porglezomp / Turing.idr
Last active Aug 14, 2018
A constructive proof that Idris is Turing complete.
View Turing.idr
%default total
data Direction = L | R
record Machine state halt alphabet where
constructor MkMachine
initial : state
transition : state -> Maybe alphabet -> Maybe (Either halt state, Maybe alphabet, Direction)
data Tape : (a : Type) -> Type where
View animalcrossing.js
// ==UserScript==
// @name Animal Crossing Twitter Rating
// @description Display the rating of tweets using the Animal Crossing letter rating system
// @version 1
// @grant none
// @include https://twitter.com/*
// ==/UserScript==
// Notes via https://twitter.com/jamchamb_/status/1025977659522789376
@porglezomp
porglezomp / errorulp.rs
Created Jul 19, 2018
Sin/Cos error ULPs
View errorulp.rs
//
// Sin functions
//
const S1: f64 = -0.166666666416265235595; /* -0x15555554cbac77.0p-55 */
const S2: f64 = 0.0083333293858894631756; /* 0x111110896efbb2.0p-59 */
const S3: f64 = -0.000198393348360966317347; /* -0x1a00f9e2cae774.0p-65 */
const S4: f64 = 0.0000027183114939898219064; /* 0x16cd878c3b46a7.0p-71 */
pub fn k_sinf(x: f64) -> f32 {
let z = x * x;
View joke.md

Making the same joke, over and over.

  • lattice minimum/maximum elements
  • function domains
  • secondary headings/titles
  • html subscripts
  • nintendo's newest console
  • nontermination
  • FRC 2018 field elements
  • compiler control flow graph analysis
You can’t perform that action at this time.