Hacker News new | past | comments | ask | show | jobs | submit login
Introducing Tweet-a-Program (wolfram.com)
158 points by phs2501 on Sept 18, 2014 | hide | past | web | favorite | 54 comments

Whenever I see Wolfram/Mathematica stuff like this, I'm not entirely sure if it's incredibly brilliant and will replace all computing as we know it, or completely batshit insane and impenetrable unless you've spent 20 years learning it. Usually I lean towards the latter though, and this is supported by the fact that I've never seen anybody not employed by Wolfram do this kind of thing.

See also: http://blog.wolfram.com/2014/08/19/which-is-closer-local-bee...

Partly this is because we're so niche still that there just there just isn't a huge audience of developers to write large programs in WL yet, barring exceptions like [0]. I have no doubt that HN readers could do some amazing things in WL if they invested a modest amount of time in learning it.

[0] Emerald Therapeutics: http://emeraldcloudlab.com/

I got sick of trying to get a price out of them for calls to their API. Not having a 'pricing' tab puts people off from the get-go and dealing with their sales people is a drag: all that technology and they can't even formulate a pricing calculator?!?

Time isn't the only investment required though is it? How much is even a single-seat licence?

300$ for just the software. Access to their data api's cost ~1k$ to start now with the desktop software.

Cloud laboratory is so cool. I've also thought you could launch some amazing startups off the back of Wolfram Alpha language. But yeah quite a steep learning curve

It uses raw lists as the data structure for everything (including code) and has enormous math/sci and presentation infrastructure. Every part of the system can easily talk to any other part of the system.

Because of this you can just throw things together and get great results, where in other systems you might need to use external libraries or otherwise have to deal with high-ceremony architecture (I'm looking at you, OOP).

So I think the difficulty for newcomers is recognizing that "there is no spoon" and that you're entirely welcome to just start flying around like this:


The language itself is simple, I think. But I could see how the APL-ish/functional aspect of it could seem abstruse to new people.

You can only "easily" "throw together" things if you have any clue about a) where to find things, and b) how you can make them fit together. The problem with Mathematica is that neither of these is easy. I mean, look at their literal Hello World example:

GeoGraphics[Text[Style["Hello!", 150]], GeoRange -> World]

In any other language, if I wanted to write some text on a graphic, I would find a routine to load an image into memory and another to render text into that memory. That's genuinely easy.

But in Wolfram's case, I'm apparently just supposed to know that there's something called "GeoGraphics" that does this kind of thing, that the text goes in a Style[] block (what?), and "GeoRange -> World" is how you tell it to create a worldmap as a background. WTF. And don't tell me "read the docs", because even if I found this, it wouldn't help me much with the rest:


That's because they were showing off the functionality of GeoGraphics. To do that for general images you would just load an image and place text on top of it, with a function like Overlay or ImageCompose:

    img = Import["c:/blah/blah.jpg"];
    ImageCompose[img, Rasterize["HELLO"]]
That's the same Import you'd use if you wanted to read a webpage through a URL, etc.

You're right that it might not be obvious what to search for, but in this case you would search for "image" or "importing" or "overlaying" and you'd figure it out.

Mathematica uses a 'compositional' model like some other functional languages, as opposed to a 'memory' model like system languages, so that could take some getting used to if your background is system languages.

The simplest Hello World in Wolfram Language is just:

"Hello World"

or even:

Hello World

which are both quines. The only reason you need to know about Style and GeoGraphics is for making a prettier, but still small, Hello World example.

Sure, but to print ASCII text on the screen one could use any language. What were discussing here is why one might want to choose WL instead of other languages.

Ahh! I went to his SXSW talk this year and was absolutely entranced with the Wolfram language. It seemed like a real step forward in innovative thinking and actual "natural language" programming, but I was sad it's proprietary.

I think the power of it is really undervalued - using all the knowledge of the wolfram-alpha engine to create objects? Such a neat idea! Imagine if Google built a similar language based on their search engine data - the kinds of programs people could build and might accidentally build just playing around boggle the mind.

In some sense it is surprising that Google hasn't done this already. After all, Mozilla has seen fit to work on Rust, which will soon replace C++ (god willing). But if you're organizing the world's information, don't you need a programming language that can work with that information in a first-class way?

> which will soon replace C++

In what sense? If you mean traditional business software, maybe.

If you mean real systems programming, OS drivers and such, only when an OS vendor integrates it into their SDK.

That is how C and later on C++, pushed away all the other alternatives for systems programming.

We had it already, but the world wasn't prepared for it.

I experienced the same feeling when I got to work in Smalltalk back in 1996 and a few years ago started gathering information about Lisp machines and the systems developed at Xerox PARC.

I love the work this company produces (especially Wolfram Alpha), but jeez, can't this guy give his employees some credit? People thought Jobs had an ego...

When he says "I" I mentally substitute "we". :-)

Thats like when Obama or Bush use the word Freedom....

I just did a WL equivalent of those Pi shirts you sometimes see: https://twitter.com/wolframtap/status/512754733476352000

