Hacker News new | ask | show | jobs
by dhkl 5054 days ago
> by and large Clojure basically obsoletes Ruby and Python

Care to qualify how Clojure obsoletes Ruby or Python? Both of those languages have great tools (rails, for example) that those in the Clojure communities have great respect for. As a Clojure and Ruby/Rails programmer, I share your enthusiasm for Clojure and lisp, but I can't see Clojure pushing either Ruby or Python out of the water any time soon.

2 comments

> Both of those languages have great tools (rails, for example)

I am surprised a Clojure programmer would have much respect for Rails. Its aggressive share-nothing approach leads to inconsistency, poor performance, awkward architectures, and over-reliance on external state management.

Perhaps one might admire it for making a bold claim about configuration vs. convention, but a valid criticism of Rails is that they went so far along the convention line in rebellion of bad tools like Spring that now they get accused of excessive magic.

> But I can't see Clojure pushing either Ruby or Python out of the water any time soon.

Like I said, success is fashion. But then, people said this to me about Git Vs. SVN after I gave a tech talk to a bunch of ruby folks about how git would take over the world. Two people left that talk and went on to found Github, so... "High Fashion."

Clojure has all the power of Ruby's dynamism, but with a better solution to the expression problem (protocols are namespace contained, allowing for monkey-patching that doesn't taint the world). It has access to a lot of fantastic high-performance libraries. It can safely deal with high degrees of parallelism with a degree of ease few environments can claim. It has a minimalist syntax which can compete with even the most terse and convention-driven ruby syntax (i.e., Compojure vs. Sinatra).

Similar complaints can be leveled at Python with less of a performance angle and more of a power angle; Clojure gives you access to many of those features that the python community feels are "too awkward" to use in the OO world, but are entirely natural in the Lisp world.

So yeah, every time someone writes a server in Node.js I think to myself, "You could have done it in Clojure and had just as much dynamism during development, just as easy a deployment story, and also perform easily an order magnitude faster under load, and you don't have to run like a scared child from parallelism."

> I am surprised a Clojure programmer would have much respect for Rails. Its aggressive share-nothing approach leads to inconsistency, poor performance, awkward architectures, and over-reliance on external state management.

When evaluating what tool to use for a project, there are many things to take into account other than the technical superiority of the tools. Relevance Inc, one of the strongest backer of Clojure, still make use of Rails for client projects. Rails' huge web dev ecosystem really made many common tasks as simple as importing a gem here and there and making a few method calls. It all comes down to the right tool for the right job. I'm interested in your take on how Rails' "share-nothing approach", awkward architectures etc.

> Clojure has all the power of Ruby's dynamism

Yes, and then some. Without repeating what you have already said, I would add efficient persistent data structure to the Clojure's list of awesome tricks. Doing functional programming in ruby and python, for example, will force you to trade value immutability with efficiency -- a penalty that one does not have to pay in Clojure.

Clojure is definitely gathering a lot of following. Like many others, I have picked it up, played with it, and never looked back.

But going back to what was said before. Yes, Clojure is awesome. No, Clojure is not obsoleting Ruby or Python any more than those obsoleted PHP, at least not now.

I enjoyed programming in Clojure, but chose Python once more for a new project because w/ Clojure I don't know which projects are doing well. (Templating? Web app library? Postgresql?).

Wrt Python I know I'll do fine w/ Django, Flask, Jinja2, Psycopg2, Tornado...

You have successfully gotten me to commit myself to looking into Clojure. Any good resources on learning/setting up, or should I go by the seat of my pants?
I find Clojure Programming (http://www.clojurebook.com/) to be an easy and practical introduction of the language. It often compare and contrast the Clojure way of doing things vs scripting languages like Ruby. After that, Joy of Clojure (http://joyofclojure.com/) dives deep into the whys of the language. Even though it was written against Clojure 1.2, it covers advanced topics like continuation passing style that were left out of Clojure Programming.
Cheers; this is going to be fun weekend :)
There are some great books out there, so pick a few and go to town.
Indeed, is there a Clojure equivalent of Scipy / Numpy / Matplotlib? These are invaluable for scientific computing.
Clojure arithmetic is fast enough if you add optional type annotations or otherwise take advantage of unboxed values. Ordinary calculation-intense code will be hundreds of times faster than in Python which might be enough in most cases.

If you need deeper support for vector math, scientific calculations, and the like then Incanter is probably what you want. It does all the complicated fast math stuff that always benefits from carefully planned and hand-tuned libraries.

To be clear... the benefit of Scipy / Numpy / Matplotlib that I'm alluding to is not (necessarily) runtime efficiency -- though, given that many of the linked libraries are standards (eg. LAPACK) and compiled C / Fortran, it is efficient for many operations.

The benefits to scientists are the developer efficiency (rapid prototyping), comprehensive libraries (scientific functions and plotting), interfaces similar to MatLab (eg. slicing), and its standing in the scientific community. It would sort of defeat the purpose to spend valuable research time to reinvent the wheel in another language -- though I would switch to a LISP variant in a heartbeat if there was comparably functionality.

Take a look at Incanter:

http://incanter.org/