Just realized that I hadn’t put last week’s Message from the CTO up as a post. Maybe it was because I was so excited that we’d managed to record it as a video! (And, yes, there are now several videos in the pipeline…)
Back in the days of yore, pre-Internet, you knew where you stood with compilers. You'd write some code in some quasi-mathematical English, and then you'd let loose a compiler on it to produce a nice object file containing machine code that you then linked with other obj files into a program. Easy, huh?
That must have been some time ago -- I'm showing my age here -- because we've had interpreters for a while where the code gets compiled on the fly into macro instructions that a state machine can execute. We've even had compilers that produce some kind of intermediate language that gets executed by a run-time virtual machine, which is after all a glorified state machine.
You can watch the video here.
For fun, here’s the CoffeeScript code we showed in the video:
wrap = (originalHandler) ->
(event, pos, item) ->
dataPoint = item.series.data[item.dataIndex]
originalHandler.call this, event, pos, item if dataPoint
It’s the equivalent of the last bit of code from this recent blog post of mine.