|
List Info
Thread: Io <-> C#/.NET bridge using .NET reflection?
|
|
| Io <-> C#/.NET bridge using .NET
reflection? |

|
2006-02-14 03:08:49 |
|
I notice Io has some really cool bridges. I'm learning Io and OpenGL
at the same time via Io's open gl bridge, and I read about the Io <->
objective C bridge but haven't used it.
I use C# at work and sometimes we load assemblies and classes
dynamically, using strings and the reflection API; you can store the
strings in a database to make the app easier to configure. In fact,
.NET reflection facilities allow you to do just about everything
dynamically via strings as an alternative to static typing. It seems
to me that it wouldn't take more than a few hundred lines on the C#
side to make a bridge between Io and .NET, because all you'd have to
do is implement a minimal reflection API and then .NET types,
variables, and methods could be accessed by passing messages with
string arguments through this gateway. Io programs would then be able
to thousands of .NET classes without even having to run on .NET
itself. (And you could do it open source on Linux, too, thanks to the
Mono project.) You could talk to managed DirectX, database services,
crypography, the operating system, the internet, whatever you want.
Whoa, far out dude, I just had an idea - you could even create Windows
Forms and dialogs. Bridge is not really the appropriate term - it
should really be called a "Stargate"!
The Io side of the bridge could include an object factory which would
take each .NET object the Io code and create a proxy object for it in
Io. When you send a message to the proxy object, it gets routed to
the single bridge object along with an object Id. The C# side of the
bridge would have a hash table mapping object Id's to references to
.NET objects, so it could translate the message into the appropriate
method call on the appropriate object.
I have enough C# experience to code the .NET side of such a stargate
with one hand behind my back. What's involved in coding the Io side
of a bridge?
|
[1]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|