Skip to content

Instantly share code, notes, and snippets.

View nmcb's full-sized avatar

nmc.borst nmcb

View GitHub Profile
@nmcb
nmcb / trampolined-ackermann discussion
Last active February 27, 2016 01:08
letter to scala contributors about a minor mathematical impedance mismatch concerning recursive functions.
@SethTisue @pfn @paulp @retronym
I'm back online after a 4 hour train travel and had the opportunity to contemplate the conversational
session on scala/scala about whether it is possible in principle to implement the ackermann function
by "just typing in it's recursive definition in scala" [1], i.e. without applying some mental
translation from the mathematical definition into the scala language, and without applying some scala
library construct, and without me writing a trampoline for some part of the recursive definition for
that matter.
My current understanding is that this is _not_ possible, but would be happy to be proven wrong. I know
@nmcb
nmcb / oddity.txt
Created February 18, 2016 14:48 — forked from paulp/oddity.txt
Whitespace Oddity
WHITESPACE ODDITY
by Paul Phillips, in eternal admiration of David Bowie, RIP
Bound Ctrl to Major mode
Bound Ctrl to Major mode
Read inputrc and set extdebug on
Bound Ctrl to Major mode (Ten, Nine, Eight, Seven, Six)
Connecting readline, options on (Five, Four, Three)
Check the syntax, may terminfo be with you (Two, One, Exec)
@nmcb
nmcb / latency.txt
Created October 27, 2015 02:00 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@nmcb
nmcb / naming.scala
Last active October 26, 2015 15:25
typed names
object naming {
object dsl {
import scala.language.implicitConversions
implicit def pathNameToNameOps(name: PathName): PathNameDsl = new PathNameDsl(name)
implicit def verbNameToNameOps(name: VerbName): VerbNameDsl = new VerbNameDsl(name)
implicit def typeNameToNameOps(name: TypeName): TypeNameDsl = new TypeNameDsl(name)
class PathNameDsl(val path: PathName) {