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); } 
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 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.

Comments

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 on …

Millennial guide to living a half life

I'm in a room in a foreign city. The AirBnb stinks because my wife farted. Sometimes she does that when she's hungry. Me too, we fart a lot.
We browse the Internet for food delivery, paralyzed by choices. Do we go out? Do we stay in? Where do we eat? After 30 minutes of deliberation, we just about give up. Unfortunately, we can't eat if all we do is dip our toes.
This isn't just food. This is dating. This is work. This is life. This is our generation's ethos: let's keep our options open, maybe one day we'll get to live a full life experience, but for now we'll stay in the shallow end of the pool.
What would a life look like if all we did was dabble and never got to the good stuff?

How to set up a data warehouse in a day without any code

For a short period of time, I was the Director of User Acquisition for a company called US Mobile. In my eyes, user acquisition requires a huge amount of cross functional visibility in order to get the answers to questions like "how do I spend our budget?" or "where is the growth bottleneck?" At the time, we didn't really have easy ways to get answers to those questions, so we had to solve the problem of getting easy access to data. 
At every company that I've ever worked for (ie. Amazon), the gap between what the engineers can get access to and what the business team can get their hands on is large. There are, of course, vertical specific solutions that tailor themselves to specific demographics. For example, Google Analytics, Mixpanel, and Kissmetrics give a view into website analytics which is great for PMs and marketers. Intercom, Olark, et al. typically have some analytics for customer success. Some of the data is going to be internally in the database.…