[cfe-dev] Clang & Objective-C questions

Sebastian Redl sebastian.redl at getdesigned.at
Tue Jun 2 07:14:06 PDT 2009

Camille Troillard wrote:
> Hello,
> I am learning LLVM and would like to add JIT support to the F-Script
> language.  F-Script is a Smalltalk like scripting language that lives
> above the Objective-C runtime.  In F-Script everything is represented
> as an Objective-C object.
> Right now, when a block is parsed, a AST representation is built and
> then interpreted.  This results in selectors calls (by large), but
> also classes and methods definitions.
> My question are:
> 1. Do you think it would make sense to use the clang codebase
> (specifically Objective-C CodeGen / CGObjCRuntime) in order to
> generate the code that will replace F-Script's interpretation?
Caveat: I know nothing about F-Script and very little about Objective-C.

I don't think the ObjC CodeGen in its current state is very usable for
this purpose. It is designed to be supplied with a Clang AST and
generate code. Since the AST is very much bound to the C family of
languages, I don't see a good way to translate the AST of any other
language to it.
> 3. If this is not a good idea, do you have a suggestion for an
> alternative approach?
However, you may be able to extract the pure code generating part of the
CodeGen facility and pack it behind a more generic interface. If that's
possible, you could then use this to generate your calls.


More information about the cfe-dev mailing list