Skip to main content

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); } 
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 Now seem to take a bottom up approach where they map specific expressions to specific implementations. This makes sense since the phone only has so many things it was intended to do.

But I wonder if there's any work being done such that we can "program" computers on the fly using English that is more than a 1:1 mapping from word to action. Very few people write assembly for a multitude of reasons, one of them being, it's hard to out-optimize a compiler. That makes me wonder if compilers would be so good with English that no one wrote C anymore by virtue of the fact that a compiler has a large amount of freedom to optimize.


Popular posts from this blog

How to get 70 job interviews in 17 days

When I was but a wee lad, I dreamed of being a janitor for NASA. There's just something awesome about playing a part, no matter how small, of something that dares to push the world forward. While I no longer hold my old lofty dreams of working for NASA, I have had to recently look for jobs. For whatever contrived reason, the conventional thinking behind how people should search for jobs falls under two categories: networking and job sites. While those approaches work, a very useful metaphor for how you might view yourself is that you're a business. You sell your product (your time) for a salary (your revenue). You might argue, most wages in the western world are $20,000 USD to $500,000 USD. If you're a business, then it's probably also helpful to think about selling your product (time) like a business. Typically, different price points in business dictate different sales and marketing techniques. Below say, $10 a month, direct sales (sales where you sell to people

What marketing might look like in the future

There once lived a wise, middle aged, bald prophet named Marc Andreessen. His job, was to profit from prophecy. Today, he is one of the most well known, and respected, venture capitalists in the world. He is famous for some of his sayings such as "if you want to see where a bubble is forming, follow the MBAs" in reference to the MBAs going to Wall St during the mortgage backed securities crisis of 2008 and the dot com bust in 2002. Arguably, his most famous saying is/was "software is eating the world". Today, it's a foregone conclusion that, software has broken the way a lot of industries fundamentally operate. I think it's particularly interesting, however, to think about what that means for marketing. I'm of the opinion that, very few companies really understand what they're doing and that modern marketing should not only look like engineering... it should be engineering. One way to think about marketing is that there are two key components to ma

Superficial impressions of business in China

I’m walking down a residential street in Tianjin. Food vendors hustle their wares for dirt cheap prices. A whole Peking duck for $3.80 USD? Sign me up for that! As I bring my spoils back to my girlfriend’s apartment, I can’t help but feel like I’m caught back in time while the rest of the country is moving in fast forward.  I’m on my computer looking at valuations of companies in the healthcare/pharmaceutical space. $500M here, $300M there. Whatever your conceptions of speed or size are in the Valley, I assure you, they have nothing on China. The game being played in China is big and aggressive. And Clay Christensen’s “Innovator’s Dilemma”? Nowhere to be found. Alibaba does everything from B2B sales to B2C pharmaceuticals. Big companies just aren’t slow here. What about the startups? Even more fast and furious.  As a foreigner, China is a daunting place. Almost every perception of what you think you know about doing business basically doesn’t really apply here. In the Valley,