Slashdot Mirror


Wolfram Language Demo Impresses

theodp writes "The devil will be in the details, but if you were stoked about last November's announcement of the Wolfram programming language, you'll be pleased to know that a just-released dry-but-insanely-great demo delivered by Stephen Wolfram does not disappoint. Even if you're not in love with the syntax or are a FOSS devotee, you'll find it hard not to be impressed by Wolfram's 4-line solution to a traveling salesman tour of the capitals of Western Europe, 6-line camera-capture-to-image-manipulation demo, or 2-line web crawling and data visualization example. And that's just for starters. So, start your Raspberry Pi engines, kids!"

33 of 216 comments (clear)

  1. mathematica? by goombah99 · · Score: 3, Insightful

    This looks a lot like Mathematica. When does something become programming language? Wasn't mathematica a programming language too?

    --
    Some drink at the fountain of knowledge. Others just gargle.
    1. Re:mathematica? by MightyYar · · Score: 4, Informative

      It looks like Mathematica because Mathematica implements this language and is where it comes from. Historically the language developed ad hoc and now they have made an effort to standardize it into a "language".

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
    2. Re:mathematica? by goombah99 · · Score: 5, Informative

      I first looked at the examples given in the article and said "harrumph this is mathematica". But then I watched his demo and I see what he's getting at. You could say this is just a really nice library but it's way more than the sum of it's parts. I think he's using the term Language not in the sense of "programming language", but rather in the sense that every real world speaking language like english, spanish contains an intrinsic model of the world itself and every part of a spoken language can be coupled to every other part. That is speaking has no incompatible interface between ideas does it? That question would never occur to you, but of course we have that problem with every programming library API.

      SO he's talking about a Language for programming as much as a programming language. His accomplishment is to make a language of programming a programming language.

      One of the great tricks he accomplishes is to combine symbolic programming and functional programming. I was somewhat surprised to notice that reactive programming actually falls out of that by accident. There's been a lot of spamvertising articles on Slashdot lately about the dogs dinner versions of Reactive programming for databases. Those are toys. Wolfram gets it right by not making it just fall out accidentally of two greater programming principles.

      Decades ago I toyed with mathematica. The problem I had with is it was that the symbolics were nice but they let you easily create problems with permutations so large that it became incomprehensibly slow as your problem scaled. This if course was the users fault. I'm just saying that the power of the language gave me the power to be stupid. In a similar way APL with it's outerproducts instead of loops could easily use up all your computer memory in one command line without you even appreciating what had just happened. With procedural languages you had to think about how your algorithm was going to manage its own complexity and thus oddly worked better for scaling to complex problems.

      It looks like what has happened is that mathematica --- now wolfram language--- has a lot more speed and wisdom about how to manage complexity and choose more wise approaches. SO perhaps that problem is solved more. But it's hard to say from the demo.

      In any case that was a staggering demo.

      --
      Some drink at the fountain of knowledge. Others just gargle.
    3. Re:mathematica? by Joce640k · · Score: 5, Interesting

      Am I supposed to be impressed by "a 4-line solution to a traveling salesman tour" when that 4 line solution calls a library function called "FindShortestTour()"?

      That might be useful if your name is Martin Gardner, but...

      --
      No sig today...
    4. Re:mathematica? by goombah99 · · Score: 4, Informative

      You should watch the demo. At one point he enters a natural language expression "Show a blue dodecahedron and two red spheres" which pops up a shaded 3D image model of just that.

      --
      Some drink at the fountain of knowledge. Others just gargle.
    5. Re:mathematica? by fuzzyfuzzyfungus · · Score: 4, Insightful

      Honestly, seeing that much power in a demo makes the hair on the back of my neck rise (and in the 'something vile beyond comprehension this way comes' sort of way, not the 'awe at technology indistinguishable from magic' kind of way).

      If you can do extremely complex and powerful things with very, very, short commands, that suggests that all those commands have a lot of internal magic baked in, quite possibly including some might-as-well-be-nondeterministic guessing to paper over any ambiguity in commands, or in output from one command moving to be input for another.

      In the context of a demo, where you can carefully test, and confine yourself to some highlights from the set of programs that are both cool and well behaved, fantastic. In the context of taking the language out into the wild, that sounds like every nightmare interaction with an unpredictable and opaque 3rd-party library that you'll never expunge from your nightmares....

    6. Re:mathematica? by i+kan+reed · · Score: 3, Informative

      But that's not your job. You're not developing the language. You're just asking it to do things. Submit a bug report and move on.

    7. Re:mathematica? by ColdWetDog · · Score: 4, Funny

      Ah, so it's like Lotus Notes, then.

      --
      Faster! Faster! Faster would be better!
    8. Re:mathematica? by flargleblarg · · Score: 4, Funny

      "Show a pink cylinder with a purple sphere at the end with two pink spheres."

    9. Re:mathematica? by Anonymous Coward · · Score: 4, Insightful

      But that's not your job. You're not developing the language. You're just asking it to do things. Submit a bug report and pray to god that they fix it before you need to finish the project that you stupidly designed around this nondeterministic, amorphous pile of somewhat awesome but perhaps totally useless functions.

      ftfy

      captcha: formulas

    10. Re:mathematica? by goombah99 · · Score: 3, Funny

      "Find an image on the web resembling a torus being stretched by two hands"

      --
      Some drink at the fountain of knowledge. Others just gargle.
  2. A picture is worth a thousand words... by jeffb+(2.718) · · Score: 5, Insightful

    A picture is worth a thousand words, but most sets of 1000 words can't be succinctly described by a single picture.

    Similarly, while I'm sure that you can write a few lines of Wolfram and do amazing things, I wonder how often you can set out to do an amazing thing and end up with a few lines of Wolfram. Maybe the answer is "pretty often", which would be wonderful. But I'm waiting to hear from some outside users.

    1. Re:A picture is worth a thousand words... by kruach+aum · · Score: 3, Informative
    2. Re:A picture is worth a thousand words... by smjames · · Score: 3, Insightful

      If you look at the output of the capitals[tour] command, then compare it to the red lines on the map, they are not the same. Somebody fudged this demo a bit.

    3. Re:A picture is worth a thousand words... by Anonymous Coward · · Score: 3, Interesting

      I wonder how often you can set out to do an amazing thing and end up with a few lines of Wolfram.

      Try doing Project Euler in Mathematica. It's so easy, I jokingly refer to it as Mathematica One-Liners.

  3. A traveling salesman built-in is cool I guess... by spinninggears · · Score: 5, Insightful

    So we don't count the lines of code behind the "FindShortestTour" function?

  4. Re:A traveling salesman built-in is cool I guess.. by Anonymous Coward · · Score: 4, Funny

    Did you solve the secrets of the Universe? Stephen Wolfram did. All is known because of Him, even though you could not hope to grasp what He knows. Show more respect and reverence.

  5. It looks like a very nice library by lisaparratt · · Score: 5, Insightful

    It looks like a very nice library.

    Doesn't really say very much about the power of the language at all, though.

    1. Re:It looks like a very nice library by Impy+the+Impiuos+Imp · · Score: 3, Interesting

      A programming language with primitives like:

      "Compile a list of all European Capitals"

      and

      "Joe, my graduate student, find the shortest path between them"

      sounds like a damned powerful anguage to me.

      The ultimate is an AI, "Go Do X", where X Is an arbitrarily complicated and fuzzy problem, described in natural language.

      For example, "AI, go assemble a list of all known pictures of Cara Delevigne and Michelle Rodriguez, sorted with most romantic or intimate at the top."

      Do you deny that would be an awesome and powerful and beautiful language capable of analyzing the deepest and most important issues known to Mankind?

      --
      (-1: Post disagrees with my already-settled worldview) is not a valid mod option.
  6. Does calling a method really count as 2 lines? by js3 · · Score: 3, Insightful

    All I see there is calling some method to do something complicated. It's not 2 lines of code of the actual meat is hidden somewhere.

    --
    did you forget to take your meds?
    1. Re:Does calling a method really count as 2 lines? by dmgxmichael · · Score: 3, Insightful

      All I see there is calling some method to do something complicated. It's not 2 lines of code of the actual meat is hidden somewhere.

      Do you count the code that drives the compiler or interpreter as part of your program? What about the code that drives your database?? If it's abstracted away into the language then it's not "actual meat" as far as the programmer doing the work is concerned. It is two lines. And unless you're writing all your code in machine language you have no right to claim otherwise.

    2. Re:Does calling a method really count as 2 lines? by PPH · · Score: 3, Insightful

      But that's an important distinction to make. These solutions are demonstrating good library support. Not the syntax of the basic language itself. Are those libs even written in Wolfram?

      I can solve a traveling salesman problem using Perl with not too many lines.

      --
      Have gnu, will travel.
  7. Not so sure about the language... by lucag · · Score: 4, Insightful

    As much as I would like to be impressed, what I see is quite underwhelming: a functional application language with some interface to "facts" and "databases" with a pattern matching engine might make some analysis easier but ... the principles of the language are mostly what you come to expect if you have seen lisp once or any modern functional language,e.g. haskell.

    I can see it as being useful, but as another commenter pointed out, "FindShortestTour" is a library function (which might be handy), but definitely not an example of how concise the language might be; the same could be said about "EdgeDetect" or the like. The power of the language can be measured in how easily it can be extended or non trivial algorithms can be implemented ... not in how many functions are offered (even if this could be more convenient none-the-less).

    1. Re:Not so sure about the language... by dmgxmichael · · Score: 4, Insightful

      As much as I would like to be impressed, what I see is quite underwhelming: a functional application language with some interface to "facts" and "databases" with a pattern matching engine might make some analysis easier but ... the principles of the language are mostly what you come to expect if you have seen lisp once or any modern functional language,e.g. haskell.

      I can see it as being useful, but as another commenter pointed out, "FindShortestTour" is a library function (which might be handy), but definitely not an example of how concise the language might be; the same could be said about "EdgeDetect" or the like. The power of the language can be measured in how easily it can be extended or non trivial algorithms can be implemented ... not in how many functions are offered (even if this could be more convenient none-the-less).

      Hello. My name is PHP. I'm the most ugly hideous language known to man, but man do I have thousands of functions to get work done. And that's why I rule the server side processing world :D

      Function libraries and ability to get stuff done quickly counts for a lot.

    2. Re:Not so sure about the language... by lucag · · Score: 3, Interesting

      Indeed, and it appears that this is actually the goal of the project, per the original announcement
        http://blog.stephenwolfram.com...
      The scary bit, is that many of the "novelties" there announced (i.e. homogeneous treatment of input, output and data, etc.) are actually quite old ideas in the arena of functional programming (lisp or scheme are built upon these foundations)... sometimes they work nicely; often you risk ending up with academic exercises.
      I am myself not too keen on "revolutionary technologies" which should rather be considered "evolutionary developments" (even when the evolution actually provides something new and useful)!

      What is new here should be the integration with a massive database of `facts' and the possibility of performing elaborate queries, relying on `ready-made' algorithms.
      This is very convenient and potentially useful but
        a) it has little to do with `programming' per se; it is a programmatic interface to a knowledge-based system (where the knowledge itself includes also the algorithms being requested)
        b) it is opaque, in the sense that there is little control on what code is doing what data: many of the functions act actually as black boxes and it is not straightforward to see how to actually get in control of the system and/or understand what is actually being done in order to provide an answer.

      A further remark: (b) is most of the time not required at all (we just want to get a rough picture of something), but it is essential e.g. for scientific applications.

    3. Re:Not so sure about the language... by dmgxmichael · · Score: 3, Interesting

      Hi. I'm a 15 year old script kiddie. I just love those thousands of hideous functions because deep inside a significant fraction of them lies an exploit so obvious that three of my friends figured a half dozen of them out in a two hour Redbull and Cheetos hacking session (which consisted mostly of Googling pictures of naked 16 year olds and occasionally looking for PHP vulnerabilities).

      That hardly debunks my point. Rather, it reinforces it - people choose languages on the basis of work getting done quickly - all other concerns go out the window pretty quickly.

  8. RE: A traveling salesman built-in is cool I guess. by Anonymous Coward · · Score: 3, Insightful

    Yes. Just like we don't count the lines of machine code that a perl 'one liner' gets transformed into before execution.

  9. Perl by Areyoukiddingme · · Score: 3, Insightful

    I can do much the same thing in the same number of lines of Perl code. I don't think there are many who would claim that makes Perl a paragon of language design.

    Clickbait article is clickbait.

  10. Re:Cramming 20 commands into one line ... by goombah99 · · Score: 5, Interesting

    Cramming 20 commands and 8 layers of brackets into one line doesn't make your programm an 'impressive 5-liner'. It, at most, makes a neat stunt by a mathematician in a proprietary programming language he invented himself. I'd be tempted to call it shitty programming.

    Nothing to see here folks, move along.

    No you miss the point. It shows that two things have been accomplished

    first every command has an almost universal API for input and output letting you pipeline everything you do. try that with almost any normal library. it fails. now imagine achieving that across a language that is staggeringl comprehensive, deep and wide. it's a tour de force.

    then imagine someone told you that, by the way, that API was also symbolic.

    and wait it's also a functional programing

    and reactive.

    --
    Some drink at the fountain of knowledge. Others just gargle.
  11. Not a 4 line solution - I call BS by frnic · · Score: 4, Insightful

    The traveling salesman tour - is NOT a 4 line solution. By that definition I can write "Run Linux" and have a one line operating system.

    1. Re:Not a 4 line solution - I call BS by abies · · Score: 3, Insightful

      You wish... you forgot about 100 extra commands you need to set up proper nvidia drivers afterwards...

      And I think you misunderstood the premise. It is not a language to write salesman algos in. It is language to data mine, connect facts, process and visualize them. And it looks pretty impressive from this point of view.

  12. Re:Cramming 20 commands into one line ... by Anonymous Coward · · Score: 5, Funny

    and webscale ?

  13. You don't have to by pavon · · Score: 4, Insightful

    The way this is setup isn't that that you code everything in natural language, rather it is just a shortcut to look up the correct formal language. Instead of searching/browsing documentation looking up the exact names of the functions you want and how to chain them, you just type what you want in natural language. If it interpreted you correctly, then great it saved you several minutes, and now you know the real syntax to use in the future. If not, well you only lost a couple seconds.

    The idea of mixing natural language like this isn't so weird; the first step that most programmers would take in looking up documentation when they don't even know the name of the library the functionality is located in is to perform a natural language search on web browser, and then go from there. This just takes it one step further and streamlines the process, which is perfect for a interactive language.