Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am attending a course in numerical computing next semester, so I thought I could prepare this summer. My guess is that all of the stuff in the course is language independent, but it is cool to try to implement some of the algorithms and see how they work.

Conceptual understanding is more a goal than that of speed for the choice of language. My first thought was to use Python with NumPy. I have also considered learning Lisp, through Structure and Interpretation of Computer Programs (SICP) and doing numerical analysis in Lisp. What language should I choose?

share|improve this question
8  
It might not be exactly what you're after but Fortran might be a good choice - dependant on your experience with programming, that is. The name comes from it's goal/mission statement "FORmula TRANsformation" – Jamie Taylor May 15 '12 at 13:21
2  
Q&A is Hard, Let’s Go Shopping! "consider the voluminous amount of information you need to even begin properly answering a shopping question..." – gnat May 15 '12 at 14:09
3  
Contact the course leaders and ask them for their recommendation. – igouy May 15 '12 at 16:43

closed as not constructive by gnat, Caleb, Mark Trapp, ChrisF May 15 '12 at 21:08

As it currently stands, this question is not a good fit for our Q&A; format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

6 Answers

What instantly jumps into my mind with numerical computing and programming language is Haskell.

share|improve this answer
2  
Numerical computing is something full of linear algebra, precedural and stateful algorithms. As such, I wouldn't recommend Haskell for that ...it might be just fine ...or, more likely, ends up more time consuming than other alternatives which are "made" for numerical simulations like NumPy/SciPy & Matlab – arnaud May 15 '12 at 13:29
4  
I would avoid Haskell for now. It's too slow (you can make it reasonably fast, but then the code looks horrible -- check out Haskell submissions to shootout.alioth.debian.org) and -- counterintuitively -- many numerical algorithms are NOT functional in nature, but imperative. This is because in order to be both accurate and efficient, they have to follow the underlying computing model, and our computing machines are imperative in nature. In short, Haskell is at the same time too high level for numerical computing, and lacks convenient abstractions present e.g. in Matlab. – quant_dev May 15 '12 at 13:50

NumPy and SciPy are a very good choice, as well as MATLAB.

share|improve this answer
2  
Matlab costs $$$. – quant_dev May 15 '12 at 13:56
@quant_dev: Some schools have Matlab licenses for students to use. Failing that, I've heard that scilab is a good competitor to Matlab, and is also free and open source: scilab.org/products/scilab And there's also Octave: gnu.org/software/octave Mind you, I've never used any of these myself. – FrustratedWithFormsDesigner May 15 '12 at 14:02
1  
Fair enough. But if the taks is "learn how to diagonalise a matrix", then using a language which has this functionality already built it is counter-productive. – quant_dev May 15 '12 at 14:06
3  
@quant_dev, it's actually quite common to use MATLAB/Octave/Mathematica in a numerical methods course. The instructors just make it clear which built in facilities you are allowed to use for the purposes of each assignment. Sure MATLAB includes functions for doing diagonalization, eigenvalues SVD, etc., but its support for matrix slicing makes it a reasonable pedagogical choice form re-implementing the algorithms for those as well. And you can check your work afterwards with the built in facility. – Charles E. Grant May 15 '12 at 16:36

Fortran is a good choice, also C. Both are simple so they won't distract you with shiny "programmer stuff" and let you concentrate on the numerical side of things.

share|improve this answer

On a scale of traditional to hip:

  1. Fortran
  2. C
  3. MATLAB (or Octave)
  4. NumPy/SciPy
  5. Julia

Of course, asking strangers on the Internet what language to use is probably going to end in tears since you are preparing for a course. Why not just ask the professor what language you'll be expected to use in class?

share|improve this answer
9  
+1 for "ask the prof what language you'll be expected to use" – FrustratedWithFormsDesigner May 15 '12 at 14:05
3  
+1 for hipness scale. Any of those languages will work fine for numerical work but depending on your needs you may want one over the other. – joshin4colours May 15 '12 at 14:57
+1 "on a scale of traditional to hip" – System Down May 15 '12 at 14:59
+1 for Fortran... Old, but still useful – ObsessiveSSOℲ May 15 '12 at 20:42

I took a numerical linear algebra class two falls ago. We used MATLAB and I personally used Octave at home to complete assignments which was extremely similar to MATLAB minus a few quirks like the if statement syntax. We primarily focused on runtime analysis, error analysis and numerical stability. Your time might be better spent on reviewing mathematics like calculus and linear algebra than trying to learn a new programming language.

share|improve this answer

In the spirit of NumPy/SciPy and MATLAB, I woupd really recommend R. I have used it extensively throughout my PhD and really like it. It has a large community, e.g. on Stack Overflow, and a lot of user contributed packages. A lot of time you can pick functionality right of the shelf in stead of having to write stuff from scratch. I also use Fortran, but for day to day number crunching I really recommend high level languages. Only when there is a pressing need, Fortran can be really useful. With R, or MATLAB, you lose pure speed, but gain ease of development.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.