[Mono-list] Mixing languages within
Colin JN Breame
colin@breame.com
Fri, 10 Dec 2004 15:03:10 +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...