Posts in category clojure

the pure evil..)

Wanna see the pure evil? Here you go:

look what we have here:

(defn my-add[3 45]
    (+ 3 45))
  1. the lack of understanding the difference between symbols and numbers
  2. the (+ 3 45) expression is an application of a procedure '+ and it must be always evaluated to 48
  3. why square brackets are here - is it an array or something? =) Oh, it is a different type of structure, but why to expose it in this level? How about the principle of less astonishment and 'don't make me think/switch'?

So, what does it like? It is an emergence of something a-la Node.js or Clojure community - a lot of buzz and excitement together with lack of understanding of the basic principles.)

shall we continue?)

Reducers? Oh, come on..

There are a disturbance in the force caused by an unprecedented paradigm-shifting event - blog post by Rich Hickey, the greatest JVM language developer:

Amazingly, reducers was not invented by this great mind, and being around for quite while. There is a paper, which won several awards, published in 2009 about how to use the concept of reducers to deal with idiot's code (that uses global variables) to make it some-how run in parallel with minimum modifications. (they wrap those variables into another ADT and implement their own green threads and scheduling. All together it is called MIT Cilk.)

But it seems like an adaptation of an old idea from functional programming world (in which MIT is the years ahead of anyone else) to address actual problem faced by industry - how to run idiot's code after on multicore with minimal changes. Btw, Intel already licensed Cilk and now developing and pushing its own implementation. They even created a new branch of GCC 4.7

So, now we could see some connections.. Some smarties at MIT got grants, adopt some proven concepts, and re-implemented them "in a modern way" - using STL.))

And now, the greatest inventor of programming languages, after just a 3 years, found a novel way to back-port the concept back to.. what he called his Lisp 1, and the crowd froze in admiration. Well, we also enjoying.