Proposal from the Clojure?

Asked

Viewed 396 times

8

Recently I heard about this programming language, Clojure, it uses only functions, is not typed, and appears to be quite complex, this is an example of a function that takes a parameter and does the multiplication of this parameter by itself.

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

from what I have seen is also not necessary the use of comma to separate the values, is it worth investing time to learn Clojure? Researching found very little about it and still do not understand your real proposal?


In case you’re interested, I found a compiler online!

  • What gave Unlike, could speak a way to improve the question?

1 answer

6


If it is worth investing it is something personal and each has to decide on its own analyzing its objectives. If you want to know if she’s popular, it’s not, like all functional language, which might be a shame. Among the functional ones it is neither the most popular nor the least popular. Its use is more common in academic 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 seem to already know that language is functional (there is comparison with OOP and with imperative) which is one of the existing basic paradigms. Understanding the goal of this paradigm already understands much of the goal of Clojure.

It tries to use a more "clean" and declarative syntax, so everything looks like 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 operator Infix and it would be written like this: x * x. Some people prefer to understand how Multiply(x, x). Note that parentheses have a primary function (s-Xpressions). This idea comes from language Lisp. This syntax usually allows very concise and expressive codes.

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

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

The language usually run over the JVM (chiefly), CLR, Javascript, among others hosts, benefiting from what this infrastructure can offer.

Official website. There has a rationale.

She was famous here because Nubank adopted almost everything. I doubt I had a technical reason, almost always like the CTO in disguise.

In general the person can justify technically, but it is never an expressive gain and does not usually consider the losses. But it can be "smart" in a sense. You force people to work their way because no one has any experience with language, you have to follow the cake recipes created there. The person is left with less job option focusing on a technology that no one else uses and will tend to leave less than elsewhere. I mean, it would be a political decision.

I remember a software case that was made in Scala. I had zero technical reasons to choose this language, it was just like the person who did it. The person abandoned the project, then ran after someone to continue. Or did not find buoy people or people expensive. Only loss.

Recently an important startup Brazilian had to buy the company that takes care of Clojure not to be without language support they chose.

  • 2

    Well, taking advantage of the line, there is a book in English that is free and can be accessed Here

  • Uncle Bob likes Clojure https://blog.cleancoder.com/uncle-bob/2019/08/22/WhyClojure.html

  • @Piovezan absurdly wrong reason to adopt a language. That’s why I think he overrated. Interestingly it is a language easier to apply OO than most people say OO around :D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.