Abstract
The presentation shows how to use LLVM C API with Swift programming language.
The following topics are covered:
- Obtaining and building LLVM
- Linking simple Swift program against LLVM libraries
- Creating a simple Swift program that does the following:
- creates an LLVM module in memory
- creates an LLVM function in memory
- creates an LLVM execution engine in memory
- runs the function using the engine
- deals with input parameters of function
- deals with returning result from function
- Concluding the topic with an example of Kaleidoscope language implemented in Swift
Expected audience level
Beginners in Swift and LLVM
Motivation
With the public release of Swift more and more people find the language attractive. As a side effect more and more people are trying to learn internals, dig deeper and to get know how the system works.
The goals of the presentation:
- to show people far from compilers that using LLVM is not a rocket science, and rather easy
- attract more people into the LLVM community
- appeal to people to learn existing tools and build new tools on top of it
- highlight Swift’s readiness to be used not only for customer apps development
About the Author
My name is Alex. I work as a Software Developer for about 5 years now. I do write some useful stuff about Clang and LLVM here - http://lowlevelbits.org. Previously I gave some talks about LLVM/Clang/Swift internals for local developer communities (https://speakerdeck.com/AlexDenisov).
I mostly focus on iOS app development, though my hobby is Compiler Construction. I became an LLVM/Clang committer one year ago and managed to implement couple of features for Clang (new warning and ObjC language extension) and fixed couple of small bugs. I’m eagerly learning LLVM at the moment and trying to spreading the word about compilers to attract more people into this wonderful field of software engineering.
Speakers: Alex Denisov