[LLVMdev] RE: LLVM languages cooperation
Sébastien Pierre
sebastien.pierre at adival.com
Tue Feb 24 10:32:01 PST 2004
Chris Lattner wrote:
> BTW, you might want to check out this document that Reid wrote, which
>
>describes his experiences writing a front-end for LLVM, and giving lots of
>hints and tips: http://llvm.cs.uiuc.edu/docs/Stacker.html
>
>
Thanks, I already had a quick look on it.
Also thanks for your explanation on how the C++ back-end converts
function calls to LLVM code.
As you adviced earlier (about the Ruby LLVM back-end), back-end
developers will have to write a runtime library for their own language
(in any LLVM-supported language). This reminds me of Objective-C, which
comes with a C-based runtime library which allows to use any Objective-C
language from the C.
In this respect, it might be interesting to come up with guidelines (or
maybe something more "formal") for back-end developers to write such
cross-language communication runtime.
For instance, the Objective-C backend for GCC allows to send messages to
objects (invoke methods), create and manipulate "selectors" (which
reference methods), introspect classes, create new classes, etc. It does
not offer any primitive types manipulation as they are the same as C.
As LLVM seems to offer a language-independant type system, maybe it
would be easy to reference and interact with values of types (like
instance of classes) of a foreign language ?
-- Sébastien
More information about the llvm-dev
mailing list