Skip to content

Instantly share code, notes, and snippets.

View rocketnia's full-sized avatar

Ross Angle rocketnia

View GitHub Profile
@rocketnia
rocketnia / gist:5555990
Created May 10, 2013 17:30
Demonstration of Era's s-expression reader.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Era reader</title>
</head>
<body>
<script type="text/plain" id="code">
; This example is set up to read only one s-expression, so we surround
; the code in parens.
@rocketnia
rocketnia / gist:6848219
Created October 6, 2013 01:29
Arc code to define places (i.e. getter-setters) with an example definition of 'push.
; Copyright 2013 Ross Angle
;
; This code is released under the
; Perl Foundation's Artistic License 2.0.
; This code is an example for a forum post at
; <http://arclanguage.org/item?id=18051>.
(mac place (p)
(w/uniq new-val
@rocketnia
rocketnia / gist:6944040
Created October 12, 2013 00:20
A test of HTML file inputs
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
#x {
font-family: monospace;
}
@rocketnia
rocketnia / gist:99882fad116e29f54fa2
Last active August 29, 2015 14:07
Linear bunched calculus of structures
rules combined from
https://minerva-access.unimelb.edu.au/bitstream/handle/11343/39480/72729_00002633_01_horsfall-mcs.pdf?sequence=1 ("The Logic of Bunched Implications: A Memoir")
http://www.lix.polytechnique.fr/~lutz/papers/lls.pdf ("A Local System for Linear Logic")
commutative, associative, unit, dual (@ @) [@ @] ; bunched multiplicative implication
C_ (@ @) ---> C_ [@ a, -a @]
C_ (@ A, [@ B, C @] @) ---> C_ [@ B, (@ A, C @) @]
commutative, associative, unit, dual (* *) [* *] ; bunched additive implication, linear multiplicative pair
C_ (* *) ---> C_ (* a, -a *)
C_ (* A, [* B, C *] *) ---> C_ [* B, (* A, C *) *]
@rocketnia
rocketnia / gist:f6585be411b652fa802c
Created March 22, 2015 09:14
Tenerezza paradox with (swap-continuation ...)
; The problem with this isn't the paradox but the fact that the
; paradox is possible to create fully inside a single Tenerezza
; operation.
(swap-continuation original
; We could do the same thing as we do on the other side, but we do
; something simpler. We just send the back-and-forth continuation
; back to itself. This also demonstrates that we don't need
; `original` to be in scope here to produce the paradox (though it
; would be trivial to surround this whole thing with two more
@rocketnia
rocketnia / gist:2bad8c0a3e7eefbb8dae
Last active August 29, 2015 14:22
Nameko Rhythm song lengths
Two of the achievements in Nameko Rhythm are awarded when you've seen
at least 50 and at least 100 King Nameko. To optimize my grinding for
these, I recorded the song lengths:
00:01:44.618 okurahomamikisaa
00:01:43.981 kurobuchika
00:01:50.064 chairo no kobin
00:02:12.087 za entaateinaa
00:02:07.895 yorokobi no uta
00:02:11.999 nameko no uta
@rocketnia
rocketnia / average-lengths.txt
Last active August 29, 2015 14:24
Wouldja Gofer code (@wouldjagofer)
TODO: Fill in the average lengths marked by ???.
{
"origin": ??? [
119+,
???,
???
],
"tweetHomage": 119+ [
@rocketnia
rocketnia / gist:c6ecdc727f0cfbee35a2
Created July 30, 2015 01:20
Limited-memory computation model
An entity can be a pair of entities, with the first being in command of the second's content and execution. For instance, the first can be an imperative computation that only invokes the second computation when (and if!) it finishes. As another example, the first entity can be an interpreter, manually walking over the second entity and updating it. The first entity has exclusive control over the second, except inasmuch as some other entity has control over it. The second cannot even refer to the first except by doing open-ended communication side effects.
All working memory in the system is partitioned into an infinite binary tree, where at each level, the first branch is in command of the second's content and execution. For instance, the first branch can be an imperative computation that only invokes the second computation when (and if!) it finishes. As another example, the first branch can be an interpreter, manually walking over the second branch and simulating it. The first entity has exclusive control o
The 30 NES games I might've picked for the NES Classic Edition, if it were up to me:
Boulder Dash
The Karate Kid
Kirby's Adventure
Krusty's Fun House
Little Nemo: The Dream Master
Lode Runner
Mega Man
Mega Man 2
@rocketnia
rocketnia / gist:e8c2e49dd212431692f0ab0f52ef70ec
Created September 14, 2016 02:17
Type theory with types that coerce
Some of the usual calculus of constructions rules:
Gm |- type A
---
Gm, x : A |- x : A
Gm, x : X |- F : Y
---
Gm |- (\x : X -> F) : (Pi (x : X). Y)