Are there any Clojure DSLs?

蓝咒 提交于 2019-11-28 15:22:02

问题


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


回答1:


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 (testing & 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)



回答2:


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




回答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)



来源:https://stackoverflow.com/questions/3968055/are-there-any-clojure-dsls

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!