Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is your opinion on Clojure? [closed]

Tags:

clojure

lisp

People also ask

Is Clojure worth learning in 2022?

The Clojure community is growing stronger In fact, 25 percent of current developers have been using Clojure for a year or less, which is a great sign of the health of Clojure looking at 2022 and beyond. The Clojure community is enthusiastic and fast-growing and you will learn plenty if you decide to participate in it.

Why did you stop using Clojure?

It uses a lot of memory. It's hard to hire developers for it. It doesn't have enough Clojure based libraries and frameworks (i.e. Not interop based) The Lisp syntax is hard to read and unfamiliar.

Does Clojure have closures?

This is a perfect opportunity to enforce encapsulation to avoid drowning the client in board-implementation details. Clojure has closures, and closures are an excellent way to group functions (Crockford 2008) with their supporting data.

What is Clojure good for?

Clojure is being used extensively for processing large volumes of data. It is very well suited to data mining/commercial-AI (ie: Runa) and large scale predictions (aka WeatherBill). Clojure's concurrency story really helps in these data heavy domains where parallel processing is simply the only answer.


Consider learning it. If for no other reason then because you can actually use it in a real project.

You : Can I use this small Java library called Clojure?
Boss: Why do you need it?
You : For some concurrency improvements.
Boss: Ok.

What you're refering to by Lisp-1 vs Lisp-2 is the question of whether functions and variables share the same name space. In Lisp-1 Lisps, like Scheme and Clojure, they do. In Lisp-2 Lisps, like Common Lisp, they do not. This is mostly a matter of taste and/or convenience - it doesn't affect the power of the programming language.

As an example, in Clojure you can do this:

(defn my-apply [func arg1 arg2]
  (func arg1 arg2))

This is a function that takes a function and two values and applies the function to the values. For example:

user=> (my-apply + 1 2)
3

In Common Lisp, you'd have to write this as

(defun my-apply (func arg1 arg2)
  (funcall func arg1 arg2))

The reason you need "funcall" is that, since "func" is in the name space of variables, you cannot directly use it as a function, like you can in Clojure, which does not make this distinction. So you have to tell Common Lisp "please interpret this variable as a function and call it with these arguments". Another consequence of this is that to get the same result you must call "my-apply" like this:

=> (my-apply #'+ 1 2)
3

Here the problem is reversed: "+" is a function, but you want to pass it as a variable, so you have to "convert" it. "#'+" is short for "(function +)", btw.


I use Clojure and not CL because:

  • It communicates well with Java, so I can outsource my coding
  • It has access to the zillions of java libraries that do all sorts of things, including Swing and Weka
  • Since it runs on the JVM, you can more safely assume that your problem will work everywhere
  • If you can show the same libraries being used with much less code, you can convert Java programmers to the lambda way
  • And, most importantly, I don't get tied to Emacs

:wq


Clojure is a dialect of LISP so, yes, it's as powerful as LISP.

For no other reason than we now have a good LISP tool for the JVM I like this language.


I think the name is clever.