[Mono-devel-list] Re: rubydotnet - want to support mono

Thomas Sondergaard thomas at thomassondergaard.com
Tue Sep 23 15:47:47 EDT 2003

> There is a (partial) perl binding and a more complete PHP binding.
> Both of them use the mono embedding API that is breifly described at
> http://www.go-mono.com/embedded-api.html. From looking at your C++ code,
> we should have all you need: ways to create objects, box simple
> valuetypes, invoke methods and so on.
> The PHP one is at http://www.php.net/~sterling/mono/ (dunno how current
> it is, though).
> Feel free to ask more questions on the list.

I'll take a look at them!

> > could unite our efforts and work together on ScriptingExtensions for
> > for the benefit of all scripting languages that interops with .net.
> This sounds interesting. Can you give more details on it?

Yes, sure. There is a range of things you want to do when you bind a dynamic
language like ruby to .net using a dual-runtime approach, that is not ruby
specific, but specific to the dynamic nature of the language. I have been
building ScriptingExtensions for .net as I needed things for rubydotnet.
Currently it has the following classes/services:

1) ScriptingExtensions.ScriptEngine/Evaluator - for dynamically evaluating
C#, VB, and JScript from the script side. Primarily to allow the script
writer to express performance critical sections in .net rather than in the
scripting language, without having to create e.g. a C# project and compile
it to .net. This uses Microsoft.CSharp(/VisualBasic/JScript) to compile code
at runtime.

2) ScriptingExtensions.TypeFinder - simple class for looking up types and
namespaces. (Type.GetType doesn't look in dynamically loaded assemblies, and
there is no built-in mechanism for looking up a namespace, as far as I can

3) ScriptingExtensions.TypedDelegateFactory.getDelegate(Type delegateType,
IProc proc) - creates typed delegates that invoke IProc.invoke(object[]
args). ScriptingExtensions.Binder implements a binder that can be used with
Type.InvokeMember to allow automatic conversion of IProc's to the relevant
delegate type.

4) ScriptingExtensions.DynamicClassFactory.getType(Type baseType, Type[]
interfaces) - automatically create wrapper type objects with base baseType
that implements interfaces. This is necessary if you want script objects to
implement  .net interfaces. This is based on implementing all members of the
interfaces in terms of IObject.send(string msg, object[] args). baseType
must implement IObject.

I don't see why language bindings for Python, Perl, TCL, PHP, Lua etc
wouldn't need the same services.


More information about the Mono-devel-list mailing list