6 ms·
Clojure 1.5.0 RC 1 released
- phren0logy 14y agoChange log: https://github.com/clojure/clojure/blob/master/changes.md https://github.com/clojure/clojure/blob/master/changes.md
- lkrubner 14y agoThe reducers sound interesting. The new agent/thread commands sound very interesting: clojure.core/set-agent-send-executor!, set-agent-send-off-executor!, and send-via The concurrency primitives have been Clojure's biggest conceptual breakthrough so far, and if they extend that to the automation of thread pools and executors that would amount to building on top of Clojure's greatest strength. I am less interested in the threading macros (thrush). I dislike the fact that Clojure can, in a sense, be written forwards or backwards. There is a sense of Perl's "there's more than one way to do it" that I dislike.
- ataggart 14y ago>I dislike the fact that Clojure can, in a sense, be written forwards or backwards. If you're referring to the distinction between -> and ->>, it's not about direction preference, but rather that functions that conceptually work on a single subject (e.g., conj, assoc) typically take that subject as its first arg, whereas functions that work on a sequence subject (e.g., map, filter) typically take that subject as its last arg. From that consistency emerges the two different threading macros.
- kenko 14y agoThe parent is almost certainly referring to the distinction between: (-> (initial) a b c d e) and (e (d (c (b (a (initial)))))) I find -> and ->> useful, but the new threading operators kind of silly; they're very easy to implement in terms of -> and ->>, or in terms of higher-order functions, and don't really cover all the use cases one would want---it offends my sense of aesthetics to have them (in their particular implementation) added to the core ns.
- vorg 14y ago(-> (initial) a b c d e) is like "The city on the bay in California" and (e (d (c (b (a (initial)))))) is like "The Californian bay's city". These variations are different thematic structures to language.
- pyrtsa 14y agoIn my view it's exactly the opposite: (-> (california) bay-in city-on) ; "The Californian bay's city" vs. (city-on (bay-in (california))) ; "The city on the bay in California" The former ("->") starts with what's fed into the pipeline, the latter starts with what you get out of it. In addition, "->" avoids the nesting of expressions regardless of the number of steps, which might be useful in some cases. But both styles have their place.
- timbaldridge 14y agoUse it every day and you'll probably think different about it. (baz 33 (bar 12 (foo 33 (+ 1 42)))) Is way harder to read than: (->> (+ 1 42) (foo 33) (bar 12) (baz 33))
- dkersten 14y agoI totally agree and personally love using -> and ->> but I've heard people say that the idiomatic way is to use let instead: (let [fortythree (+ 1 42) foo33 (foo 33 fortythree) bar12 (bar 12 foo33) baz33 (baz 33 bar12)] baz33) I understand the logic behind preferring let and a lot of times it really does make things clearer to have everything named and explicit, but especially in prototype code, I find the need to name things to get in the way. I would prefer not naming things over badly named things, for example, and that's usually how I decide between let and thrush (all things being otherwise equal).
- vemv 14y agoMany languages are subject to such assymetries: at times one writes nested calls, and at others, chained calls. a(b(c())) a().b().c() the latter form requires less mental overhead so why not favour it whenever possible?
- oskarkv 14y agoThere is a lot of stuff in Clojure that can be done in more than one way. I know that Python focuses on "only one way to do it", but Clojure's focus is on simplicity, as defined by Rich Hickey in Simple Made Easy [1], and that is a much better focus. I find that, as Rich says (and I'm paraphrasing), simplicity is by far the most important concern when programming. It dominates all other concerns in terms of importance and payoff. I believe I have become a much better programmer since I learned Clojure and listened to Rich's talks. [1] http://www.infoq.com/presentations/Simple-Made-Easy http://www.infoq.com/presentations/Simple-Made-Easy
- vorg 14y ago> Clojure can, in a sense, be written forwards or backwards Clojure can in many senses be written forwards or backwards. By defining this short macro somewhere... (defmacro topdown-tale [& stmts] `(do ~@(reverse stmts))) we can write our top-level control statement at the top and the functions it calls underneath, by bracketing with... (topdown-tale ... )
- vosper 14y agoFor a while it seemed like Clojure was capturing a chunk of mindshare, but now I see more slides and presentations in which people are getting things done with Scala, and the "new hotness" factor has moved to languages like Rust. Does anyone have an opinion on whether Clojure still has a chance to become a major language with widespread adoption?
- leibniz 14y agoClojure has a chance to become a major language among those who do not fear parentheses.
- cageface 14y agoLisp in any form will never be mainstream. That doesn't mean that Clojure can't establish a survivable niche for itself but it will never be as popular as Ruby or Python, never mind Java.
- jared314 14y agoLanguage adoption does not happen at a linear rate. Ruby languished for a decade until Rails made it hot. Javascript was a neat toy for years, until cross-browser frameworks, like Prototype and JQuery, made it developer friendly. The revival of Erlang, and Lua, is also very interesting.
- wonderzombie 14y agoHere's a good talk from Rich Hickey about the underpinnings, mechanisms, and rationale behind reducers: http://www.infoq.com/presentations/Clojure-Reducers http://www.infoq.com/presentations/Clojure-Reducers. I highly recommend it. As he says, it's based off of some concepts from Enumerator/Iteratee, which AIUI originated or was explored initially in the Haskell space: http://www.haskell.org/haskellwiki/Enumerator_and_iteratee http://www.haskell.org/haskellwiki/Enumerator_and_iteratee. I found Hickey's presentation a lot easier to understand.
- zephjc 14y ago> Set and map constructor functions allow duplicates Awesome, finally!
- earthboundkid 14y agoWell yeah, but wait for Arc 1.5. That'll blow it away. :-P
- kxs 14y agoI detect mild arcasm...
- siscia 14y agoI don't really get why we are caring if clojure will spreand or not. Would be cool if everybody asked to make a website in compojure and enlive instead of RoR, but I didn't learn ckojure for that. Who learn clojure is doing so because it will teach him a new way to think. (Clojure will really change the way you think especially if you come from OOP) The way in which clojure is build makes very difficult to create a single huge framework and it is not helping. You learn Ruby on Rails to build website, not ruby. (That because a framework, for definition, let you do things in just its way). Clojure do not have frameworks, it has a good number of libraries that you can modulate and use as you wish, there is not just one way to do something (macro...?). (Honestly I believe that it is good, especially if you are the kind of programmer who likes to think). Then what the 1.5 version is bringing (reducers) are pretty cool IMO, then I see the other macros cond->, cond->>, as->, more like sugar, but I have never used it so I am sure I will be surprised.