Hi Jeremy, There are a number of existing implementations of what you're describing, the most well known of which is the Web Services Description Language (WSDL)<http://en.wikipedia.org/wiki/Web_Services_Description_Language>commonly used with SOAP <http://en.wikipedia.org/wiki/SOAP>. A WSDL file provides a complete, pure data (usually XML) description of a remote service which is used to automatically generate clients, servers, documentation, tests, and a variety of other useful things. If you're not already familiar with these technologies, I suggest researching them to get a better understanding of what has already been done in this area along with the associated benefits and drawbacks. Let me know if you have any specific questions or feedback.
Cheers, Michael-Keith On Monday, November 18, 2013 4:48:54 PM UTC-8, Jeremy Heiler wrote: > > I am interested in what you think about generating functions at compile > time (with a macro) from data. The specific use case I am thinking about > pertains to libraries for large web services with a lot of endpoints. A > cost-benefit analysis could probably be done for what size is appropriate, > but lets just assume the number of endpoints is large enough for you to > start thinking about this. > > Potential advantages include: > > - Less boilerplate. It would be less annoying to maintain data that > represents each endpoint and generate the boilerplate than it is to > maintain a lot of repetitive code. > > - Shareable. The work done to maintain the endpoint data could be used by > multiple libraries for multiple languages. In fact, it could be maintained > by the web service itself. > > Potential disadvantages include: > > - Limited discoverability. If the code is generated at compile time, there > is no direct source for it, which may hinder the ability to view or > generate documentation with your favorite tool(s). > > - Complicated edge cases. Endpoints that require extra code are usually > edge cases, but not always. Regardless, breaking from the template may > complicate the code further. (I don't think this is a difficult problem to > solve, though.) > > One way to alleviate the "limited discoverability" problem is to generate > source code at build time. This is what you would do in langauges like > Java, and that has always left me frustrated, so I am not inclined to think > it's a good idea. However, feel free to make the case! > > A language like Clojure makes doing this relatively easy, but is it simple? > > Thanks, > ;; Jeremy > > > -- -- 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 Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.