Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

This question is inspired by these questions (here and here).

I do mostly numerical work, and I usually use C++, Fortran, and occasionally Numpy. I'm trying to broaden my horizons, and I'm looking for programming languages that are good for numerical work (have bindings for BLAS/LAPACK; fast, lightweight, multidimensional arrays; etc.) but are a little bit outside the mainstream.

Which "unusual" languages are good for getting new ideas about numerical programming?

share|improve this question

closed as off-topic by gnat, GlenH7, psr, MichaelT, Dynamic Jul 19 '13 at 13:49

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about what language, technology, or project one should take up next are off topic on Programmers, as they can only attract subjective opinions for answers. There are too many individual factors behind the question to create answers that will have lasting value. You may be able to get help in The Whiteboard, our chat room." – GlenH7, MichaelT, Dynamic
If this question can be reworded to fit the rules in the help center, please edit the question.

Not so much an answer, more a comment, because I've never used it. But "R" might be something you could look at. Its here: r-project.org –  quickly_now Jul 5 '11 at 0:02
@quickly_now: It looks like it makes nice plots. I might switch to this instead of gnuplot. –  Dan Jul 5 '11 at 0:08
What is the point of this question? There are languages that are good and used for numerical work, and there are languages that are not good and not used for it - and they don't matter in that field. If I say brainf*** (and with some strange stroke of faith find some weird case where it was used for something alike) would you consider it? What would learning such a language prove? –  Rook Jul 5 '11 at 0:17
@Dan - I believe R can do a lot more than just nice plots. I've heard of it being used for very complex analysis, though mainly statistical. –  quickly_now Jul 5 '11 at 1:00
R is indeed used for much more than plot making. It's geared towards statistics but it can do just about anything any other languge can do –  geoffjentry Jul 5 '11 at 1:08

3 Answers 3

up vote 1 down vote accepted

Perl has PDL which has a rich library through CPAN, and of course there's matlab, octave, mathematica, R, and so on.

EDIT: Just double checked, and Perl's PDL does indeed integrate with LAPACK via PDL::LAPACK, and with BLAS via PDL::LinearAlgebra, PDL::LinearAlgebra::Real, and PDL::LinearAlgebra::Complex.

I suppose the real question here is, if you're looking to doodle around with some ideas you can do it in just about any language. The problem with using other languages is that you begin to fight the language itself when dealing with less than ideal data (e.g. the ever-present ill-conditioned matrix).

I had a Numerical Analysis professor way back in the day that hated anything but FORTRAN because languages like C would flip between single and double precision calculations without warning. (I know it's much more well-defined now, but back then gcc was just a blip and ANSI was just a dream).

For example, imagine trying to do something in javascript (I know... perish the thought). You can't even get basic integer arithmetic to work in that language.

My suggestion is to use NumPy or Perl's PDL if you need to also tie into system (e.g. databases, web interfaces, etc), or use R/Matlab/Mathematica if you're closer to "pure" math, otherwise fall back to the standards Fortran and/or C.

share|improve this answer

I'm no longer doing numerical work (thank G-d) but a book that really make me curious to use a language for numerical work was F# for Scientists. It has been a while since I read that I don't know how far things have changed but it's for sure a departure from the Cish code I learned in college (with a strong Numerical Recipes in C influence).

The same author has a book called OCaml for Scientists. I don't know if it as good as the F# one but the Jane Street Capital paper on OCaml also makes me interested.

I think it's worthwhile learning. It extends the toolbox far from the usual C/C++/Python/Matlab code and stretches the mind, which is a worthwhile exercise in itself. :)

share|improve this answer

I'm currently using Clojure for numerical analysis, and finding it very productive.

Some nice features:

  • You get easy access to any Java-based libraries like Weka or Colt
  • It's great for interactive development / quick tests at the REPL
  • Incanter is a very nice numerical and visualtisation library for Clojure (inspired broadly by R)
  • Lisps in general are great for producing DSLs for your problem domain
  • I've found the emphasis on functional programming to be a good fit for numerical work
  • The concurrency features are amazing. It genuinely feels like you have an army of little numerical helper-bees at your command.....
  • Great community, lots of active development in many areas

It's still a little bit bleeding-edge though! You'd be one of the "brave few" experimenting with Clojure for this kind of thing at the moment.....

share|improve this answer

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