top | item 1040856

What programming languages do mathematicians use?

16 points| KonaB | 16 years ago |mathoverflow.net | reply

24 comments

order
[+] jimfl|16 years ago|reply
Statisticians commonly use SPlus or R. Applied mathematicians use some flavor of Fortran, in part because of numerical libraries available in that language. Matlab is also in heavy currency in many disciplines.

Much of the time, a scientist is driven to a language not by any particular language feature, but by what code/tools are already available in that language that they can build upon for their own research.

[+] yummyfajitas|16 years ago|reply
I don't know of that many applied math people using Fortran these days. If you need to use a fortran library, you can either call it directly from c, or write a wrapper (in c) which you can call from python/matlab/mathematica. Or you can probably just download the c wrapper.

The only people I know who use fortran are either a) old or b) their code is very old.

[+] stcredzero|16 years ago|reply
Many epidemiologists seem to prefer Stata. I don't know why. It's like some SQL shell out of the early 80's.

I think that languages that didn't support "conventional" operator precedence lost out because that went against the expectations of science/tech types. (Smalltalk & Lisp in particular)

[+] cperciva|16 years ago|reply
What cars do pilots drive?

What foods do vintners eat?

These are silly questions -- in all three cases, the answer is "if they're smart, whatever is best for their circumstances". I know mathematicians who have used Fortran, Pascal, C, C++, Java, BASIC, Assembly, Lisp, Maple, Matlab, Magma, Mathmatica, and Maxima; and that's not counting the people who do deliberately weird things (like computing Mersenne primes in Postscript).

[+] hugh_|16 years ago|reply
What cars do pilots drive? What foods do vintners eat?

I'd say it's more like asking "What cars do park rangers drive?" or "What foods do wrestlers eat?" because we're talking about groups of people with quite specific requirements. The question, while overly broad, isn't silly, because there's a lot of people who have no idea and have never heard of things like Maple, Magma. Heck, now I coem to think of it I've never heard of Maxima, so your answer taught me something new. And if you learn something new from the answer, it's probably not a silly question!

[+] wtallis|16 years ago|reply
Your two questions seem to imply that programming isn't that closely related to mathematics. Programming may not be that important for the math learned in school, but in general math researchers do at least as much programming as computer science researchers.

It is interesting to look at what languages get used for what kinds of research, and how it is affected by the researcher's level of computer science education. For example, those doing numerical analysis kind of research tend strongly toward MATLAB, with Python getting a lot of use from those who are relatively well-educated about computer science, and the lower-level languages used by people with extreme performance needs or who haven't learned any of the newer options. On the other hand, I doubt that any of the numerical researchers I work with have even heard of Haskell, and while some may have heard of APL (though definitely not J), none could use it.

[+] jacquesm|16 years ago|reply
> and that's not counting the people who do deliberately weird things (like computing Mersenne primes in Postscript).

Now what's so weird about that ?

In postscript (which is actually quite a powerful language) sounds a lot less weird than doing it in brainfuck or something like that.

[+] RiderOfGiraffes|16 years ago|reply
The practising mathematicians I know don't program. I'm not sure if there are any ways in which programming can help with things like Functional Analysis or Geometric Topology. Not even sure about low-dimensional topology.

I'll ask Tim Gowers next time I see him.

The ex-mathematicians I know who now use mathematics to do things in the real-world use a full range, including all those mentioned elsewhere.

For my PhD I used Fortran, BCPL, zed (not the one you might think - it was essentially "ed"), and Phoenix scripting.

For my day job I use Python/Sage/NumPy, C, C++, ARM assembler, bash, BASIC and OpenOffice Calc. Infrequently and irregularly I use Lua and Scheme. On the other hand, I'm not really doing math anymore. I no longer prove theorems.

[+] brown9-2|16 years ago|reply
I find it very interesting that almost every single mathoverflow user (based on this page alone) uses their full name as their username on the site.

Compare that with stackoverflow and HN in which we use nicknames, made up names, etc.

Just interesting to see how different communities choose to handle something like this.

[+] Rod|16 years ago|reply
It's a MO policy: http://mathoverflow.net/faq

"We also encourage you to use your real name as your username. In your own enlightened self-interest, realise that participating in blogs, Math Overflow, the arXiv, and mathematical publishing are all forms of advertising for your "brand", even if that’s not your principal purpose (and hopefully it’s not). Since job applications require you to write your real name, you might as well use it everywhere else, too."

The bright side is that if a Fields medalist answers your question, you know it ;-)

[+] blasdel|16 years ago|reply
Coq is the only real Mathematics language I've ever played with.

Everything else just feels like it's ultimately Arithmetic, even when doing Symbolic Algebra natively in Haskell or Lisp or Mathematica.

[+] stcredzero|16 years ago|reply
Quantitative analysts used to use Smalltalk quite a bit. There's still a bit of that. Ruby's taking up some of that territory now. C++ was there too, and is still going strong.
[+] Imprecate|16 years ago|reply
Depends on the branch. In quantitative finance: C++, R, F#, Q, OCaml, MATLAB, Python (NumPy and SciPy)
[+] BrentRitterbeck|16 years ago|reply
I second this. I have a quantitative finance background. I use C, C++, C#, MATLAB, and Python. MATLAB and Python are primarily for prototyping ideas. C and C++ are primarily used when I'm working with Linux. C# is exclusively used when I am working with Windows.
[+] Scramblejams|16 years ago|reply
Very often Matlab. Very often badly. And for a programmer who has to watch, it is to weep.
[+] borga|16 years ago|reply
The one I know uses Mathematica.
[+] stcredzero|16 years ago|reply
I know a bona-fide ex-NASA rocket scientist who uses Matlab. He finds that it's much more productive than C, which he used to use heavily. His NASA job basically involved numerical methods for integration to track the trajectory of the Space Shuttle.