r/functionalprogramming • u/jmhimara • 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.
View all comments
Show parent comment
5
u/trannus_aran Oct 06 '21
I'd actually argue clojure's the best functional language for science, considering the explicit efforts by the scicloj community. You mention performance, which is ironic, given that clojure was designed differently from traditional lisps specifically for that reason!
Clojure is slow to start from the command line, but that's inherent to the jvm itself. And in fact there are newer solutions like babashka that do run at native speeds, taking advantage of graalvm to produce native machine code.
And of course nowadays you can use any python library like a native Java/Clojure library, thanks to libpython-clj