Notes from the Jane Street talk

Notes about the tech talk given by Jane Street (http://www.cs.brown.edu/events/talks/janestreet.2.html)

Basic idea: make asynchronous, event driven programming easier to write. Multi-stage computations, in a traditional event-driven style, requires the programmer to explicitly represent the stages as part of the program state. This can lead to an “inversion-of-control” issue in traditional event-driven programs. If I have a program that looks like:

  • do some work
  • call to the network
  • wait till the network call resolves
  • do some other work

then a traditional event driven model requires the “do some other work” entry point to have some kind of representation in the program. Something naturally expressed as a single sequence becomes a bunch of shorter, chunked functions, and the toplevel event loop needs to dispatch to them.

Jane Street’s approach is to use their Async library to handle this gruntwork. Their approach, in retrospect, is very similar to that of PLT Web server’s send/suspend: it provides a mechanism for linguistically representing the blocking chunks of computation, and let the event loop handle the instruction threading from one stage to the next.

In Jane Street’s case with their async library, they use a Deferred type, and write code in monadic style. Monads are their mechanism for representing what happens next, after a blocking call returns. The event loop handles the appropriate state-threading from one phase to the next.

The essence of the approach is that the programmer is writing in continuation-passing-style. The server manages these continuations and invokes them when each blocking call resumes. One of the things that the Async library does is to make the syntax for writing in CPS easy to express. And the CPS parts are only around blocking parts, so rest of the code doesn’t have to look unnatural.

This style seems to easily account for sequential, blocking computations. It doesn’t directly account for situations where you need branches of computations. e.g. I do ten requests to the network, but when five come back, I want to continue the computation. It doesn’t appear to be easy to naturally express this without some additional primitives, and what the Async library provides (choose, or choice?) sounds like it doesn’t handle this case with particular ease.

A release of Racket

Racket 5.1.2 came out recently, and I’ve been pretty happy using it so far. It feels significantly snappier than 5.1.1. It also looks like some of the graphical quirks I saw in DrRacket running under xmonad are fixed.

Documentation still needs some work, according to folks on Reddit. Although Racket has a lot of good reference documentation and quite a few tutorials, the meaty libraries like the FFI are missing the kind of treatment that the Guide provides for the basic language.

Lots of work to do!

Buying internet service

So I went to buy a new internet cable modem from the local service provider here. The store had an air of sterility to it, the kind of soulless air that fills electronics stores like Best Buy and Fry’s Electronics.

Within the first minute or so, the salesperson was already trying to sell me a wireless router.

“No, I don’t need one; I’ve got one already,” I said.

We continued the transaction; he handed over the modem. I asked, “So I can plug this into my roommate’s router and everything will work, right?”

“Do you have the original installation disks?” he asked.

“Errr, no?” Why was he asking about that?

“Oh! Then you need to buy our wireless router!” he quickly interjected.

Holy wow. The salesperson was pushing the router hard. I got out of there as quickly as I could.

shimmer

One of my favorite companies is trying to kill my active area of research and personal interest. When Apple engages to hurt children, when they enforce a discriminatory and irrational policy, then they’ve crossed a terrible line. I’ve listened to the counterarguments, but I can only conclude that what they’re doing here is morally wrong.

The iPhone has lost its shimmer for me. Time for a new phone.

consistency

There’s so much work that I have to do, and I’ve realized that one of my personal failings is not necessarily the understanding of hard stuff. Rather, it’s getting the easy stuff even started.

It’s a main point of Better: performance isn’t about the shiny tools: it is more about the “gruntwork”. It’s the mundane task of being consistent, of staying on target, with which I struggle and flounder about like a floppy fish. My failure to do better isn’t for lack of technical tools or skills: what I’m missing is consistency. Adults should have the firmness of mind to do something even if there are no immediate results. But my mind is still mushy and squishy. It has the consistency of oatmeal.

turing

The thing that struck me about the Turing Test, when I heard about it, was the crazy thought: how do I know that other people are anything like me? If we can’t even judge faithfully between ourselves, how can we judge between humans and computers? For I can do nothing but observe reactions, the effect of my actions on others. I can’t read people’s minds: they could, for all I know, run entirely different mental software. Everyone is, in some sense, a black box.

The act of empathy, then, is a little presumptuous and magical: I trust that we can share an understanding with each other, with the assumption that because I share a similar hardware architecture with you, that there’s a very strong chance that I share the same kinds of thoughts and values too. I think that’s why we put so much emphasis on physical bodies. If someone looks different, I may fear them: they don’t look like me, and so they might be thinking in an entirely different way. We all know the dilemma of the Turing Test deep in our bones, and we cheat a little (or a lot) by using irrelevant physical similarities in our judgements of one another.

I suppose I could be silly and wry and conclude that this is why women are mysterious and terrifying to me.

But I think that there’s something there that deserves more serious thinking.