On Sat, Oct 31, 2009 at 12:44 AM, John Ky <newho...@gmail.com> wrote:
> Hi Stuart, > > I wasn't very clear. > > Essentially, the problem I have boils down to having to maintain two > separate code bases for my API - one in C# and one in Java. There is some > overhead in maitaining two different code bases - for instance, whenever, I > fix a bug in one or add a feature in one, I need to do the same in the > other. I also need to write all my unit test cases in each language for > both APIs, adding more work still. > > Given that both Clojure and ClojureCLR exists, it should be theoretically > possible to write the logic of my API in the Clojure language and run them > on both the JVM, or the CLR. As I would need to do networking with my API, > all the runtime specific stuff, I could wrap with a common interface andthen > call them from Clojure. In this case, I would only need to maintain one API > logic, and two runtime specific abstraction wrappers. > > Unfortunately, as I am writing an API, and not my own application, I would > still need to provide a Java or C# wrapper so that other people who don't > use or know Clojure and can interface with my code - which again is more > work. > > So the question is - would it make sense to specify that interface (ie. the > Java and C# ones) in a language neutral specification with Clojure data > structures, then from those data structures generate Java wrappers and C# > wrappers around my clojure API logic code? > > There may not be such a solution in existence today - so essentially, the > question is does such a solution make sense? > > Is that feasible or even possible or desirable? Or am I just being silly? > What about doing this?: * Most of the code-base is in namespaces project.core.this * There's a single namespace project.wrap with platform-specific code. The wrap.clj file has two versions, a CLR version and a Java version. * You compile the project excluding the CLR version of wrap.clj to a jar and distribute that to Java users. * You compile the project excluding the Java version of wrap.clj to whatever archive format .NET uses and distribute that to .NET users. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---