
Analytics Insight: Top 10 Functional Programming Languages to Know in 2022. https://www.analyticsinsight.net/top-10-functional-programming-languages-to-know-in-2022/\|https://www.analyticsinsight.net/top-10-functional-programming-languages-to-know-in-2022/ :sob:

Yes, Python. Very functional

I wonder if they read my tweet and somehow thought that I was serious /s https://twitter.com/sorawee_p/status/1163725751822123008

> Yes, Python. Very functional Yeah, it’s not like Python’s creator has something of a reputation for being insanely anti-FP or anything…
Also, I don’t know much about PHP, but it’s news to me that it’s considered a functional language.

That read like a writing assignment for a PL class “Research a programming paradigm/style and write about languages that support it.”

@ben.knoble what score would you give? :smile:

So, ignoring Python, PHP, and Javascript (!?!!!), the rest of that list is literally just an exercise in someone typing “functional programming languages” into google and typing the top results.
What a waste of typing skills.

Also, I’m getting a little tired of many programming languages (including many Lisps) being included in FP language lists.
Lists like these are literally just a list of “languages with first-class functions” and might as well include C++, D, Rust, Zig, … (note: I personally consider Rust more “FP” than most Lisps).
Opinion: at this point, I don’t think a language can really be thought of as a “Functional Programming Language” unless it allows for the type-safe separation of pure vs. impure data transfer and the identification of pure vs. impure functions.
By “identification of pure vs. impure functions” I mean that since I can (using Scheme as an example) create a global variable and do set!
from within any function in a way that no one knows it’s happening makes it non-FP given my more strict definition. If there was a way of the compiler catching/defining that the function was impure, that’d be ok.
By “type-safe separation of pure vs. impure data transfer” I don’t necessarily mean strongly typed, but that there is some monadic type theory exposed. If function A is async and function B calls A, that implicitly makes B async. Likewise if A can throw/error, then implicitly so can B. If C wants to call B but doesn’t allow use of async or errored results, this should fail (hopefully at compile-time, but at runtime w/ a type error is also fine).

My take to reduce these lists: If it doesn’t have TCO, it can’t do proper FP. @massung These lists should ideally distinguish between “you can do pure FP in this language” and the stricter “You can prevent doing non-FP in this language”.

> you can do pure FP in this language That would include pretty much any language at this point, though. Only old languages that don’t have first-class functions would fail that test at this point.
> You can prevent doing non-FP… I see your idea here. I like the direction. I’d probably reword it to something about safety. I don’t necessarily want to limit the whole program, but simply to be aware of what I’m doing for safety reasons.
For example, if Racket’s core functions (e.g. map
, filter
, …) were marked as “pure” and that meant they could only accept pure functions as arguments, that’d be a big step towards FP IMO.
For all I know typed-racket can do this now and I just don’t know it.

>> you can do pure FP in this language > That would include pretty much any language at this point, though. Only old languages that don’t have first-class functions would fail that test at this point. Not if you require the language to implement TCO :slightly_smiling_face:

TCO can be a pain for debuggers, though.

You can still have an option to turn it off for debugging of course

Tail call is for looping. In languages with explicit loop constructs, you don’t see frames due to looping either.

Sure, but my point is that an FP language should be able to loop with only functions, hence TCO

(In case it’s not clear, I was responding to the point that TCO makes it difficult to debug)

Not having the callstack can be tricky.

Oh :)

OK, so, aside from all the talk about many of these not being functional languages > It is very popular among data science and machine learning teams … because of its easy-to-read and understandable syntax. Data scientist reporting in. I can assure you that that is most certainly not why we use Python.

(And the syntax just keeps getting worse with every release. :weary: )

Are you qualified as a data scientist though? I’ve heard real data scientists don’t hang out in a programming language chat forum (except maybe R).

I resent that accusation.
R is not a programming language.

It got syntax. It got semantics. It’s…. something.

ok. ok. I would pick Python for its easy-to-read and understandable syntax if my only other option were R.

Though, the last major thing I did was in R, so…. :thinking_face:

As a graduate of the University that claims to have invented R (one of the original co-creators was working there at the time), I must protest this unfair maligning of R :stuck_out_tongue: (while stating that I have never touched it, and the only other grad from there I know of who actually used R said she didn’t like it)

I actually don’t mind R’s syntax that much. But I think the semantics might be the best evidence we have for extraterrestrial influence on human activities.

OTOH…. it’s also much easer to sling numbers around in R than it is in Python.

6 years ago we took a grad level programming language class, and the project we decided to do is to formalize R…. We didn’t finish the project. Instead, we got a compilation of WTF facts.

Anyway. Give me a lisp that can talk to C libraries without any marshaling (And that isn’t Hy. Sorry, Hy.), and I will be very eager to help make it successful.

Can Guile Scheme do that? Or Common Lisp? (I’m guessing the answer is “no”, since you surely have already looked at both of them)

R or Matlab?

(I loathe R so much it’s sick)

I haven’t actually looked into guile. I believe SBCL uses a generational garbage collector.

I dont know R really but I might still take it over matlab because most exemplary matlab code is not at all concerned with being a runnable program and instead is very notebook mentality