2014 LLVM Developers’ Meeting: “Skip the FFI: Embedding Clang for C Interoperability ”

148 Просмотры
Издатель
https://llvm.org/devmtg/2014-10/

Skip the FFI: Embedding Clang for C Interoperability - Jordan Rose, John McCall

Slides: http://llvm.org/devmtg/2014-10/Slides/Skip%20the%20FFI.pdf

Most languages that aren't a superset of C provide a Foreign Function Interface (FFI) that allows one to interface with existing C libraries. FFIs are often an afterthought, requiring manual or source-to-source translation from C header files to a subset of the target language, resulting in complicated build processes, frequent manual tweaking, and numerous implementation challenges.
This talk will discuss an alternative approach that embeds Clang into an LLVM-based compiler front end to provide C compatibility without the traditional FFI. Embedding Clang provides seamless access to C APIs, moving the translation of APIs from external tools into the compiler itself. Moreover, one can leverage Clang's deep knowledge of C record layout and calling conventions to simplify the C interface and make both bring up and porting of a new compiler front end simpler.
Категория
Разработка на iOS Язык программирования Objective-C
Комментариев нет.