The official Clojure blog, run by the Clojure/core team, covers language features, libraries, and community events.
HN links it for core.async, reducers, and ClojureScript announcements. Many comments are Relevance job posts, and others discuss CSP and state in concurrency.
If I understand right (I may not):
In Python, the (complex, generic) iter() protocol is how every container provides a method to iterate itself, and reduce is a trivial application of a reducer (like your add function) to a container by using the iter protocol.
In Clojure, it's the opposite: there is a reduce() protocol and every reducible container knows how to reduce itself. the traditional reduce function just takes a reducer and a reducible and performs the reduce protocol on it.
As there's a bunch of different kinds of containers with different rules, the best way to implement the reduce protocol on them is different for each, and there might be weird specialized reducers that are parallel or asynchronous or lazy or whatever.
Transducers allow you to composibly transform reducers into different reducers, which can then be handed to the reduce protocol. As it turns out, most (all?) normal container->container operations, like map and filter, have corresponding transducers.
Here's the good part: if you have a reduce protocol and a complete set of tranducers, containers don't need to be mappable. The map(fn, iterable) function needs to know how to iterate; mapping(fn) doesn't care about containers at all, and is fully general to mapping any reducible for free. So you can write a transducer to produce the effect of any map or filter-like operation without touching iter().
As an added bonus, the code is more efficient:
reduce( add, map( lambda x: x + 1,…
San Francisco, CA - Zenbox. Software Engineer. [LOCAL | RELOCATE OK]
We're a YC company wrangling SaaS to work together (as they should), starting by bringing the biggest apps our customers use right into Gmail. We've been growing our team over the past few months, and looking to add even more awesome people.
We work with dozens of API's to show our users profiles of their customers without having to jump out of the email flow - imagine having http://www.youtube.com/watch?v=WtzqRSlgqkw available when helping customers.
Thousands of people use it every day for hours on end, and are happy to pay for it to make sure they can continue using it. But there's still so much polish and improvement possible.
We also spend time improving our tooling, and tools for other developers. As one example we've recently vastly improved the source-map capabilities of the ClojureScript compiler. We do it because we want to give back to the communities that have enabled us, because it helps us, and because it's interesting.
Looking for an engineer who loves the craft, who cares about building product, and is excited about helping customers.
We also explore some pretty awesome ways to escape from getting crushed under the heel of complexity, and we're all excited to start toying around with ideas like http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html for the frontend.
This is both UI and backend work.
Languages: Clojure, Clojurescript, Ruby, Javascript.
sean @…
Of course not, lazy is opt-in in CL, that wouldn't be idiomatic.
Besides, the semi-lazy approach of Clojure's pmap (allocate futures consecutively) doesn't seem to convince everyone:
https://stackoverflow.com/questions/2103599/better-alternative-to-pmap-in-clojure-for-parallelizing-moderately-inexpensive-f
https://www.reddit.com/r/Clojure/comments/20lxmv/just_what_is_the_overhead_of_pmap/
On the one hand, when you want to parallelize, you are delegating tasks to workers and you want them to do what they need, independently of you. But on the other hand, laziness introduce a dependency from you, because workers cannot produce a result before they are sure you really need it. This basically slows down parallelization and that's why I am not sure Clojure's pmap is a good general solution.
Note that Clojure Reducers, mentioned here in Zombie Metaphysics (ppmap:
http://www.braveclojure.com/zombie-metaphysics) and documented at https://clojure.org/reference/reducers, use strict sequences.
Laziness is great when you need it, but when you don't you shouldn't have to pay for it.
http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html
I don't know if the initial announcement still applies today; but I think ClojureScript encourages using Google Closure library for DOM manipulation and event handling[1]:
> The ClojureScript compiler emits JavaScript which follows Google Closure's code conventions, and then invokes the Google Closure compiler to generate compact, optimized JavaScript for delivery to clients. ClojureScript also makes use of the Google Closure library for capabilities such as event handling, DOM manipulation, and user interface widgets.
> It is possible to use ClojureScript with JavaScript libraries other than Google Closure, but those libraries typically do not follow the conventions of the Google Closure compiler and therefore will not be able to take full advantage of its optimizations.
They even have few wrappers to Google Closure Library under the `clojure.browser` namespace[1] (although from my testing, some of them, such as `clojure.browser.event`, is not compatible with ADVANCED_OPTIMIZATIONS.)
[1]: http://clojure.com/blog/2011/07/22/introducing-clojurescript.html
[2]: https://github.com/clojure/clojurescript/tree/master/src/cljs/clojure/browser
Durham NC (main office) - REMOTE full-time and contractors
Relevance, Inc.
www.thinkrelevance.com
Rails or Clojure Developers, Project Managers
http://thinkrelevance.com/jobs
We are Clojure/core (http://clojure.com).
Relevance has been voted as one of the Best Places to Work in the Triangle both 2010 and 2011 (Triangle Business Journal). We were also ranked #739 in this year's Inc 500|5000 list. We have a fantastic work environment that includes 20% Fridays (work on open source, giving back to the community, or internal projects) and a great benefits package.
Relevance is increasingly a virtual company and have many remote full-time developers around the country. We're now opening up the project manager positions to being remote as well.
Come work with some of the best Ruby/Rails and Clojure developers on solving interesting, hard problems that make a difference.
email us: jobs [at] thinkrelevance [dot] com
Include Hacker News in the subject line
Surprised that a thread about CSP in Lisp doesn't mention Clojure's core.async. CSP in Clojure is implemented as just another library and it's rock solid. While I don't claim to understand the implementation in detail, it's one of the more interesting and high leverage uses of macros I've seen in Clojure. It makes concurrent programming a breeze in Clojurescript as well, despite JS being single-threaded.
As someone who programs in both Clojure and Go there's absolutely nothing I miss from CSP in Go, and I would much rather do concurrent programming in Clojure.
Rationale: http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html
Code: https://github.com/clojure/core.async/blob/master/examples/walkthrough.clj
Presentations: https://github.com/clojure/core.async#presentations