[LLVMdev] Dynamic Type Lookup ...

David Chisnall David.Chisnall at cl.cam.ac.uk
Thu Apr 25 07:33:27 PDT 2013


On 25 Apr 2013, at 15:21, Frank White <frankwhite1003 at gmail.com> wrote:

> Thanks for your feedback David....
> 
> Yes, the intention is to support duck-typing.  In my code example,
> 
> a.attrB1 = 5            .... is probably more accurately stated as .....
> a. attr1.attrB1 = 5 
> 
> 
> Certainly this would be an unsafe call because we would not know that attrB1 is an attribute of attr1 until runtime.  I believe this type of call is valid in a language like Python.
> 
> Are there any references out there that would help me implement something like this?

This isn't really an LLVM-specific question, it's a general compiler question.  The best-written reference for implementing this kind of thing is the Smalltalk-80 blue book, although the techniques it describes are somewhat dates.  I can point you to some more recent papers off-list if you're interested.

David





More information about the llvm-dev mailing list