From joerthan.panest at gmail.com Thu Apr 22 15:54:49 2010 From: joerthan.panest at gmail.com (Joerthan Panest) Date: Thu, 22 Apr 2010 11:54:49 -0400 Subject: [rdnzl-devel] Make calls in the reverse direction (.NET -> CL) Message-ID: My familiarity with .NET in this regard is fairly limited, but I was wondering what would be required to expose modules written in Common Lisp on top of .NET to other .NET modules. I'm afraid the answer might be some CLR Lisp implementation, of which there are few (if any) that are very mature that I know of. Basically, I have a fairly involved (LispWorks) Common Lisp module that was originally the entry point for a number of applications, which itself made calls to .NET components. The requirement has come up that I expose some of it's features to a .NET application and I'd like to avoid reimplementing all of it in C#. I'm not sure this is even an RDNZL question, but given that is my starting point I cannot help but wonder whether people have encountered the same issue given the nature of the problem RDNZL is solving. -------------- next part -------------- An HTML attachment was scrubbed... URL: From edi at agharta.de Thu Apr 22 17:58:02 2010 From: edi at agharta.de (Edi Weitz) Date: Thu, 22 Apr 2010 19:58:02 +0200 Subject: [rdnzl-devel] Make calls in the reverse direction (.NET -> CL) In-Reply-To: References: Message-ID: What I know is that for example LispWorks can deliver Lisp DLLs which look like C DLLs (with the corresponding entry points) from the outside. Maybe there's a way to "wrap" such a "C DLL" so that it can be used from .NET? Just a wild thought, Edi. On Thu, Apr 22, 2010 at 5:54 PM, Joerthan Panest wrote: > My familiarity with .NET in this regard is fairly limited, but I was > wondering what would be required to expose modules written in Common Lisp on > top of .NET to other .NET modules. > > I'm afraid the answer might be some CLR Lisp implementation, of which there > are few (if any) that are very mature that I know of. > > Basically, I have a fairly involved (LispWorks) Common Lisp module that was > originally the entry point for a number of applications, which itself made > calls to .NET components. The requirement has come up that I expose some of > it's features to a .NET application and I'd like to avoid reimplementing all > of it in C#. > > I'm not sure this is even an RDNZL question, but given that is my starting > point I cannot help but wonder whether people have encountered the same > issue given the nature of the problem RDNZL is solving. > > _______________________________________________ > rdnzl-devel mailing list > rdnzl-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/rdnzl-devel > > From joerthan.panest at gmail.com Thu Apr 22 19:21:28 2010 From: joerthan.panest at gmail.com (Joerthan Panest) Date: Thu, 22 Apr 2010 15:21:28 -0400 Subject: [rdnzl-devel] Make calls in the reverse direction (.NET -> CL) In-Reply-To: References: Message-ID: Yes, that makes sense to me. I wasn't very clear with my actual request. I can create presumably create such a wrapper, but there would be no way to pass .NET objects in, would there? Thank you, Joerthan On Thu, Apr 22, 2010 at 1:58 PM, Edi Weitz wrote: > What I know is that for example LispWorks can deliver Lisp DLLs which > look like C DLLs (with the corresponding entry points) from the > outside. Maybe there's a way to "wrap" such a "C DLL" so that it can > be used from .NET? > > Just a wild thought, > Edi. > > > On Thu, Apr 22, 2010 at 5:54 PM, Joerthan Panest > wrote: > > My familiarity with .NET in this regard is fairly limited, but I was > > wondering what would be required to expose modules written in Common Lisp > on > > top of .NET to other .NET modules. > > > > I'm afraid the answer might be some CLR Lisp implementation, of which > there > > are few (if any) that are very mature that I know of. > > > > Basically, I have a fairly involved (LispWorks) Common Lisp module that > was > > originally the entry point for a number of applications, which itself > made > > calls to .NET components. The requirement has come up that I expose some > of > > it's features to a .NET application and I'd like to avoid reimplementing > all > > of it in C#. > > > > I'm not sure this is even an RDNZL question, but given that is my > starting > > point I cannot help but wonder whether people have encountered the same > > issue given the nature of the problem RDNZL is solving. > > > > _______________________________________________ > > rdnzl-devel mailing list > > rdnzl-devel at common-lisp.net > > http://common-lisp.net/cgi-bin/mailman/listinfo/rdnzl-devel > > > > > > _______________________________________________ > rdnzl-devel mailing list > rdnzl-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/rdnzl-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rwiker at gmail.com Thu Apr 22 19:18:08 2010 From: rwiker at gmail.com (Raymond Wiker) Date: Thu, 22 Apr 2010 21:18:08 +0200 Subject: [rdnzl-devel] Make calls in the reverse direction (.NET -> CL) In-Reply-To: References: Message-ID: Alternatively, it might be possible to (ab)use the delegate support in RDNZL to get what you need - simply define the delegate signatures you require in an interface class on the C# side, then use RDNZL to create an interface object and attach lisp closures (I do something like this to implement LISP callbacks for a somewhat misdesigned .NET library). It might even be possible to generate some sort of reverse RDNZL this way :-) Alternatively, create some sort of RPC interface for your LISP code. On Apr 22, 2010, at 19:58 , Edi Weitz wrote: > What I know is that for example LispWorks can deliver Lisp DLLs which > look like C DLLs (with the corresponding entry points) from the > outside. Maybe there's a way to "wrap" such a "C DLL" so that it can > be used from .NET? > > Just a wild thought, > Edi. > > > On Thu, Apr 22, 2010 at 5:54 PM, Joerthan Panest > wrote: >> My familiarity with .NET in this regard is fairly limited, but I was >> wondering what would be required to expose modules written in Common Lisp on >> top of .NET to other .NET modules. >> >> I'm afraid the answer might be some CLR Lisp implementation, of which there >> are few (if any) that are very mature that I know of. >> >> Basically, I have a fairly involved (LispWorks) Common Lisp module that was >> originally the entry point for a number of applications, which itself made >> calls to .NET components. The requirement has come up that I expose some of >> it's features to a .NET application and I'd like to avoid reimplementing all >> of it in C#. >> >> I'm not sure this is even an RDNZL question, but given that is my starting >> point I cannot help but wonder whether people have encountered the same >> issue given the nature of the problem RDNZL is solving. >> >> _______________________________________________ >> rdnzl-devel mailing list >> rdnzl-devel at common-lisp.net >> http://common-lisp.net/cgi-bin/mailman/listinfo/rdnzl-devel >> >> > > _______________________________________________ > rdnzl-devel mailing list > rdnzl-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/rdnzl-devel From tarvydas at visualframeworksinc.com Thu Apr 22 19:36:22 2010 From: tarvydas at visualframeworksinc.com (Paul Tarvydas) Date: Thu, 22 Apr 2010 15:36:22 -0400 Subject: [rdnzl-devel] Make calls in the reverse direction (.NET -> CL) In-Reply-To: References: Message-ID: <201004221536.22906.tarvydas@visualframeworksinc.com> > Yes, that makes sense to me. I wasn't very clear with my actual request. I > can create presumably create such a wrapper, but there would be no way to > pass .NET objects in, would there? FWIW, something I read mentioned the tools TLBIMP and TLBEXP for interop between .Net and COM. pt From joerthan.panest at gmail.com Thu Apr 22 20:46:02 2010 From: joerthan.panest at gmail.com (Joerthan Panest) Date: Thu, 22 Apr 2010 16:46:02 -0400 Subject: [rdnzl-devel] Make calls in the reverse direction (.NET -> CL) In-Reply-To: References: Message-ID: On Thu, Apr 22, 2010 at 3:18 PM, Raymond Wiker wrote: > Alternatively, it might be possible to (ab)use the delegate support in > RDNZL to get what you need - simply define the delegate signatures you > require in an interface class on the C# side, then use RDNZL to create an > interface object and attach lisp closures (I do something like this to > implement LISP callbacks for a somewhat misdesigned .NET library). This seems like the sort of solution that would fit best. Do you have any examples of this, off hand? Is the library you mention Open Source or otherwise available for review, by any chance? > It might even be possible to generate some sort of reverse RDNZL this way > :-) > It looks like I am on the path, but I definitely lack the understanding to tackle that. Alternatively, create some sort of RPC interface for your LISP code. > Yes, this is one option I've looked at but I think it is less elegant than the above. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From joerthan.panest at gmail.com Thu Apr 22 20:47:05 2010 From: joerthan.panest at gmail.com (Joerthan Panest) Date: Thu, 22 Apr 2010 16:47:05 -0400 Subject: [rdnzl-devel] Make calls in the reverse direction (.NET -> CL) In-Reply-To: <201004221536.22906.tarvydas@visualframeworksinc.com> References: <201004221536.22906.tarvydas@visualframeworksinc.com> Message-ID: On Thu, Apr 22, 2010 at 3:36 PM, Paul Tarvydas < tarvydas at visualframeworksinc.com> wrote: > > FWIW, something I read mentioned the tools TLBIMP and TLBEXP for interop > between .Net and COM. > I had forgotten about the COM/.NET interop. I'll take a look at that as well. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From joerthan.panest at gmail.com Thu Apr 22 22:05:46 2010 From: joerthan.panest at gmail.com (Joerthan Panest) Date: Thu, 22 Apr 2010 18:05:46 -0400 Subject: [rdnzl-devel] Make calls in the reverse direction (.NET -> CL) In-Reply-To: References: Message-ID: On Thu, Apr 22, 2010 at 4:46 PM, Joerthan Panest wrote: > > > On Thu, Apr 22, 2010 at 3:18 PM, Raymond Wiker wrote: > >> Alternatively, it might be possible to (ab)use the delegate support in >> RDNZL to get what you need - simply define the delegate signatures you >> require in an interface class on the C# side, then use RDNZL to create an >> interface object and attach lisp closures (I do something like this to >> implement LISP callbacks for a somewhat misdesigned .NET library). > > > This seems like the sort of solution that would fit best. Do you have any > examples of this, off hand? Is the library you mention Open Source or > otherwise available for review, by any chance? > I see the key press event handler example in the RDNZL docs. Thanks for the information. -------------- next part -------------- An HTML attachment was scrubbed... URL: From joerthan.panest at gmail.com Sat Apr 24 14:45:38 2010 From: joerthan.panest at gmail.com (Joerthan Panest) Date: Sat, 24 Apr 2010 10:45:38 -0400 Subject: [rdnzl-devel] Make calls in the reverse direction (.NET -> CL) In-Reply-To: References: Message-ID: I've been trying to figure out a way to make this sort of approach work. On Thu, Apr 22, 2010 at 3:18 PM, Raymond Wiker wrote: > Alternatively, it might be possible to (ab)use the delegate support in > RDNZL to get what you need - simply define the delegate signatures you > require in an interface class on the C# side, then use RDNZL to create an > interface object and attach lisp closures (I do something like this to > implement LISP callbacks for a somewhat misdesigned .NET library). Ok, I create a shared .NET DLL that defines the interface and all needed classes. I can deliver a "C DLL" with LispWorks that is able to instantiate the types and interface as well as register callbacks with these types that it has instantiated. The fundamental issue that I cannot work around here is that there is no clear way to pass along the previously instantiated from the .NET application through to any functions exposed by the Lisp DLL. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rwiker at gmail.com Sat Apr 24 17:03:32 2010 From: rwiker at gmail.com (Raymond Wiker) Date: Sat, 24 Apr 2010 19:03:32 +0200 Subject: [rdnzl-devel] Make calls in the reverse direction (.NET -> CL) In-Reply-To: References: Message-ID: <8D42009D-8BE1-4751-8A13-8357E06C11C2@gmail.com> On Apr 24, 2010, at 16:45, Joerthan Panest wrote: > I've been trying to figure out a way to make this sort of approach work. > > On Thu, Apr 22, 2010 at 3:18 PM, Raymond Wiker wrote: > Alternatively, it might be possible to (ab)use the delegate support in RDNZL to get what you need - simply define the delegate signatures you require in an interface class on the C# side, then use RDNZL to create an interface object and attach lisp closures (I do something like this to implement LISP callbacks for a somewhat misdesigned .NET library). > > Ok, I create a shared .NET DLL that defines the interface and all needed classes. I can deliver a "C DLL" with LispWorks that is able to instantiate the types and interface as well as register callbacks with these types that it has instantiated. > > The fundamental issue that I cannot work around here is that there is no clear way to pass along the previously instantiated from the .NET application through to any functions exposed by the Lisp DLL. If I understand you correctly, it should(?) be as simple as defining a delegate on a class, and a setter for the delegate. You can then add a lisp delegate to an object known by (or created from) Lisp. The arguments to the delegate could then include arbitrary .NET objects. This is not a general solution in the way that RDNZL works (in the opposite direction), but then again... the callback you define could have the semantics of #'apply, with the first argument being a string that names a function, and the second argument being a list of parameters (not needed if C# supports functions with a variable number of arguments). From joerthan.panest at gmail.com Sat Apr 24 22:21:20 2010 From: joerthan.panest at gmail.com (Joerthan Panest) Date: Sat, 24 Apr 2010 18:21:20 -0400 Subject: [rdnzl-devel] Make calls in the reverse direction (.NET -> CL) In-Reply-To: <8D42009D-8BE1-4751-8A13-8357E06C11C2@gmail.com> References: <8D42009D-8BE1-4751-8A13-8357E06C11C2@gmail.com> Message-ID: On Sat, Apr 24, 2010 at 1:03 PM, Raymond Wiker wrote: > If I understand you correctly, it should(?) be as simple as defining a > delegate on a class, and a setter for the delegate. > Yes. > You can then add a lisp delegate to an object known by (or created from) > Lisp. > Created by Lisp is already solved via RDNZL. The problem is the "known by" part that assumes it was passed in to begin with. I'm reading up on marshaling between managed and unmanaged code, so hopefully I'll have something to share. -------------- next part -------------- An HTML attachment was scrubbed... URL: