Hacker News new | past | comments | ask | show | jobs | submit login

It's also very pragmatic, and probably most used functional languages in the industry at this point.



> probably most used functional languages in the industry at this point

Perhaps, though unlikely[1] (Haskell seems to have been picking of steam of late).

[1] https://trends.google.com/trends/explore?date=today%205-y&q=...


wish that were true, but i doubt it. scala, prolog and erlang are all higher on tiobe index.


I personally don't view Scala as a FP language, it's a FP/OO hybrid. It's not opinionated in that regard, and a lot of code in it is written in traditional OO style or a mix of the two.

Erlang is another widely used functional language, but it's not very widely used outside the telecom niche. Clojure has the advantage of running on the JVM, and makes it easy to target a much wider range of domains.


Clojure is also a hybrid. The other part is called Java or Javascript. This is claimed as an advantage, since there is already a lot of functionality in another language to be reused by a direct interface. Some stuff is simply deferred to the host language and since the other part is based on OOP, applications will then be a mix of more FP-oriented code calling OOP-oriented code.


This is an implementation detail, and doesn't affect the API presented to the user. For example, consider the clj-http library that's backed by the Apache http Java library internally https://github.com/dakrone/clj-http . As a user of clj-http, I don't know or care about the fact that it's a wrapper around OOP code.

Furthermore, if you wanted to, you could reimplement the internals in Clojure and the users of the library wouldn't be affected.

Being able to leverage existing mature libraries is a huge advantage, and the fact that they can be used via idiomatic functional APIs provides the best of both worlds experience.


The author of such a wrapper library writes this hybrid code.

Wrapper libraries are one way to deal with hybrid code.


Sure, just like if you did FFI in CL. I'm not really sure what your point here is.


right, but technically so is Clojure - you can get your hands dirty and mutable with relative ease.

Scala's problem is that they marketed it as "we're almost java - you can just sprinkle some functionalness on your code as you go and you'll be fine".


Clojure is a lot more focused and opinionated. It's unarguably a functional language first and foremost. Note that you can write any style of code in any Turing complete language, the key difference is what style of code the language encourages.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: