Clojure proposal?

5

I recently heard of this programming language, Clojure, it uses functions only, is not typed, and appears to be very complex, this is an example of a function that receives a parameter and multiplies that parameter by it even.

(defn square [x] (* x x))

From what I saw also no need to use comma to separate the values, is it worth investing time to learn Clojure? Researching found very little about it and still did not understand its real proposal?

If you are interested, I have found a compiler online!

    
asked by anonymous 10.08.2016 / 13:42

1 answer

4

Whether it's worth investing is something personal and each has to decide on its own by analyzing its goals. If you want to know if it is popular, it is not, like all functional language, what might be a pity. Among the functional ones it is neither the most popular nor the least popular. Its use is more common in academia and specific applications, but can be used with greater or lesser success for all types of applications. I always say that learning new languages does not cause any harm, on the contrary, it always helps the programmer better understand computing and solve problems in more appropriate ways.

You already know that the language is functional (there is OOP comparison and imperative ) which is one of existing basic paradigms . Understanding the purpose of this paradigm already understands much of the goal of Clojure .

It tries to use a "clean" and declarative syntax, so everything seems to have functions (not even loops), for example * x x is the call of the multiplication function that passes as arguments the variable x 2 times. In other more imperative languages the syntax would use an infix operator and would be written as x * x . Some people prefer to understand how Multiply(x, x) . Note that parentheses have primordial function ( s-expressions ). This idea comes from the language Lisp . This syntax usually allows very concise and expressive codes.

Like most functional languages, it values state immutability , but does not try to be pure (state can to be changed under certain rules) and is not actually typed but can optionally use types ( gradual type ), so it facilitates competition using software transactional memory . It has (limited) extensibility of syntax, and the functions are first class, so they are treated as if they were data. It has polymorphism.

Obviously it tries to solve some problems that its creators believe that other functional languages have.

The language usually run on top of the JVM (mostly), CLR , JavaScript, and more hosts , benefiting from what this infrastructure can provide.

Official Site . There has a rationale .

    
10.08.2016 / 14:21