Is there any DSL (Domain Specific Language) implemented in Clojure ?
This one is impressive. It pointed to me the importance of this language...
Diego Sevilla
2010-10-19 12:03:02
+25
A:
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):
- Enlive (HTML templating)
- LazyTest (Unit testing)
- fnparse (parser generator)
- Midje (mocking)
- byte-spec (binary-formats)
- Vijual (graph layout)
- Trammel (constraint programming)
- Cascalog (Hadoop w/ datalog syntax)
- Incanter (R-like environment)
- Sandbar (HTML sessions, forms, auth)
- ClojureQL (SQL)
- mini-kanren (embedded logic programming)
- Leiningen (build tool)
- sexpbot (IRC bot with plugin arch)
fogus
2010-10-19 12:28:01
can you please put a description beside each of those, so we know the domain they belong to ?
Belun
2010-10-19 12:35:15
@fogus 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
2010-10-19 14:39:10