I'm one of about a dozen developers on a 250 kloc Java codebase that has a DSL of sorts in it: boolean predicate trees representing targeting for ad campaigns. I write, among other things, tree- rewriting compilers that turn those trees into SQL where clauses, scheduling buckets, floating point numbers for forecasts, functors for figuring out ad request eligibility, etc. The "compiler" layer has tons of special cases built into it which had proven very annoying to test properly, and what I really wanted was a syntax for these predicate trees.
Clojure to the rescue! In particular, the Clojure reader to the rescue. I wrote an sexp-to-real-object parser (in about a dozen lines of not-very-lispy code), which allowed me to write very dense (one- line) test cases. Several hundred lines of sexp's later, the code was comprehensively tested. I shoved the whole thing into a Junit test (with Clojure code in Strings, in this case) and haven't heard from the compiler layer since. Good times. There are two or three other portions of the code that I'd like to replace with Clojure, especially Spring and its horrible XML "language" for configuring things, and perhaps Hibernate and its horrible XML "language" for describing O/R mappings. The Clojure STM would make a bunch of state management easier elsewhere in the app (by forcing it to be explicit), but that's a much larger task for another time. At any rate, the point is that because it's ultimately just a jar file in our maven repository, using Clojure for something else is now ridiculously easy. There's no integration work to do, the build system already supports it, and the operations guys don't have to learn a new language. Clojure is just kind of there. On Oct 14, 4:13 pm, Fogus <[EMAIL PROTECTED]> wrote: > I am attempting to work Clojure (at least partially) into my job, but > in doing so I wonder how many of you here use it at your own jobs as > opposed to relegating it to hobby. > > -m On Oct 14, 4:13 pm, Fogus <[EMAIL PROTECTED]> wrote: > I am attempting to work Clojure (at least partially) into my job, but > in doing so I wonder how many of you here use it at your own jobs as > opposed to relegating it to hobby. > > -m --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---