Wolfram Language Demo Impresses 216
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!"
mathematica? (Score:4, Insightful)
This looks a lot like Mathematica. When does something become programming language? Wasn't mathematica a programming language too?
Re:mathematica? (Score:5, 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" [fastcolabs.com].
Re:mathematica? (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.
Re:mathematica? (Score:5, Insightful)
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....
Re:mathematica? (Score:5, Funny)
Ah, so it's like Lotus Notes, then.
Re: (Score:3)
No, he reimplemented Common Lisp with a Mathematica syntax reader.
Re: (Score:2)
I get it in the "magic indistinguishable from a rigged demo" kind of way.
Language snippets that look great on a powerpoint slide don't always translate into great languages for programs that take up tens of thousands of lines. If anything, just the opposite: some of the redundancy that you've squeezed out to make it look great for a snippet is precisely what you need to make coding contracts. You end up having to convey the rest in comments, which gradually rot as the code develops.
Language developers are a
Re:mathematica? (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...
Re:mathematica? (Score:5, 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.
Re: (Score:3)
Re:mathematica? (Score:4, 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.
Re:mathematica? (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
Re: (Score:2)
amen
You don't have to (Score:5, 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.
Re:mathematica? (Score:5, Funny)
Re:mathematica? (Score:4, Funny)
"Find an image on the web resembling a torus being stretched by two hands"
Re: (Score:2)
I see what you did there and raise you a tub.
Re: (Score:2)
I'm somewhat less impressed because I can see an obvious shorter tour.
Take out the big journey at the left, connect the ends on the right. It's worse than it looks - the map makes Iceland look closer than it is.
Map drawn does not follow list, nor is shortest (Score:2)
nice observation. Even weirder, is that the list of capitals shown for the tour is in a different order than the map that is drawn. I'm thinking this has something to do with that //last.
Re: (Score:3)
For these particular demos he implemented a "solvemyproblem" function elsewhere. Not, however, for an infinite variety of closely related problems of similar practical import.
A picture is worth a thousand words... (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.
Re: (Score:2)
well, the picture here does not impress me : replacing the lisbon -rejkjavic section with vienna-athens would make the tour shorter ...
Re: (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.
Re: (Score:2)
What? A fudged demo? I'm shocked I tell 'ya.
Oh, wait, no I'm not.
Re: (Score:3)
Right, the travelling salesman needs to return to origin!
Re: (Score:2)
Willie Lohman, is that you?
Re:A picture is worth a thousand words... (Score:4, Informative)
http://i.imgur.com/1nODwBf.png [imgur.com]
Re: (Score:2)
More evidence! Another user who doesn't use beta.
Re: (Score:2)
Re: (Score:2)
No, you're thinking of "a picture is worth ten million bits".
Re: (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 [projecteuler.net] in Mathematica. It's so easy, I jokingly refer to it as Mathematica One-Liners.
A traveling salesman built-in is cool I guess... (Score:5, Insightful)
So we don't count the lines of code behind the "FindShortestTour" function?
Re:A traveling salesman built-in is cool I guess.. (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.
Re: (Score:2)
Emacs has a binding for that.
You can do the same in Python.
I think you just need to type this first
import wolfram
But it prints this rant from Guido on why this is not Pythonic at all, after it does the import.
Re: (Score:3)
it's just one line in wolfram:
print UNIVERSE.revealSecrets(ALL);
Output: 42
Sorry that's life, the_universe AND everything. It's a bitwise AND, of course, so that's 101010. Life is 111011, everything is (as you might expect) 111111. Finding all possible values of the universe is an exercise left to the reader.
RE: A traveling salesman built-in is cool I guess. (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.
Re: (Score:2)
So we don't count the lines of code behind the "FindShortestTour" function?
Not unless you had to write them yourself. Do you count the lines of code behind printf() when you write Hello World?
Re: (Score:2)
So we don't count the lines of code
FTFY
Re: (Score:2)
Wolfram didn't claim to have a 4-line solution to the TSP. You can thank the summary submitter for that one.
Re: (Score:2)
No, of course not. When you call a library funnction, do you count all the lines of code in the library? When you write a for loop, do you count all the lines of assembly it compiles into? No. The number of lines you count is the number of lines you have to debug, and the ones that hurt more count extra.
Fixed that for you.
Re: (Score:2)
when search returns models (Score:3)
Wow, that's just bizarre. I don't know where you get your misinformation, but it's an elite grade of batshit.
The whole point of Boost is that it maintains a certain amount of abstraction without boxing you into a performance corner. Were it not for those conflicting goals, the devilishness of its internal machinery could n
Re: (Score:2)
If you want to see the merit of a language, you actually have to see something implemented in the language. If all you do is call a library function (especially one whose inclusion in a core set of operations is dubious) then all you get to see of the language is how you call a function. If you want to demonstrate a language, you should pick examples that excercise the core features of the language, not punt to calculateObscureFnOnlyUsedByArcheologistsButItTakesUpSpaceOnYourFlashCardAnyway()
This video was
Re: (Score:2)
The solution it comes up with is correct (it includes/excludes the links you mentioned), but for some reason it's drawing the graph incorrectly.
Cramming 20 commands into one line ... (Score:2, Insightful)
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.
Re:Cramming 20 commands into one line ... (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.
Re:Cramming 20 commands into one line ... (Score:5, Funny)
and webscale ?
Re: (Score:3)
first every command has an almost universal API for input and output letting you pipeline everything you do.
achieving that across a language that is staggeringly comprehensive, deep and wide.
Are we sure about that yet? Are the limitations due to dependencies going to be revealed as people attempt to write longer pipelines? Wolfram makes great tools, but they aren't going to be great tools for every problem.
Re: (Score:2)
Great, so now it's filled with rampant abuse of human growth hormones?
Re: (Score:3)
The issue is more than merely about number of lines, it's about modes of thought. In most languages, coding is an exercise that basically involves a lot of mundane data shuffling that is easily expressed, but each individual line achieves nothing of consequence. When it comes to code maintenance, reading the lines is easy, but reconstructing the program logic is very difficult indeed. Wolfram's goal appears to be to strip away all the housekeeping in order to spotlight the code logic, which strikes me as th
Re: (Score:2)
Imperative programming is inefficient because it doesn't allow us to take f(x) and g(x) and create g(f(x)) for all x
And functional programming is ineffficient because it doesn't allow us to order our operations in response to realtime constraints, and most of the work goes into developing workarounds for the strictures, which just ends being "mundane shuffling" of monads and whatnot. Most languages developed with a purist mathematical approach tend to be the kind of thing it is fun to play with, but they leave you saying "man how do people actually use this crap?" when presented with anything more real-world than a word
Re: (Score:2)
Functional languages have been used and are used for realtime systems
Yes, clojure for one, I am to understand, is a good *soft* realtime language.
Just because a paradigm can bend to the point of doing something doesn't mean it does it easily or concisely. If you're into math you should already be familiar with the ability to express things in forms that you would never sanely use in real life.
When you find you've just spent an hour trying to model 10 lines of C code into an appropriately pure functional form, stop, you're just masturbating, no matter whether the result is l
Re: (Score:2)
The issue is more than merely about number of lines, it's about modes of thought. In most languages, coding is an exercise that basically involves a lot of mundane data shuffling that is easily expressed, but each individual line achieves nothing of consequence. When it comes to code maintenance, reading the lines is easy, but reconstructing the program logic is very difficult indeed. Wolfram's goal appears to be to strip away all the housekeeping in order to spotlight the code logic, which strikes me as the right way around.
Your use of the term "mathematician" is interesting too, because it does suggest that you don't feel mathematicians should be interfering in programming. Well, I'm of the opposite opinion. Imperative programming is the result of non enough mathematics in computer programming.
Actually imperative programming is a mathematic concept too. The difference between imperative and functional programming is a matter of abstraction level as both of those can be translated to the other model.
It took me a long time to get my head round my maths lecturers at university telling me a matrix was "a computer", but they were right. Imperative programming is inefficient because it doesn't allow us to take f(x) and g(x) and create g(f(x)) for all x, so we have to evaluate every step.
Not necessarily, imperative programming can have such transformations and in fact most modern ones do. Also most compilers translate the imperative code into an internal functional abstraction to simplify optimizations (often in the form of SSA or single static assignment form) and then translate that
Re: (Score:3)
Actually imperative programming is a mathematic concept too. The difference between imperative and functional programming is a matter of abstraction level as both of those can be translated to the other model.
Yes, but the problem is that imperative coding abstracts the mathematics to the point where the programmer isn't thinking mathematically any more.
It took me a long time to get my head round my maths lecturers at university telling me a matrix was "a computer", but they were right. Imperative programming is inefficient because it doesn't allow us to take f(x) and g(x) and create g(f(x)) for all x, so we have to evaluate every step.
Not necessarily, imperative programming can have such transformations and in fact most modern ones do.
Ok, but most coders won't use such features, because they don't understand them.
Also most compilers translate the imperative code into an internal functional abstraction to simplify optimizations (often in the form of SSA or single static assignment form) and then translate that into the imperative form required by most computers.
Which calls into question the whole point of imperative programming. Why should I spend so much time telling the computer exactly what to do in what order if it's only going to attempt to extract the task logic and refactor everything anyway? Surely it's more efficient to just describe
Comment removed (Score:5, Insightful)
Re: (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 powe
Re: (Score:2)
To me, that doesn't sound like a very powerful language, it sounds like a language with a huge standard library. Power comes from things like making
"Compile a list of all European capitals, but I don't consider Iceland to be part of Europe"
easy. If it's hard to step outside the limits of the standard library, it's not a powerful language.
Re: (Score:2)
pretty sure he anticipated the delivigne/rodriguez thing.
Re: (Score:2)
yeah....exactly
APL (Score:2)
Someone reminiscent of APL which critics called the first 'write-only' programming language.
Does calling a method really count as 2 lines? (Score:4, 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.
Re:Does calling a method really count as 2 lines? (Score:4, 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.
Re:Does calling a method really count as 2 lines? (Score:4, 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 [cpan.org] with not too many lines.
Re: (Score:2)
also true for the demo
Re: (Score:2)
When you make a statement like: "travelling salesman in 4 lines of code", it generally means the entire problem in 4 lines of code, not a function call to some built in function and a couple of array initializers.
Now, had the submitter written something like "Hey check this out, it has some really cool functions build in", that would have made at least some sense.
Re: (Score:2)
When you make a statement like: "travelling salesman in 4 lines of code", it generally means the entire problem in 4 lines of code, not a function call to some built in function and a couple of array initializers.
Where does the line get drawn? Hell, an echo statement must look up the character code for each letter in the string and send that along to the graphics driver for further processing before even one letter is shown on the screen to the user.
The article demonstrated the language itself being able to present a solution to the traveling salesman in 2 lines of code. I personally find arguments about how many underlying function calls the language had to go to while it turned it's instructions into something t
Re: (Score:2)
For example: people use PHP often because it can do in a couple lines what might take several pages of code to do in Java - and there are tasks that PHP needs several pages of code to do that Python can deal with in a few lines as well.
That is nonsense. The main difference between PHP and Java is that the former is dynamic typed and the later static.
To find an example where PHP beats Java significantly in code compactness will be very very difficult.
Re: (Score:2)
To find an example where PHP beats Java significantly in code compactness will be very very difficult.
Let's start with Hello World shall we? Here's the whole PHP program.
<?='Hello World'?>
18 CHARACTERS. PHP was a template engine long before anyone grafted 1,001 other crazy uses to it. In the job it was designed for - fulfilling HTML requests from webservers - few things can touch it for simplicity or development speed.
In fairness to Java, it scales better to large applications than PHP. PHP does little to discourage its largely newbie programmer base from making bad to outright catastrophic design
Not so sure about the language... (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).
Re: (Score:3)
The power of the language can be measured in how easily it can be extended or non trivial algorithms can be implemented
True, but the usefulness of a language largely depends on how quickly you can get a result - and while hard to tell from this little demonstration - I certainly see some impressive capability from the standard library.
Re: (Score:2)
Within the bounds of what is in the library, with horrible syntax and little structure.
Because you do not have structure available, you cannot have large programmes. This in turn means you are stuck with what Stephen Finds Interesting(TM). This has left me very much unimpressed: when I look at a language demo, I care about how elegantly, tersely and legibly you can express and structure notions. This is terse, but not elegant or legible. Also, expressing anything not already there seems really daunting.
1/10
Re: (Score:3, Interesting)
Indeed, and it appears that this is actually the goal of the project, per the original announcement
http://blog.stephenwolfram.com... [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 technol
Re: (Score:2)
Even this integration with a massive database is not new. I remember reading about development of such systems in the beginning of the eighties (in Readers' Digest, ffs). The only thing changed since then is the speed of CPU, the size of memory and the size of databases.
Re: (Score:2)
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.
You can usually twiddle all the options in a function; the documentation [wolfram.com] is pretty good for most of the standard libraries. Of course, the demo doesn't look as slick if you have to use 6 lines of optional parameters to get the exact thing you want. Typically, the default options do a pretty good job, and there's a lot less typing for those cases.
Of course, it's also a universal language. You don't have to use the standard libraries; feel free to roll your own. I'm sure an hour later, you'll have a bit more
Re:Not so sure about the language... (Score:5, 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.
Re:Not so sure about the language... (Score:4, 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.
Re: (Score:2)
Maybe a measure of the language might be to program FindShortestTour in it. If that turns out to be elegant and simple, then he might have something....assuming there are no further calls that do "too much" of the hard work instead of doing the hard work in the algorithm.
Re: (Score:2)
Re: (Score:2)
Another measure of the language would be to see if it understands "please redfine FindShortestTour with a more sensible name"
Perl (Score:4, 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.
Re: (Score:3)
I dare you. Let's start with travelling salesman example. 4 lines of perl. It has to include the map with graph as an output displayed on the screen. You are free to import any CPAN module, but no utilities of your own written specifically for this purpose.
I do not expect post of excuses and example of things you can do in perl in 4 lines instead of this problem - I expect 4 lines long perl code.
Re: (Score:2)
You are free to import any CPAN module, but no utilities of your own written specifically for this purpose.
That's not exactly a fair comparison. It's not like Wolfram is working with a vanilla Mathematica. He got to personally write lots of additionally helper functions specifically to put on this demo.
You'd be more reasonable to demand that GP write a single perl module that duplicates all the functionality that Wolfram has added to Mathematica. While this would no doubt be a lot of work, I see no inherent shortcomings in perl that would prevent this from being possible.
From what I've seen (i.e. the slash
Re: (Score:2)
no utilities of your own written specifically for this purpose.
Why not? That is *precisely* what wolfram did here. He designed the 'language' and decided 'gee it would be nice to have a first class function for travelling salesman', and then when he goes to demo, he whips that out to say 'look at this obscure capability omitted from most languages'. This may be useful, but being excited around the linecount is not something compelling in this case, as it shows no particularly exciting grammer/syntax stuff, just that Wolfram deemed 'travelling salesman' a problem wort
Re: (Score:2)
I'm quite sure that you can find travelling saleman function somewhere on CPAN. Problem is that it will expect some very specific inputs - zero chances that these inputs will be compatible with whatever format you might get geolocation data. This seems to me to be THE power of Wolfram language - binding data, not actually having saleman solver in global namespace.
Unless of course it is so big fake that this salesman function cannot accept anything except Earth map data... but I have a strong feeling that it
Re: (Score:2)
I can do this in lots of languages, including perl, but also many others.
Step 1: Implement in long-hand perl. /g;
Step 2: $source =~ s/\n/
Step 1 is left as an exercise to the reader =)
Re: (Score:2, Troll)
Hah!
No, what happened was this:
1) Hmm I need to make a slick demo
2) How about a solution to problem A
3) No, that came out ugly
4) Ok lets try problem B
5) No they won't like that either
6) OK, what problem do we have that has built-in solutions?
7) Ahh, there we go, we'll solve problem C instead.
Same difference.
Traveling salesman .. technically correct (Score:2)
But practically useless as the only way you are going to travel via some of those legs is if you have your private plane.
And what sort of salesman has a private plane .. hmm .. maybe one who is trying to sell us a new computing paradigm??
Re: (Score:2)
And what sort of salesman has a private plane
One who is selling his plane.
Concise? (Score:3)
Don't make me laugh -- I used to be an APL programmer.
A little too much for human consumption (Score:3)
Impressive but overwhelming. I don't look forward to learning, reading or maintaining such code. So as usual: functionality is inversely proportional to usability :)
New Kind of Language? (Score:2)
Not a 4 line solution - I call BS (Score:5, 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.
Re: (Score:2)
They're just stretching the definition of language. They of course meant a language + core library. And in a world of C++ and Boost, Ruby and Rail, C# and .NET, Javascript and Node, it is a perfectly valid comparison. The terminology was just wrong.
And yes, if you give me a nice domain specific language made to handle common operations when creating a new operating system, and it has KernelManager object with a LoadKernel method where I can just do KernelManager.LoadKernel("Linux vABC").Run() and it spawns
Re:Not a 4 line solution - I call BS (Score:4, 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.
The next big IT merger? (Score:2)
This sounds like Stephen Wolfram is angling for a buyout from an enormous search engine (that has the majority of market share).
Such a search giant busies itself with the trying to stay ahead of a curve that is contantly try to flatten itself. This would be quite the engine for solving that problem...
Re: (Score:2)
Stephen Wolfram invented a New Kind of Science, that has unlocked the mysteries of the Universe. What have you done?
I know stuff about tanks.
Re: (Score:2)
Re: (Score:2)
If you were to write a simple python program that uses say, the Panda package, would you include all the lines of code of that package when line counting your program? No.
Yes, as we all know, Hello World in C is actually thousands of lines long [sourceware.org]. (shakes head sadly) It's a terrible language.
Re: (Score:3)
Perhaps I'm misunderstanding you here, but the Traveling Salesman problem is a closed path - the salesman has to return to his starting point in the end. Your solution is only shorter if the salesman is allowed to settle down in Reykjavik in the end. The red line in the plot is misleading because it does not draw the closing line between Athens and Vienna, but that part is included in the path. As far as I can see, the solution shown in the video is the correct one, and the path drawn is correct except for
Re: (Score:2)
There is a small bug in the demo: It's using the "draw open path" instead of "draw closed path" command. That leaves a gap (between Athens and Vienna) in what should have been a closed path on the map, since the Traveling Salesman problem is about a salesman going out to sell things, and then returning home in the end. Aside from that, the plot and text output are consistent and correct.