Live data from Hacker News

Clojure 1.7 is now available

blog.cognitect.com

21–30 of 125 posts

Re: Clojure 1.7 is now available

#21
post #15

>Transducers are composable algorithmic transformations. They are independent from the context of their input and output sources and specify only the essence of the transformation in terms of an individual element. Because transducers are decoupled from input or output sources, The biggest thing holding me back from learning Clojure is that I fear it will take me a decade to become remotely competent in it.

If you have an understanding of functions like map, filter, and reduce, transducers are actually pretty easy. Say you have `(map inc [1 2])`. You can run that, and get `'(2 3)`. A transducer is the `(map inc)` part of that call (slightly confusingly, this isn't partial application or currying). You can apply it to something like `[1 2]`, but you can also compose with it, by combining it with say, `(filter even?)` to…

[deleted]

Re: Clojure 1.7 is now available

#22
post #16
post #9

It would be great to see a refactor of some code using transducers to get a better sense of what they're useful for. From an abstraction standpoint, I can see the attraction; but I am having a tough time imagining how it would improve code in practice.

If you don't know Clojure, you should know that Clojure has a sort of generic collection type called a 'sequence'. Arrays, Lists and Lazy Sequences are data structures that implement the sequence interface. There is a standard set of functions, 'map', 'reduce', 'filter' that operates on that sequence interface and provide a common set of functions for different kinds of datatypes. This lets the programmer reuse code…

You're mixing up `seq` and `coll` here. Most of the stuff you said is not true.

Re: Clojure 1.7 is now available

#23
post #12

>Transducers are composable algorithmic transformations. They are independent from the context of their input and output sources and specify only the essence of the transformation in terms of an individual element. Because transducers are decoupled from input or output sources, The biggest thing holding me back from learning Clojure is that I fear it will take me a decade to become remotely competent in it.

That's not a very plain-language description of transducers. Transducers are functions which can be applied to any sort of collection or sequence. You can use then to do something like filter a collection or an input stream with the same code. They are basically just a way to make things like 'map' and 'filter' work on datatypes other than sequences, such as streams or channels. http://blog.cognitect.com/blog/2014/8/…

Again, that's not true. Transducers are about reducing things. That's why a transducer first needs a reducing function. But I won't go into details what trasnducers are. There is many good (and long) blog posts about it.

Re: Clojure 1.7 is now available

#24
My only negativity with Clojure isn't really with the language itself, but with the Debian / Ubuntu packages, they're way outdated. Not sure who ever maintained them, or why they stopped doing so 1.4 being the last version. Outside of that for anyone wanting to check it out, you could try downloading LightTable and using ClojureScript, seems to be close enough I am able to use Clojure books with ClojureScript, not sure entirely of it's differences or how backwards compatible one is meant to be with the other, though I suspect they're meant to be near identical aside from their available libraries maybe.

Re: Clojure 1.7 is now available

#26

>Transducers are composable algorithmic transformations. They are independent from the context of their input and output sources and specify only the essence of the transformation in terms of an individual element. Because transducers are decoupled from input or output sources, The biggest thing holding me back from learning Clojure is that I fear it will take me a decade to become remotely competent in it.

Clojure is sophisticated [0] but it is hard boiled down to necessary complexity. This means that ordinary language features like interop [1] are well sugared and more abstract concepts like transducers are simple to implement and map well to their description [2]. Stuart Halloway's Programming Clojure captures this idea.

[0] and big for practical purposes like Common Lisp.

[1] you can get at all of Java perhaps better than you can from Java using the REPL.

[2] like lexical scope and continuations in Scheme.

Re: Clojure 1.7 is now available

#27

My only negativity with Clojure isn't really with the language itself, but with the Debian / Ubuntu packages, they're way outdated. Not sure who ever maintained them, or why they stopped doing so 1.4 being the last version. Outside of that for anyone wanting to check it out, you could try downloading LightTable and using ClojureScript, seems to be close enough I am able to use Clojure books with ClojureScript, not su…

The reason is that nobody (that I know, at least) uses them. The Clojure community uses leiningen, and leiningen takes care of fetching the version of Clojure a specific project needs. There is no point in installing one version of Clojure when the core is small enough that every project can have its own.

Re: Clojure 1.7 is now available

#28

My only negativity with Clojure isn't really with the language itself, but with the Debian / Ubuntu packages, they're way outdated. Not sure who ever maintained them, or why they stopped doing so 1.4 being the last version. Outside of that for anyone wanting to check it out, you could try downloading LightTable and using ClojureScript, seems to be close enough I am able to use Clojure books with ClojureScript, not su…

Clojure is often billed as "just another JAR" and in my experience I've never felt the need to install via any package manager. My workflow often consists of a new leiningen project where I define the version of Clojure that I want to use for the current project, along with whatever I else I need for the task at hand. Likewise, if I just need a quick repl to test something out, I'll simply use `lein repl` and fire away.

Re: Clojure 1.7 is now available

#29

My only negativity with Clojure isn't really with the language itself, but with the Debian / Ubuntu packages, they're way outdated. Not sure who ever maintained them, or why they stopped doing so 1.4 being the last version. Outside of that for anyone wanting to check it out, you could try downloading LightTable and using ClojureScript, seems to be close enough I am able to use Clojure books with ClojureScript, not su…

It really doesn't make sense to 'install' clojure the language. Generally one would use apt to install java. Then, you'd download 'lein' the clojure build tool (which does not require a clojure 'install'), and then specify the clojure version in your project.clj file. Lein builds your project and downloads the correct clojure version.

For distributing your app, you just compile it to a JAR, and the user only needs plain old java to run it.

Post reply on HN