r/functionalprogramming • • Oct 05 '21

Question In your opinion, what functional programming language is most suitable for scientific / numerical computing?

The answer must take into account both the capabilities of the language (e.g. performance, ease-of-use, efficient ffi, parallelism, GC, etc...) as well as available ecosystem (i.e. developing tools and existing numerical/scientific libraries).

So far I've explored a few like Haskell, OCaml, and various Lisps like Common Lisp and Racket. I was not a fan of Haskell and there doesn't seem to be much in the way of numerical libraries. On the other hand, I quite liked OCaml and despite the relatively small community of users, there seems to be quite a decent amount of scientific libraries for it (e.g. the excellent Owl project). I have not tried anything parallel yet with OCaml, but there seems to be a consensus that the language is not great in that regard. I was also impressed by the near-C speeds that Common Lisp can offer, but at the same time I didn't like the language that much. I found Scheme (e.g. Racket) a lot nicer to work with, but again, the ecosystem of scientific libraries is relatively poor (I think that's true for all Lisps).

I'm looking forward to reading everyone's opinion on the subject.

24 Upvotes

31 comments sorted by

View all comments

Show parent comment

7

u/strawman53 Oct 05 '21

Julia is further towards the functional end of the spectrum than python, while being similarly mathematically focused. Good type system (though dynamic), great performance and a repl if you want that. Also very good learning material from MIT and the 3blue1brown guy that I'm currently going through.

7

u/pihkal Oct 06 '21

To second strawman53, Julia is probably the closest to functional you're going to get. None of the popular scientific languages (Matlab, Python, Julia, R, Fortran, etc) are especially functional.