The easy news at South by Southwest yesterday was that Instagram has reached 27 million users and has indeed built the expected Android version. The hard news is that it may have wasted lots of time and effort along the way.
In a talk today entitled "Computation and Its Impact on the Future", Stephen Wolfram took a rapt audience on a tour of Wolfram Alpha and the Mathematica kernel that underlies it. To demonstrate Mathematica's capabilities, he wrote some software right in front of us to upload and filter photos. It took 10 seconds and two lines of code.
Wolfram's goal developing Mathematica was to make the easiest programming language in the world to learn and use. He began designing it by thinking about the kinds of queries people ask about the world around them. The basic primitives of the language are fundamental mathematical and scientific concepts.
It's designed for its different components to easily share data and operations with each other. It also knows how to select the best algorithm it has for the user's particular problem. That's how Wolfram Alpha can understand natural language and turn a human question into a tailor-made program on the fly.
Photo filters like Instagram's are almost like native capabilities for Mathematica. "There's tons of stuff in image processing that uses graph theory and linear programming and all kinds of things," Wolfram explained to me after his presentation. "Those things are just sort of free for us. Whereas if somebody else is writing this specialized image processing system, they've got to send some engineer off for a year to create these things."
And Mathematica is lighter than recent, trendier languages, too. Wolfram explains: "Because we started building Mathematica in 1986, when memory was extremely expensive, we've had an engineering discipline that's meant that we've kept things like the memory footprint quite small. The Mathematica kernel is probably 100 megabytes, which is quite modest by modern standards. And its working space can be quite small for doing quite sophisticated things."
So why are so many companies working so hard to invent their own solutions?
"I think it's kind of bizarre, frankly," Wolfram says. "While [some developers] are using Mathematica in their software, so many commercially available applications are reinventing the wheel unnecessarily."
"There is a thought, which is, 'Gosh, we've got a specific problem to solve. Let's use a special-purpose system that was just designed for that specific thing.' That's actually really wrong thinking."
"Or maybe they use some library that they've found for doing it, but then they rely on the fact that the library works they way they think it does, they have to build all this glue code and so on."
"I think the ability to have Mathematica embedded in other applications, which we're working towards from a technology deployment point of view this year, that will make it dramatically easier to do things like make photo filters. Because yes, it's completely nuts."
"When you're using Mathematica to design these things, it only takes a few seconds to get a new photo filter set up. Or, more to the point, you can write a program that just enumerates thousands of photo filters, look at the results and pick out the ones you like. It's a much more efficient way to work on things."
Fortunately, Wolfram is working on making it "dead-easy" to deploy Mathematica in existing apps. So rather than reinventing the wheel, app developers will be able to use Mathematica's foundation of real-world scientific functions instead of inventing abstractions out of whole cloth or patching them together from other libraries.