Skip to main content

Posts

Showing posts from 2013

Code = f(English)

From a philosophical standpoint, I feel like the crux of programming for performance is mapping concrete expressions of logic to a performant implementation. Programming languages are inherently very rigid expressions, yet compilers find a way to interpret the same expressions into a multitude of implementations. Intuitively the more ambiguous/more high level the expression of logic is, the more room the compiler has to optimize. For example, a loop may be unrolled from:
for (int i=0; i<3; ++i) { do_something(i); } to:
do_something(0); do_something(1); do_something(2); If do_something() is an independent operation, we may distribute them onto separate cores for ideally a 3x performance gain.
In theory, the highest level expression of logic would be English, going down we'd have Python/Ruby, C, and so on. However, there's a HUGE jump between Python and English. English is ambiguous, Python is not. To make that jump, you'd have to have some means of inferring. Siri/Google No…