I'd really like an explanation of what's so amazing about this language. I saw the closing keynote today at Strangeloop and I can't understand why people are so excited. The language is proprietary and I don't feel like it's something I would actually use myself.

The impression I got was that this project is an inventor's dream, which he has obviously obsessed over for some time, and it is an impressive feat, it just comes across as self centered and I have trouble understanding who might use the language and why..

A large part of what's impressive about the language isn't the language, it's that it's tied together so many different data sources from around the globe that it can generate information that would be a nightmare to do manually.

This still looks like a nightmare. No discoverability, no namespaces, no metadata management... these are all implemented in knowledge management systems, but this thing, whatever it is (not a language, not a knowledgebase, maybe a collection of pre-scripted demo applications?) has none of this.

The language itself is not the exciting bit really, it's the data and processing APIs that it integrates with. They're taking care of a lot of information gathering for your through that integration which is pretty neat.

From what I can tell, it seems like a quirky lisp with a great set of libraries, and a very integrated IDE. Is there more to it?

It also has knowledge about the world... So here for example we're training a image classifier to distinguish paintings by different artists:


I don't think there's another language you could use to do that in ~5 minutes.

Another example, to show off:

By running this code:

        "text" -> "String", 
        Classify["FacebookTopic", #text, "TopProbabilities"] &, 
      Permissions -> "Public"
I get a web form that can be used to enter arbitrary text and have social media topic inferred on it:


Try something like "I just had the most amazing meal at Four Burgers today".

That's about right. It's somewhat of a superset of most languages, with Lisp chosen as its programmatic subset of choice. And its libraries are huge. Something like a few thousand functions. And the IDE uses the same language, so you can programmatically construct UIs. The key in all of this is that everything uses the same data structure.

In previous versions the data stuff was not impressive, but with the recent versions it's starting to come into par with the rest of the language.

Their twitter bot seems to have gone crazy. It keeps sending the results for my program again and again. Think there is a bug in the bot, and it is picking up old tweets again from the timeline.

Some ideas and hacks to use to get a lot of Wolfram language into a tweet: http://blog.wolfram.com/2010/12/17/the-mathematica-one-liner...

It's a little amusing to observe Twitter being used as a sort of "transport layer" for services because of how easy it is for people to use it; a few decades ago, to interact with a service you would probably open a TCP connection to it and communicate in a service-specific protocol. Later, that was largely replaced by the ubiquitous HTTP "web API", and now we see services built on services like Twitter which are already using a HTTP-based API.

Earlier, someone tried doing similar things with another calculator: http://www.hilarymason.com/blog/a-quick-twitter-bot-bc_l/

I've seen IRC used the same way - and at least there you can move to your own server if the operator changes their ToS.

In this case they are using twitter because of the marketing value.

I want to get excited about Wolfram and Mathematica again. All of their blog posts are rather informative great reads. But then I head over to the pricing page and am reminded of why I love open source tools.

The Wolfram Programming Cloud even has a free tier. The online IDE does not have quite as smooth an experience as the desktop IDE, however. https://programming.wolframcloud.com/

Is your CDF format ever going to be publicly specified?

I don't know about that, but more and more things can be done in CloudCDF, which is standard open web technology.

I think that for the most part, you get what you pay for. Mathematica is expensive, but it is awesome. I'm not sure that it's easy enough to use for the price point they are asking, but it's definitely better than the free options.

Wolfram Online is only $15 per month now for individuals.

If it's about "ethics", that makes sense. But if price is what prevents, say, a software dude in the bay area from trying out Mathematica, well that's just l, o, l; i, m, o.

Pretty good marketing move on their part. Though it could also be useful when you need an math/data image generated.

using twitter as a compiler(as a service) is pretty cool

I think it would be more interesting if you could dynamically create twitter bots. Then you could create a functional language in which tweets were expressions. Then you build the functional tree for your program and then tweet to its root node to execute it.

That's a really fun idea. You'd be able to see the execution of the sub-parts of the program by watching the sub-bots tweet results between themselves.

I've got code working for both Twitter and Jabber bots ... Would anyone be interested in working on this for fun?

I would, but how would you dynamically create twitter bots? Just create a swarm a make them reprogramable?

I was thinking that we could run completely independent twitter bots that performed some function, (a low-level programming language function or some higher-level library function), then collaborate on a service that provided a function catalog. New functions could then be built using the lower-level building blocks.

Check out 411 for Twitter in this connection. Your own code behind tweets: http://t411.linkstore.ru

Hm, I (@circular) am 1-2 against the monolith. Could be more helpful but I can see the showing-off-on-twitter potential.

Hm. I thought running a bot on Twitter was against their TOS? Anyone know any better on this one? I'd love to run a chatbot on Twitter =)

Nah not forbidden AFAIK. They even provide ean API you can use.

I think automatic favorites, follows, etc. are forbidden.

I tried fib(100000) and it works!



Applications are open for YC Winter 2020

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact