Skip to content

Instantly share code, notes, and snippets.

View nmcb's full-sized avatar

nmc.borst nmcb

View GitHub Profile
@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) {
@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 / 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 / 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 16:08
no as in; no it is not ’sufficient’ for the method
to be a primitively recursive function? currently
[i see as `sufficient` for tail call optimisition]:
1) [the recursive method being] final
2) [recursive calls in the implementation being in] tail position.
paulp 16:46
What makes you think there is a link between
@nmcb
nmcb / Emitter.scala
Created March 16, 2016 01:32
Emitter Monad
import Emitter._
import scala.annotation.tailrec
import scala.concurrent.Future._
import scala.concurrent.{ExecutionContext, Future}
object Emitter {
type Event[A] = Future[Option[(A, Emitter[A])]]
case object Zero extends Emitter[Nothing] {

Shared at twitter: 2016-03-29

  • 01/19 So true, almost feel guilty right now. Have been silent about this during the lambdaconf twitter storm for too long
  • 02/19 Reason: I totally can see Yarvin's added value when sharing his thoughts about Urbit. Independent of his alter ego Moldbug.
  • 03/19 But: I am scared that it is a vulnarable position should the "group" decide it to be a-moral.
  • 04/19 Do I agree with Moldbug? I don't know. Am I afraid of Moldbugs memes? Absolutely. Do I respect Yarvin's computing science work. You bet!
  • 05/19 Am I superstitious when I think that Yarvin's communication will "leak" Moldbug's memes? I hope so. But talking about the content:
  • 06/19 If I had the money, the time, the CS background to understand, I would want to know more about his Urbit thoughts.
  • 07/19 I would go to lambdaconf...
  • 08/19 I have non of those three, I'll still watch the youtube video. A 100 times probably.
~ ∴ rm -rf bar/
~ ∴ activator new bar play-swagger-service
Fetching the latest list of templates...
OK, application "bar" is being created using the "play-swagger-service" template.
No activator-launch-*.jar in /usr/local/Cellar/typesafe-activator/1.3.7/libexec/libexec
No activator-launch-*.jar in /usr/local/Cellar/typesafe-activator/1.3.7/libexec/libexec
To run "bar" from the command line, "cd bar" then:
sealed trait State
final class Start extends State
final class Step1 extends State
final class Step2 extends State
final class Stop extends State
trait Request
case class Req1(s: String) extends Request
case class Req2(s: String) extends Request
2016-05-31, from memory.
Your edit did remind me about an account by Ron Kersic though, a former
colleague of me at CapGemini in 2003. Kersic was a student of Edsger Wybe
Dijkstra in Houston, TX. I'll tell you his story, not because there is
some intrinsic lesson to be taken from it, just caring through sharing,
nothing more nor less.
Around 1995, Ron Kersic, who studied CS at the the Technical University of
Eindhoven, decided that he would try to graduate under E.W. Dijkstra's