31

Is there any DSL (Domain Specific Language) implemented in Clojure ?

Belun
  • 4,151
  • 7
  • 34
  • 51

3 Answers3

68

Like any Lisp dialect, Clojure draws a very fuzzy line between API and DSL and therefore the term doesn't hold the same mystique that it does in other languages. Lisp programmers tend to write their programs as layers of DSLs, each layer serving those above it. Having said that, here are a few that you could say display non-trivial levels of DSL-ness (in no particular order):

Alex Baranosky
  • 48,865
  • 44
  • 102
  • 150
fogus
  • 6,126
  • 5
  • 36
  • 42
  • 1
    Great list! One could also consider leiningen to be a DSL – Jonas Oct 19 '10 at 13:10
  • While it certainly may not be a 'good' example of a DSL, my IRC bot's defplugin macro is a DSL for creating sexpbot plugins. You can find examples of it in use in src/sexpbot/plugins and the actual implementation in src/sexpbot/respond.clj. You can add it to the list if you'd like. I'd rather not create a whole new answer just to add it, since yours is so excellent. – Rayne Oct 19 '10 at 14:39
  • 1
    Great list, but can't believe you forgot Compojure! At least someone remembered Ring! – Marc Apr 02 '12 at 03:37
7

SQL DSL in Clojure, a bit old but may be a showcase

Boris Pavlović
  • 63,078
  • 28
  • 122
  • 148
3

An useful talk on thinking about how to build DSLs using clojure from the 2010 clojure-conj conference by the creator of Enlive, Christophe Grand: http://blip.tv/clojure/christophe-grand-not-dsl-macros-4540700 (slides are here).

I would also count the design of Ring as in the domain of DSL design. See the talk by Ring's creator, Mark McGranaghan: http://clojure.blip.tv/clojure/mark-mcgranaghan-one-ring-to-bind-them-4724955 (slides)

Alex Stoddard
  • 8,244
  • 4
  • 41
  • 61