Swift Introduction

About Swift

Build of the best of C and ObjC. Adopt safe programming patterns and more features to make programming more easier with lots of fun. ObjC itself has evolved to support blocks, collection literals so that ground works helps a lot.

Swift feels familiar to ObjC developers also provide seamless access to existing cocoa frameworks.

It is first industrial quality system programming language that is expressive and enjoyable as scripting language. Supports playground, an innovative way that allow programmers to experiment the code see the results and no need to even building and running it.

The complier is optimised for performance and language os optimised for development.

Language features:

Easy to read and maintain, Safe (optional), unified memory management, less code, faster,

Complier Architecture.

Complier is responsible for translating Swift code into efficient and executable machine code. here are few major components.

Parsing : Recursive-descent parser with an integrated hand coded lexer. Parser responsible for generating Abstract Syntax Tree also emit the warning or errors for grammatically problems.

Semantic Analysis: Take the AST and transform into well formed, full typed checked. Emits warning and semantic problems. (Type inference).

Clang importer: imports the clang modules and maps the C or ObjC APIs they export into their corresponding Swift APIs.

SIL Generation: Swift Intermediate Language is a high level,  suitable for further analysis and optimisation of swift code.

SIL Guaranteed transformation: Perform additional data flow diagnostics that affect the correctness of program.

SIL Optimisation: perform high level, Swift specific optimisations  including ARC, devirtualization.

LLVM IR Generation: IR generation lowers SIL to LLVM IR so LLVM continue to optimise and generate machine code.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s