[Mono-list] Mixing languages within

Richard Norman normri@samc.com
Thu, 09 Dec 2004 16:58:46 -0800


This is a MIME message. If you are reading this text, you may want to 
consider changing to a mail reader or gateway that understands how to 
properly handle MIME multipart messages.

--=__PartB39347D6.0__=
Content-Type: text/plain;
 charset=us-ascii
Content-Transfer-Encoding: 7bit

In the same code file would not work cause you would need to know where
language A ends and language B begins. The compiler would need to parse
the file and know what language to pass to based on some sort of
lookup.
 
In .NET 2.0 there is the notion of "partial" classes where for example
XAML files describe one part of the class and say a VB file describes
another. But again the languages they are compiled with must be the same
(Example: http://www.devx.com/dotnet/Article/22603/1954?pf=true )
 
The other thing you have is multi-assembly namespaces. So that part of
a name space is in one assembly and another part is in another assembly.
So one assembly could be written in C# and another could be written in
VB. but again these are separate files and separate assemblies.
 
Richard Norman
Web/Application Developer
http://www.jazzynupe.net/blog/
 
 
*************************************
Message: 15
Date: Thu, 9 Dec 2004 15:38:14 -0800 (PST)
From: Kelly Leahy <kellyleahy@swbell.net>
Subject: RE: [Mono-list] Mixing languages within
To: Kirk Marple <kirk-public@agnostic-media.com>,
 'Colin JN Breame' <colin@breame.com>, mono-list@ximian.com 
 
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


--=__PartB39347D6.0__=
Content-Type: text/html;
 charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Description: HTML

<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dwindows-125=
2">
<META content=3D"MSHTML 6.00.2900.2523" name=3DGENERATOR></HEAD>
<BODY style=3D"MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>In the same code file would not work cause you would need to know =
where language A ends and language B begins. The compiler would need to =
parse the file and know what language to pass to based on some sort of =
lookup.</DIV>
<DIV>&nbsp;</DIV>
<DIV>In .NET 2.0 there is the notion of "partial" classes where for =
example XAML files describe one part of the class and say a VB file =
describes another. But again the languages they are compiled with must be =
the same (Example:&nbsp;<A href=3D"http://www.devx.com/dotnet/Article/22603=
/1954?pf=3Dtrue">http://www.devx.com/dotnet/Article/22603/1954?pf=3Dtrue</A=
> )</DIV>
<DIV>&nbsp;</DIV>
<DIV>The other thing you have is multi-assembly namespaces. So that part =
of a name space is in one assembly and another part is in another =
assembly. So one assembly could be written in C# and another could be =
written in VB. but again these are separate files and separate assemblies.<=
/DIV>
<DIV>&nbsp;</DIV>
<DIV>Richard Norman</DIV>
<DIV>Web/Application Developer</DIV>
<DIV><A href=3D"http://www.jazzynupe.net/blog/">http://www.jazzynupe.net/bl=
og/</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>*************************************</DIV>
<DIV>Message: 15<BR>Date: Thu, 9 Dec 2004 15:38:14 -0800 (PST)<BR>From: =
Kelly Leahy &lt;<A href=3D"mailto:kellyleahy@swbell.net">kellyleahy@swbell.=
net</A>&gt;<BR>Subject: RE: [Mono-list] Mixing languages within<BR>To: =
Kirk Marple &lt;<A href=3D"mailto:kirk-public@agnostic-media.com">kirk-publ=
ic@agnostic-media.com</A>&gt;,<BR>&nbsp;'Colin JN Breame' &lt;<A href=3D"ma=
ilto:colin@breame.com">colin@breame.com</A>&gt;, <A href=3D"mailto:mono-lis=
t@ximian.com">mono-list@ximian.com</A> </DIV>
<DIV>&nbsp;</DIV>
<DIV>Yes, its true that any .NET language should be able to<BR>use any =
other .NET language (in separate assemblies). <BR>This IS supported by the =
standard and is one of the<BR>major motivations for the CTS (common type =
system), a<BR>significant part of the CLI (common language<BR>infrastructur=
e).</DIV>
<DIV>&nbsp;</DIV>
<DIV>However, it should even be possible to support<BR>multiple languages =
in the same assembly, assuming the<BR>compilers could agree on an =
intermediate target or<BR>some method for merging the assemblies.&nbsp; I =
don't<BR>believe this has been done, but I think its certainly<BR>possible =
(not sure it buys anything though).</DIV>
<DIV>&nbsp;</DIV>
<DIV>That being said, the question was about mixing code in<BR>a single =
source file.&nbsp; I don't think this should be or<BR>would ever be =
possible.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Kelly<BR></DIV></BODY></HTML>

--=__PartB39347D6.0__=--