How good Clojure could be as an integration language? We use Tibco EMS/WebSphere MQ as integration brokers. Programs written to send/receive the messages, transforming the messages are written mainly in Java. What are the libraries available in Clojure to perform similar tasks like
1) Parsing an XML(DOM/SAX)
2)Transforming the XML.
3)Writing webservice(like JAX etc).
Clojure provides stellar tools for consuming, transforming, and emitting XML.
clojure.xml is a core namespace that defines the most common way XML is represented in Clojure (essentially, each element is a map with three slots, for its tag, attributes and content).
Enlive (by Christophe Grand) is a library that allows you to functionally transform XML and HTML. It's billed as a templating engine, but really is an excellent generalized tool for any kind of XML transformations you need to do; we talk about Enlive in the web chapter of the book. Enlive is built on top of clojure.zip — an implementation of Huet's functional zippers — which is generally useful in terms of efficiently and concisely traversing and modifying immutable data structures.
Writing web services is one of the most common popular use cases for Clojure. The book guides you through writing one using Ring and Compojure, although there are higher-level libraries and frameworks that you might find useful as well, including Noir and Bishop (the latter of which is a very promising Clojure implementation of webmachine, a great foundation to build upon if you are aiming to write properly compliant HTTP web services).
Arjun Shastry wrote:Thanks Chas.
Like c++ and other languages, does clojure has any one standard body responsible for its specification,libraries?
The organization around Clojure roughly follows that around Python, Ruby, and other languages that are not the result of a single company's efforts. The reference implementation is guided by Rich Hickey (its creator), with the bulk of the work done by him and Clojure/core, which he heads. Contributions (patches, documentation, etc.) also come from the community via a patch process.
The libraries are almost entirely community-driven; thus, each one is managed by its author, usually with the help of 1-1,000 other contributors from the community.
At this point in time, I think it's taken as a given that standards bodies are generally not an ideal way to develop new languages. Perhaps after some extended period of real-world use, a language might be submitted to a standards body (here I'm thinking of C#), but I wouldn't bet on that being commonplace, either.
Chas Emerick wrote:At this point in time, I think it's taken as a given that standards bodies are generally not an ideal way to develop new languages. Perhaps after some extended period of real-world use, a language might be submitted to a standards body (here I'm thinking of C#), but I wouldn't bet on that being commonplace, either.
As someone who was a voting member of the ANSI C++ Standards Committee for eight years (and secretary for three), as well as the UK's (BSI) "Principal Expert" on the ISO committee for most of those eight years, I'll just +1 what Chas said about modern language development not being best served by a standards body (at least, not unless there are multiple competing implementations which is hampering commerce - the whole point of a standards body is to "enable commerce" around a technology).