Are there any Clojure DSLs?
Asked Answered
E

3

30

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

Eustacia answered 19/10, 2010 at 11:59 Comment(0)
D
67

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):

Deduction answered 19/10, 2010 at 12:28 Comment(3)
Great list! One could also consider leiningen to be a DSLFrager
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.What
Great list, but can't believe you forgot Compojure! At least someone remembered Ring!Mammiemammiferous
E
7

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

Eckardt answered 19/10, 2010 at 12:2 Comment(0)
H
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)

Harbot answered 21/11, 2011 at 15:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.