[Mono-list] interesting discussion regarding managed dynamic libraries

Pieter Breed Pieter Breed <pieter.breed@gmail.com>
Thu, 16 Dec 2004 09:50:01 +0200


Hi All,

I recently tried to start a discussion on the
microsoft.public.dotnet.general newsgroup. To my dismay nobody seemed
interested in discussing something which I think might be cool.

The idea is this:  If you write a managed (hereafter .net for brevity)
class library could you not "export" certain annotated static methods
in such a way the a normal C-style application could use those
functions?

I think one can accomplish this by actually only exporting a standard
stub with the correct name/symbol that another application can link
to. This stub then invokes the .net runtime when called, does the
marshalling thing, and pass control to the "exported" static method
which now executes under the runtime.

When the method finishes, one can do the reverse for return values and
reference parameters.

To my though at least, this seems similar to what happens when you
execute a .net application in the standard way.

What do you all think of such a scheme?

Regards
pieter

-- 
"Maybe I'm a little bit crazy, but I can't decide if it's psychotic or
neurotic. You know the difference, don't you? A psychotic thinks that
2 + 2 = 5. A neurotic knows that 2 + 2 = 4, but it makes him nervous."
- Larry Wall, The State of the Onion (speech) 2004.
http://www.perl.com/pub/a/2004/08/18/onion.html