12 ms·
Why I am so excited about Clojure
- michaelochurch 13y agoClojure is badass the whole way through: great language, great designers, great support, great community. I don't think it will ever get more than a 2% share in the software world, but I think it can get the right 2 percent. At least, that's what I hope will happen. I also think that it will live (possibly even surviving the JVM) for a long time.
- skylan_q 13y agoI don't think it will ever get more than a 2% share in the software world, but I think it can get the right 2 percent. There will always be detractors. But then again, you can't teach a dog math. I spent a tiny amount of time getting to know Clojure. I liked what I saw, but some things confused me due to lack of looking into it/thinking about it. I'll need to spend more time with it to find out if I'm a dog. ;)
- JPKab 13y agoClojure is the first purely functional language I've ever tried to teach myself. I'm still learning, but I already find it a liberating experience to stop worrying about state and learn to love the function.
- cuttooth 13y agoIf a Lisp-like was ever going to explode, it would have done so within the last 55 years.
- dllthomas 13y agoRight, because nothing in the technological landscape changes, ever, in any way that could be relevant to the success of a Lisp-like language. I'm not saying I'm convinced a Lisp-like will explode, much less that it'll be Clojure in particular, and I do think it important to keep the history in mind, but I think you overstated things.
- cliffu 13y agoI wonder if any Rubyists said something similar pre-Rails.
- pjmlp 13y agoLisp suffered from the AI Winter and the lack of acceptance of GC based languages on mainstream computers due to their limited capabilities. Many of the capabilities of modern IDEs were already available in Lisp and Smaltalk environments in the early 80's, but you could buy a house with the price of those systems.
- tomp 13y agoReasons I believe Clojure will never be successful: (1) it's a lisp. This is 2013, compilers can deal with +-*/, I don't need to. (2) it lacks good documentation. Most functions are documented, but badly. In particular, they lack examples; sometimes they are really tricky to use (3) it lacks tutorials (on the main page). There is a set of pages that explain the basic concepts of clojure, such as datatypes, variables and multimethods/protocols, but they are really terse. I think Clojure assumes you already know lisp, quote, unquote, syntax trees, defs, vars, etc... (4) it's full of magic. You can feel it, but you can't really understand it without digging through the source code. I know OCaml, can read Haskell, and wrote a small library in closure. I still find it very hard do get around and very hard to learn.
- llambda 13y ago> it's full of magic. You can feel it, but you can't really understand it without digging through the source code. Are you trolling? If not, care to provide concrete examples? I've written a number of small applications in Clojure and I find that it /lacks/ magic, even in comparison to something like Python (which is generally highly un-magical). For instance, Clojure's namespaces prevent circular dependencies; while a simple example, this is idiomatic to the larger philosophy of Clojure and indicative of a general dislike of magic that permeates the language as a whole, in my experience.
- leishulang 13y agoLisper trend to write one-liners with functions such as map, doseq etc. with big combination chains with many other functions. When doing this in a dynamic type language with no documentation, I guess that's why he calls it magic.
- s_kilk 13y agoHow in hell does 'map' qualify as a magical function? Though I suppose that for a programmer who couldn't understand a simple concept like map, damn near anything would look like sorcery to them. ( to clarify, I'm not accusing you of being unintelligent , just wondering-out-loud )
- jdmichal 13y agoDoes Clojure still have a non-trivial impact on performance? And if it doesn't, does it still look as pretty? I only ask because the whole idea of using it for "Big Data" flies right out the window if it's significantly slower than plain old Java. Especially if it's slower using naive or expected Clojure methodology. And if there's not a speed advantage, than companies can find a lot more people who know and can work Java code than Clojure.
- willismichael 13y agoPerformance and scalability are two different things. My favorite example is to think of performance as being like the speed limit, and scalability as the ability to easily add more lanes to the road. Once there are enough vehicles on the road, it doesn't matter how high you set the speed limit, they'll still slow to a crawl. Now imagine if there was a trivial way to add more lanes to the road. Clojure has very nice concurrency mechanisms baked right into the language.
- optimiz3 13y agoThis doesn't answer the author's question. We know the difference between performance and scalability. How does it perform compared to Java?
- saosebastiao 13y agoIt is slower than java. It can approach Java with type annotations which aren't that hard to do. It is faster than any other dynamic language I have used, including python, ruby, javascript(v8), and lua(jit).
- graue 13y agoFaster than LuaJIT? At what? Did you run benchmarks to back that up? That's a very strong claim, and I've never heard anyone make it before. LuaJIT is unbelievably fast. I'd be extremely curious to see the proof. (As a side note, on some level it's hard for me to accept that Clojure is fast because using it feels gratingly slow — since all the tools take several seconds to do anything thanks to the JVM's startup time. `lein repl`: 4 seconds wait. `luajit`, or `python` for that matter: utterly instant.)
- agilebyte 13y agoJust a note for anyone interested in what was mentioned in the article but more comfortable with JavaScript. There is mori http://swannodette.github.io/mori/#mori http://swannodette.github.io/mori/#mori for persistent data structures. Callbacks are handled by Promises or say async https://github.com/caolan/async https://github.com/caolan/async For heavy compute tasks you can launch child processes under Node.js and communicate with one management process, the Cluster http://nodejs.org/docs/latest/api/cluster.html http://nodejs.org/docs/latest/api/cluster.html lib is experimental as of now.
- mhd 13y agoFor those who were around in the early '80s, was the Prolog/Transputer/FGCS hype similar back then? Plus ça change, plus c'est la même chose...
- pjmlp 13y agoMost of us only had BBS, if we were lucky, so hype levels were kept very low.
- boothead 13y agoIt would certainly seem to me (in London at least) that scala has most of the "enterprise functional programming on the JVM" pie. I hardly see any clojure jobs pop up. From what I've seen I'd say demand for FP skills looks like: Scala > F# > clojure > Haskell (really bummed about the last one!) In London finance circles. Does that sound about right?
- moomin 13y agoSounds about right, but there's certainly people working in Clojure: there's startups like MastodonC (who employ Vishal), there's ForwardTek who love it, there's a number of hedge funds based around it, there's the credit derivatives desk at Citi. There's some stuff at DB as well. But tbh, if you want a Clojure job, it wouldn't hurt to go to the clojure meetings at SkillsMatter. With all of that said, the market depth does worry me, especially for finance.
- dons 13y agoGot about 30 guys here using Haskell. More in other centers.
- deleted 13y ago[deleted]
- saosebastiao 13y agoMy excitement about Clojure led me to core.logic, which led me to kanren, which led me to Prolog. Am I doing it wrong?
- nickik 13y agoIf you want to write productive code, yes you are wrong.
- darksaints 13y agoConstraint Logic Programming is extremely productive in logistics planning problems which are NP-Complete/Hard. Even SWI-Prolog, which is hardly the fastest implementation out there, is faster than the fastest IP solvers I have found (Gurobi and CPLEX). Of course, if you want to coerce the word "productivity" to mean "making boring CRUD webapps quickly", you have a point.
- nickik 13y agoWhen you say Prolog, I think of the standard without CLP. Also if you want to do anything other then solving logical problem you will be better served with clojure/core.logic or anouther 'mainstream' language with a good logic implmentation.
- gphil 13y agoNot if those tools are helping you solve the problems you want to solve. Also, not if they're expanding how you think about computation. I'm willing to guess at least one, if not both, are true for you.
- saosebastiao 13y agoYeah, it is both. It does seem a little counter-intuitive to some people, and I get made fun of a bit for it.
- bionerd 13y agoI don't think it's going to explode. And I don't think it needs to. Even after decades there are still people who use Lisp-like languages and who find them fascinating and just right tools for their job. I, for example, am a huge fan of Common Lisp and I'm really glad to see new stuff happening around it and new people discovering it because there were times I was a bit afraid about its future. But will it ever dominate or explode? No, it won't. Same with any other Lisp. And it's okay.
- gdonelli 13y agoInteresting take: "Over the past 20 years or so OO has dominated the landscape and rightly so. It provides structure and a simplified way of organising your code. OO design patterns such as MVC are going nowhere. But today with live in a world with events, mobile phones trigger events, more intricate interaction with UIs and apps all trigger a vast amount of events and traditional OO doesn’t embrace this style of interaction as well. Instead functional programming copes better." We still need to organize our code tho, even with a functional language... and I have missed the abstraction of OO (Using node.js)
- frou_dh 13y agoI remember reading someone say that much of the class-based OO written in the wild amounts to little more than a function namespacing convention plus a way to jam in a bunch of hidden arguments. That hit home to what I was doing.
- dominotw 13y agoI keep hearing this over and over. I like the idea of just changing 'map' to 'pmap' everything just working over multiple cores. While cool,but really, Is there such a great clamoring for scaling programs over multiple cores ? I never hear anyone asking about it job postings. May be I am working in the wrong part of the industry than those mentioned in the blog post. But I rarely hear game programmers talking about clojure/ functional programming. Most popular clojure projects on github are web frameworks. I am puzzled why clojure is so popular among web developers if concurrency over multiple cores is its 'killer' application. From what I remember this paper never mentions 'concurrency' as to 'why functional programming matters' http://www.cs.utexas.edu/~shmat/courses/cs345/whyfp.pdf http://www.cs.utexas.edu/~shmat/courses/cs345/whyfp.pdf Neither does this( the only one?? ) poster child for lisp's success in wild talk about concurrency http://www.paulgraham.com/icad.html http://www.paulgraham.com/icad.html I think the whole multiple core thing is over blown in association with functional programming. I think it would be pretty misguided for someone to adopt a functional programming with multiple cores in mind.
- fogus 13y ago> I keep hearing this over and over. Hearing what? That pmap is a drop-in for map giving instant speed gains? That's odd. I've never heard that. Like anything pmap has its tradeoffs. > poster child for lisp's success You're conflating "functional programming" with Lisp. > I think the whole multiple core thing is over blown That's something that I would probably agree with. However, people tend to focus on that regarding Clojure because it provides more than one model for describing concurrent state changes. People get excited about that I suppose.
- dominotw 13y ago> That pmap is a drop-in for map giving instant speed gains? That's odd. I've never heard that. That was just an example of how programming without state makes it easy to scale it over multiple cores. > Like anything pmap has its tradeoffs. No one said anything about pmap being a drop in replacement for map. If pmap didnt have tradeoffs there wouldnt be a 'map' and just pmap.Common Sense. I am not sure why you are even mentioning that. As I said that was just an example of ease of writing multithreaded programs in clojure. Which was one of the main points in the blog post. Did you get a chance to read the blog linked to this post?
- kybernetyk 13y agoI really like Clojure. My only gripe with it is that you absolutely need to know the Java standard library/ecosystem if you intend to do anything non-trivial with it. (And my Java experience ended in 2003.) Though they are more and more 'native' clojure libraries being released.
- frou_dh 13y agoThough I haven't and most likely won't do anything substantial in the language, I've got a lot out of Rich Hickey's talks that have steadily appeared on the web. He seems an extremely thoughtful designer and steward.
- scrapcode 13y ago"...I knocked up a lot of stuff which I wanted to write about." ...you did... what?
- ww520 13y agoBoy, another blog echos the empty chant on functional being superior than OO without substantiating the claim. "OO design patterns such as MVC are going nowhere." Really? MVC is going nowhere? And how is functional organizing UI and model data better? You can promote a technology without trashing another one. People know what functional is and it has its niche as with any other things.
- willismichael 13y agoI think he meant OO and MVC aren't going to disappear. They're useful concepts, and functional isn't going to make them obsolete.
- swannodette 13y agoClojure actually embraces many of the great lessons of OO, you'll find them in the form of first class namespaces, a standard library built on abstractions not concrete types, a multimethod facility which supports derivation, and protocols which support local and future extensions in much safer nicer fashion than what the current popular OO languages provide. To your other points - Clojure does data great - much nicer than OO languages I've used. As far organizing UIs better Clojure programmers adopt many of the same patterns that are currently en vogue. However I think there are some more interesting new techniques just around the corner and we will be hearing about them soon enough.
- weavejester 13y agoI don't think it's useful to criticise other programming paradigms without substantiation, and it's hard to claim one paradigm is better than another without making some pretty large assumptions. That said, if you subscribe to the assumption that good software design is about separating a system into discrete elements of functionality, then the functional model is generally preferable over the OO model. In OO languages, unrelated concepts such as polymorphism, encapsulation, namespacing, inheritance and (often) mutable state are combined together to produce classes and objects. In functional languages, these concepts are generally kept separate.