I'm not sure what WolframAlpha exactly does, but Stephen Wolfram's post about it definitely has my ears all perked up for its launch ... which should be any time soon.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I don't see how this is

I don't see how this is relevant for LtU.

Probably this: "All one

Probably this:

"All one needs to be able to do is to take questions people ask in natural language, and represent them in a precise form that fits into the computations one can do."


I've so far not understood *why* Mathematica is superior to every other language around (as - at least by implication - claimed by Wolfram). This might be a chance to find out, since I think the engine is bound to use Mathematica language in some way. The fact that you can "compute" your questions via the search-like box definitely has language consequences worth watching.

Is there any concrete

Is there any concrete argument about Mathematica as compared to other programming languages, that is new or enlightening, in this announcement?

Not in this announcement ... at least not yet

Wolfram's claims have always been controversial to some extent (see The Man Who Cracked The Code to Everything ... about his book A New Kind of Science). So it is difficult to say that there is something enlightening there, particularly before its release, but his ideas always brought something fresh to the fields they touch (imo) and he claims Wolfram|Alpha tops Mathematica and NKS as his achievements :)

The mathematica language has been around for long, but very little attention (imo) has been given to it from the programming languages community. Fundamentally, the language itself hasn't changed much in several years, but I must say the set of concepts in it make it incredibly expressive (as in "compact, precise and readable").

If you're still doubtful of

If you're still doubtful of the PLT relevance, it's worth checking out some of these screenshots (there are 20 or so). It gives a flavour of what the web should be one day, an interactive programming experience, like a super-duper spreadsheet on steroids.

My issue is that there is no

My issue is that there is no technical (PLT related) information that is worth discussing. If there is, by all means let us know where to find it!

wolfram/alpha is plt appropriate (?)

Here is an ambiguous program in an unspecified language: "Boston Red Sox hits".

The compiler is pre-programmed to link any compiled form of this ambiguous program with some libraries that contain various statistics about the Boston Red Sox.

So, what kind of programming language handles that?

The one before us for consideration (W/A) treats it as a search problem with interactive feedback from users and weak-AI-style optimization of search results based on the aggregated feedback from users. What precendent is there for that and what techniques are known? What implications are there for the future of programming?



Although the line between programmer and user can get fuzzy, I would think that "Boston Red Sox hits" would be classified as an input to a program, rather than a program itself. From a PL perspective the interest in queries as a language would lie in the syntactic and semantic rules for a query that allow abstraction and means of combination. I can ask google the same question, and it gives me some useful information as well. (Google comes up with results that are probably as useful as alpha).

If I rephrased the question to "Top forty hits", I would think Alpha would switch contexts and likely give me a totally different type of answer (popular song list). So, the question is how I would go about building a generalized notion of "X hits"? And beyond reading the 5 million lines of Mathematica that went into building the query engine, how would I go about predicting the results for any query without guess or trying to reverse engineer it from the results?

Anyhow, I would think Ehud's objection is not so much whether we can classify Alpha as a programming language, but rather discussing it as a programming language is rather futile at this point given the dirth of material that can not be classified as promotional/marketing driven.

it's programming in the sense

It's programming in the sense that "boston red sox hits" gets translated into multiple programs run over the curated data sets. The programs are ranked in terms of estimated likelihood that the translation reflects the interests of the query maker. Future versions of W|A, if there are any, will likely let users drill down more -- as in saying "Ok, I pick this translation from the list offered but I want to refine that a bit...."


p.s.: I understand and agree with Ehud's objection at least to the extent that it is as you characterize it. I'm telling you what I see and I've been saying the same thing in various forums where I'm confident the W|A crew has noticed my guess and is free to speak up if I'm wrong.

PLs are involved at some level

Definitely Mathematica is heavily involved in Alpha itself. But I just don't see how the UI presents a PL shell. Going back to SICP, we have:

A powerful programming language is more than just a means for instructing a computer to perform tasks. The language also serves as a framework within which we organize our ideas about processes. Thus, when we describe a language, we should pay particular attention to the means that the language provides for combining simple ideas to form more complex ideas. Every powerful language has three mechanisms for accomplishing this:

  • primitive expressions, which represent the simplest entities the language is concerned with,
  • means of combination, by which compound elements are built from simpler ones, and
  • means of abstraction, by which compound elements can be named and manipulated as units.
So, I can see how the UI presents us with a method of entering expressions, but I don't see how you get combinations and abstractions.

at least "means of

at least "means of combinations", even if no abstraction facility is available. That would make it a not-so-powerful programming language, but at least put it in the category of RPL.

Thanks, Chris. That's was

Thanks, Chris. That's was my point.

since it is out ...

There are even parsing issues with the box!

I tried the query "life expectancy japan year 1990" and got 83.1 years as the answer. Now I can't compose these calculations! I tried -

  1. life expectancy japan year 1990 / 1980
  2. life expectancy japan year 1990 / year 1980
  3. life expectancy japan year 1990 / life expectancy japan year 1980
  4. ratio of life expectancy japan year 1990 to year 1980

