haskellfunctional-programmingnumerical-methodsfinite-element-analysis# Lack of Finite Element Method implementations in Haskell - Any specific reasons?

I'm curious to understand why there seems to be a scarcity of Finite Element Method (FEM) implementations in Haskell, or any functional language. Given Haskell's purely functional nature, I expected to find numerous implementations of numerical methods.

My quick search on GitHub and Google Scholar didn't yield many relevant references. I came across a Quora question regarding the application of Haskell in handling large matrices, but none of the responses mentioned sparse matrices or FEM. Has there been any specific discussion or reasons within the Haskell community regarding the absence of FEM implementations? I would appreciate insights or references on this matter.

Solution

Most of the reason is simply that the set of people working with numerical methods and the set of people interested in languages like Haskell are almost completely disjoint.

What the numerics community cares about is foremostly that their code run fast, and secondarily that it be "easy" to use for non-programmer engineers/scientists (with a rather disputable notion of easyness, à la Matlab). Apart from that there's an attitude that choice of programming language "doesn't really matter because everything is Turing-complete", and that anyway the code doesn't contain the interesting mathematical derivations which are carried out separately on paper. In other words, in their mindset the only aspect of the maths that computer is involved with are *numbers*.

Consequently, they tend to go with languages that have a track record of use for numerical applications and then perhaps add an interface in a dynamic language around that (not so much for any abstraction purposes but simply to allow for scripting).

The functional programming community has a completely different focus, which is all about bringing mathematical *concepts* into the code, but not overly interested in tuning numerical performance. GHC can actually generate pretty fast executables, particularly competitive for complex logic, but for dumb numerics it can't take it up with a compiler like ICC that does all kinds of vectorisation etc. microoptimisations for numerics. Now, it would be possible to address this performance gap by writing a Haskell wrapper around optimised low-level routines in C (or Cuda), but that's not very interesting to FP people, whereas numerics people just wouldn't see any point in it because to them Haskell is just a weird fringe language.

I personally think that Haskell would be *excellent* for numerics, but it's not enough to just think that... we'd actually need to put in a lot of work to make it happen.

- Comparing lists in Haskell
- Is there a non-identity monad morphism M ~> M that is monadically natural in M?
- Problem with loading module ‘Distribution.Simple’
- Improving efficiency in Stirling numbers calculation
- Does sequencing an infinite list of IO actions by definition result in a never-ending action? Or is there a way to bail out?
- How to call pgQuery from postgresql-query?
- How to avoid whitespace after a tag (link) in Hamlet templates?
- Understanding type-directed resolution in Haskell with existential types
- Why is seq bad?
- Understanding bind function in Haskell
- How to create route that will trigger on any path in Servant?
- How do I use a global state in WAI middleware?
- nixos 23.11 cabal install mysql-simple problem - "Missing (or bad) C libraries"
- Is there a way to kill all forked threads in a GHCi session without restarting it?
- Why can an invalid list expression such as 2:1 be assigned to a variable, but not printed?
- Iterate over a type level list and call a function based on each type in the list
- How does this solution of Project Euler Problem 27 in the Haskell Wiki work?
- Why `Monad` is required to use `pure`?
- Can't do partial function definitions in GHCi
- recommended way to convert Double -> Float in Haskell
- Haskell profiling understanding cost centre summary for anonymous lambda
- Why is Haskell fully declarative?
- GHC Generating Redundant Core Operations
- Question about Event firing in reflex-frp
- Using Haskell's "Maybe", type declarations
- How can I elegantly invert a Map's keys and values?
- Why there is no output for wrapped IO in Haskell?
- What are the definitions of Weather and Memory in xmobar repo?
- Serializing a Data.Text value to a ByteString without unnecessary \NUL bytes
- Using Haskell with VS Code