[Mono-list] Mixing languages within

Colin JN Breame colinb@chameleonnet.co.uk
Fri, 10 Dec 2004 14:49:44 +0000


Michal Moskal wrote:

>The problem is cross references -- that is if part in language A needs
>part in language B and vice versa. Then the compilers need to agree
>much more -- upon some internal APIs, which seems quite difficult in
>general.
>  
>
Not that I'm an expert, but the 'common' parts would probably be 
something like:
 - a shared symbol table
 - shared intermediate representation (does mcs or the vb compiler use 
an intermediate representation?  how about ironpython and nemerle?)
 - shared error reporting mechnism

That way, whenever the language is changed during compilation, the 
symbol table can be passed on, modified if needed and then returned to 
the 'compiler host'.  The 'compiler host' could then hold all the common 
bits with the knowledge of how to invoke the 'secondary' compilers when 
the language is switched, and how to conglomerate each compilers output 
(IL).

Perhaps I should smoke less crack...