[plt-scheme] MzScheme and .NET

From: Pedro Pinto (ppinto at cs.cmu.edu)
Date: Mon Mar 17 07:16:34 EST 2003

Thanks for link and the information Chris, Goo.NET seems very similar to
what I had in mind, I will look into it.

> My information on the .NET port and source code to the wrapper
> generator (in very ugly C# - it was my first ever C# program):
>
>   http://radio.weblogs.com/0102385/stories/2002/05/04/goodotnet.html

> How have you done your .NET mapping across to Scheme?

I was thinking much along the same lines as you were. A C# tool would import
.NET assemblies and generate Managed C++ code that wraps calls to the the
framework with the MzScheme extension DLL protocol. One .NET class would map
to a MzScheme type + a cluster of functions implementing its methods.

I am speculating that it might be possible to map .NET namespaces into
MzScheme modules (a hack no doubt, but maybe one that can be lived with). I
also think that in MzScheme .NET method overloading can be resolved by  the
exported MzScheme functions themselves (MzScheme allows variable arguments
in extension code). I was not planning on doing much to support inheritance
for now - I was sastisfied to have exported functions able to work on .NET
sub-classes.

Something like this:

; StreamWriter inherits from abstract class TextWriter which defines
WriteLine

(require (lib "System.Text" "dotnet"))

(define w (make-StreamWriter "out.txt"))

(TextWriter-WriteLine w "Hello {0}" World")


How did you address ref arguments? I have no idea how to represent this in
Scheme.

-pp





Posted on the users mailing list.