Hacker News new | ask | show | jobs
by jpatokal 4291 days ago
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:

http://reference.wolfram.com/language/ref/GeoGraphics.html

2 comments

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.