Hacker News new | ask | show | jobs
by elohesra 4465 days ago
> The problem with clojure and all lisps, as I see it, is that they make it easy on the author, hard on the reader. It's so simple to create your own special DSL that everyone does it. Now i have to learn a thousand languages.

This is a bit of a problem in Clojure because Lisp gives everyone the ability to play at being a language designer, but there's a reason that most language designers are extraordinarily experienced computer scientists: designing easily readable languages is hard.

Where, in my opinion, Lisp's DSL abilities shine especially well is when the Lisper is just taking a well understood domain with well understood terms and translating those terms into Lisp. Where Lisp's DSL abilities can shoot the Lisper in the foot is when the Lisper creates a DSL for a problem domain that's less understood, and where the terms used in the DSL will be less immediately obvious.

A good example of Lisp's DSL abilities really shining through is Hiccup, the HTML compiler. For instance:

(hiccup.core/html [:body [:div { :id "divTop" :class "headingcontainer" } [:h1 { :class "superheading" } "Welcome!" ]]])

is understandable because we understand the concepts of 'htmlness' 'bodyness' 'divness' 'h1ness'. We understand what it means for something to be a 'body' in the terms of HTML. However, when the domain the DSL is modelling isn't well known to the reader, then the DSL becomes significantly harder to understand than normal procedural code.

So yeah, Lisp can be a bit of a double-edged sword, but it's also possible to see how it acts as a gigantic force multiplier for small teams who understand their problem domain really, really well. This is why I believe it makes such a fantastic startup language: to write really good Lisp, you have to understand the problem you're trying to solve really freaking well, and that's a big part of running a successful startup.