XMLisp?

I had a twisted thought about a potential future thought experiment of using XML and Lisp style languages.

Having used Lisp a very little bit back in college for one semester, and read more about it in Structure and Interpretation of Computer Programs, I started looking into Clojure recently. I did a session of CodeRetreat last year in it, and was hearing more about it this year at SCNA so I started to read up on it more and play a little bit with the language.

Tie that in with that I recently was transferred to a new group at work that is doing some SOA (Service Oriented Architecture) work. Something triggered when I thought about the XML payloads being sent between the SOA Web Services and how that tied into what I am reading about Lisp and Clojure.

In other languages we think about serializing command objects into XML and back and send those messages between Services as a message payload. What made me think was that XML is a tree structure as well as the code in a Lisp type language.

What if we did something like Javascript and JSON? What if we convert the Lisp structure to XML and back, and then we can execute this Lisp structure data as Lisp code? With XML we can then also apply transforms and convert one message/command into another message/command, which would allow one message to be sent and transformed into multiple messages to be received by inserting messaging splitters and transformers. This is also not worrying about things like the security of the evaluation of the Lisp data as code since this something to think about as a thought experiment.

I don’t know if this is a novel idea, or if someone else has already tried it, but to me it seems like an interesting thing to think about and mull over.

About these ads

, , , , ,

  1. #1 by Colin Jones on December 12, 2011 - 22:19

    Check out clojure.xml/parse and clojure.xml/emit – there’s a reasonably well-accepted structure here for going from XML->Clojure and Clojure->XML. This structure is also used for things like clojure.core/xml-seq and clojure.zip/xml-zip.

    There are also some design discussions going on for further core library xml enhancements that you might find interesting: https://groups.google.com/forum/#!topic/clojure-dev/3_jkBrdQKgs/discussion and http://dev.clojure.org/display/DXML/Fuller+XML+support

    • #2 by Proctor on December 12, 2011 - 23:11

      I just saw something like this in “The Joy of Clojure” with the Clojure->XML example. What I was then thinking was then being able to eval that and having multiple representations of those XML commands. What seemed interesting was the possibility of XSLT to convert the XML message to multiple other commands, or to change the representation of the commands per receiver.

      Also the thought of implementing a distributed service oriented architecture style system using a Lisp language such as Clojure and being able to exchange messages as Clojure functions between the systems was an interesting thought to me.

  2. #3 by Alexander Repenning on October 2, 2012 - 18:33

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 191 other followers

%d bloggers like this: