saying only purely functional languages are really functional is autistic, any language is a FP if it implements at least partially the ideas of the lambda calculus, which lisp clearly does (in fact it was the first one).
>I heard clojure push immutability upfront or something
Clojure is more purely functional than scala but less than haskell, everything is immutable by default its only impure to allow you to incorporate existing java libraries with mutable code.
By your standards literally only a few rarely used academic languages are really "functional" i.e. maybe haskell and a bunch of purely functional lisps made by academic programming language theorists and used by no one else.
>algebraic data types / type classes
Meme. Plus non FP languages already have algebraic product types baked into how most languages work. And with a little more work you can easily simulate sum types in plain old java/js/etc. as well. There is nothing superior about FP modeling with an ornate type system than with objects/classes. Static FP languages use types for modeling because they don't use objects, it's simply an alternative way of modeling the domain, obv. Clojure is the exception here being data oriented and modeling data as EDN or w/e.
>algebraic data types / type classes are much stronger concepts that allows smarter compilers than what was possible with statically typed languages where 33% of what I write or read is type declaration.>I hope you are not denying that stronger guarantees on type correctness makes it hard or impossible to write certain classes of bugs from existing.
The static type guarantees are overhyped, maybe if this was 1982 or something where the compiler was the only check on errors but in this modern age of linters, static code analysis, automated unit/integration testing, continuous integration etc. the benefits of this are probably 80% redundant for dynamic languages and even more for static OOP languages.
Also I feel like people who say this never took a class on programming language theory or compilers. People saying the ornate type system of Scala/Haskell makes it superior are missing the fucking point: the types are fundamentally there to help model data, compile time checking is a really trivial part of the reason for their existence in those languages. Saying the type system of those languages makes them better is like saying "language A does X and language B does Y and thats why A is better than B, B doesn't even have X!!!" It isn't better, its just different
. Again, please think deeper than just just the level of a freshman learning python, programming languages are there to help the programmer MODEL THE PROBLEM DOMAIN, and there are different ways of doing that like classes/objects.
Yes, there are some impressive optimizations made by compiler writers of Haskell, Scala, and even Clojure (since it compiles to jvm bytecode), but even with that effort functional programming fundamentally is at odds with how computers actually work, which is procedurally. Machine architectures are inherently imperative von Neumann derived style, FP is a mathematical abstraction. Thats why even though Haskell runs insanely fast for a garbage collected languages, it will never be as fast as C/C++, golang or rust. A lot of this shit reads like basically parroting blogs/websites that shill Haskell but if you go to grad school of CS and actually learn about compiler optimizations at a high level you will learn how full of shit they are.
Furthermore the real problem with FP isn't speed but memory usage, which can become a problem esp for scaling. The immutable data structures, despite all best optimization efforts, in languages like Haskell/Clojure use a TON of memory, I'm not talking a trivial amount but potentially gigabytes, think of a web environment where you have to handle lots of concurrent connections, file uploads of images, video files, etc. you need all the fucking memory you can get lest 1 server running your app can only handle 100 users or something.
This isn't to say functional programming is bad, but the "advantages" of it are generally overhyped and not worth forcing the developer into a functional style 100% of the time. People who shill pure FP as the solution for everything have no idea what they're talking about when their experience is writing toy programs and working through SICP or the Haskell elephant book or w/e. The only remotely viable FP language is Scala, which isn't pure anyway and is like Java larping as Haskell. But even that isn't necessary. The rest of it is contained to academics and amateurs who real Stallman/Paul Graham blogs.
In any case the FP hype wave blew over the mid 2010s and now low level shit like go/rust is the hype, or just plain Java/C#.