[Mono-list] Mixing languages within

Kelly Leahy kellyleahy@swbell.net
Thu, 9 Dec 2004 15:38:14 -0800 (PST)


Yes, its true that any .NET language should be able to
use any other .NET language (in separate assemblies). 
This IS supported by the standard and is one of the
major motivations for the CTS (common type system), a
significant part of the CLI (common language
infrastructure).

However, it should even be possible to support
multiple languages in the same assembly, assuming the
compilers could agree on an intermediate target or
some method for merging the assemblies.  I don't
believe this has been done, but I think its certainly
possible (not sure it buys anything though).

That being said, the question was about mixing code in
a single source file.  I don't think this should be or
would ever be possible.

Kelly

--- Kirk Marple <kirk-public@agnostic-media.com>
wrote:

> It makes sense if both languages (C# and HSPL)
> compiled to IL, and were both
> processed by the CLR.
> 
> You'd have to make separate assemblies which
> referenced each other, you
> couldn't do it inline in the same class.
> 
> Look at how IronPython compiles to IL, but it usable
> from any other .NET
> assembly.
> 
> http://ironpython.com/
> 
> -----Original Message-----
> From: mono-list-admin@lists.ximian.com
> [mailto:mono-list-admin@lists.ximian.com] On Behalf
> Of Colin JN Breame
> Sent: Thursday, December 09, 2004 3:19 PM
> To: mono-list@ximian.com
> Subject: [Mono-list] Mixing languages within
> 
> I don't know what the .Net standard would have to
> say about this....
> 
> I would like to mix C# and (say) Hypothetical String
> Processing Language
> (HSPL) and (say) Hypothetical Data Processing
> Language (HDPL) within the
> same source code file. e.g.
> 
> class mixed {
>      string normal_c_sharp_method() {
>        string ret = null;
> 
>        <region is HSPL>
>           some HSPL...modifying ret
>        </region is HSPL>
> 
>        <region is HDPL>
>           some HDPL...modifying ret
>        </region is HDPL>
> 
>        return ret
>     }
> }
> 
> Is this a crazy idea?
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>