none of them work, though the intent is fairly clear to a reader. How would one parse, say, query 2 in my list and interpret it as two calculations to be combined using division?

Somehow, this example (i.e. Wolfram|Alpha) makes me feel like one should either have a formal language or an AI-class natural language engine, but the in-between stuff doesn't cut it.

WA is awesome with math though, naturally.

PLs and DWIM

Wolfram Alpha may or may not prove to be a particularly useful tool, but I think this demonstrates why it's not really PL. PL's are predictable and compositional.

I don't think that the intention of 1 is at all clear, though. 2 is arguable, though the 3rd and 4th examples are fine, in my opinion.

And this seems to bring us to the joys of DWIM.

informal programming ..

A while ago, on this thread there was mention of "informal languages". I have a feeling WA needs to re-orient away from "natural language" and towards "informal programming language" - i.e. provide some composition capabilities while allowing flexible expression syntax.


So, WA not surprisingly does nice plots of functions. You write "tanh x" and get the plot. Now suppose I want to say "tanh bx for b=0.1, 0.2" . Can this be done?


plot tanh(bx) from b = 0.1 to 0.2

.. gets you what you want I guess.

Not quite?

I don't think that's quite what Ehud wanted; my interpretation was that he wanted a graph of tanh(0.1x) overlaid on top of a graph of tan(0.2x).


plot tanh(bx) from b = 0.1 to 0.2 step 0.1

doesn't do it... ;-)

Right, that's what I meant.

Right, that's what I meant.

tanh(0.1x) | tanh(0.2x)

does it, I think.

[Sorry for the second post. Stalling UMTS connection.]

Thanks, good to know (though

Thanks, good to know (though it is amusing that it doesn't show labels on the graph so you are left guessing which of the two graphs is which, in case you don't know already...)

The points of the exercise, of course, are (a) that WA doesn't have magical understanding, but rather conventional grammar (Mathematica) (b) composition is not a trivial matter (for example, I am still not sure how to achieve this effect when the function to be plotted is presented in parametric form tanh bx). (c) can't remember what c was supposed to be... it'll come back to me, I'm sure.

I deleted marco's duplicate

I deleted marco's duplicate post and inadvertently deleted a reply that was attached to it. I apologize for the mistake. Please repost.

Not so much parsing issues...

Actually, this is not a parse problem but a back-end data problem. Both of the facts that you are referencing are there, and it does know what computation you are asking for, but the result returned is "insufficient information"... not "alpha doesn't know what to do with your input" (which is the error you get on a parse problem).

The problem seems to be the years involved, as "life expectancy US divided by life expectancy japan" works just fine, but "(life expectancy US 1980) / (life expectancy japan 1990)" while well formed claims to be missing data for japan. It is clearly not missing any data, as both of the sub-queries work fine on their own.

I would not say that this is any deficiency in the language engine, but a *BUG* in the structural data which should be reported to Wolfram. So far their response time on these sorts of reports seems to be under 12 hours, judging from watching their "community" site where such problems are being reported since launch.

Almost all informational

Almost all informational material propagated by humans is promotional/marketing driven; academic papers are a long, long way from the least offenders in this category.


But the target market for Alpha is not PL enthusiasts (at least at the current time), so there is likely little of interest to us here on LtU. Perhaps more technical material will be available for our consideration (consumption) at a later stage, giving details of how PLs informed Alpha design and/or user interface. But for now, the demand for information has exceeded supply, and we are left as pure speculators in a market that may never emerge.

Attribute Grammars (maybe on Finite Lattices)

The one before us for consideration (W/A) treats it as a search problem with interactive feedback from users and weak-AI-style optimization of search results based on the aggregated feedback from users.
What precendent is there for that and what techniques are known?

A simplified grammar of English could handle multiple syntax, the finite lattices could compute the results, or queries.

I think it is relevant...

There is some PLT to Wolfram/Alpha. The confusion in the top post of what exactly it is is widespread. I've no insider knowledge but have been following the story. So here is how I think it can be demystified and why there are PLT items of interest:

The system appears to be a layered architecture.

At the lowest layer, data-sets of general interest are loaded into a varient of mathematica and a library is built-up to visualize and explore those data sets in obvious ways.

In the middle layer is a kind of variant of a prolog compiler: abstract propositions go in - the compiler generates a list of possible translations into mathematica code, sorted by "relevance" heuristics - when run, each mathematica translation generates a possible binding for the free variables.

On the top layer is a kind of ad hoc NLP translator from what people type into the search box to what goes into the "prolog" compiler.

So there are three programming languages central to the thing: (1) the approximation of natural language that the query box accepts (2) the langauge that translates the abstract syntax trees of that natural language into various possible mathematica programs, sorted by heuristics of relevance; (3) mathematica itself.



I think the notion of taking an ambiguous program that resembles an ad hoc search query and using heuristics and a basic inference engine to translate it into multiple possible programs, ranked by a guess at "relevance" - is deep. The computer is guessing what program you meant to write and offering up its best guesses as search results - that's interesting.

Thanks for that explanation!

Thanks for that explanation! The multiple program generation is something that is totally new to me.

Its alive.

Wolfram|Alpha is now live btw.