11
The Swift Runtime
WHAT'S IN THIS CHAPTER?
- Understanding the Objective-C runtime
- Dispatching methods in Objective-C
- Investigating the Swift runtime
- Comparing and contrasting method dispatch in Swift
- Understanding how programs are assembled in Swift
WROX.COM CODE DOWNLOADS FOR THIS CHAPTER
You can find the wrox.com downloads for this chapter at http://www.wrox.com/go/proswift on the Download Code tab. The code for this chapter is contained in the following files:
- Cats.playground
- hello.c
- objc-message.m
- objc-method.m
- objc-msgsend.m
- test.c
- test.c.s
- test.m
- test.m.s
- test.swift
- test.swift.s
Programming languages are made up of many parts. The most obvious are the language's syntactic and semantic elements. The language's standard library can be considered a major part of the language's form as well. Less commonly noticed than these parts, but no less crucial, is the language's runtime. Some languages, such as Java, have enormous runtimes that include an entire virtual machine. Others, like C, have very small runtimes that are a small set of functions that support the language. Swift, on the other hand, can be said to have a two-part runtime: the specific code that allows the execution of programs written in Swift, as well as the Objective-C runtime, which Swift also makes heavy use of. Because the Objective-C runtime is also important to Swift programs, this chapter explores the Swift runtime as well as the Objective-C runtime that has supported programs since the beginning of Mac ...
Get Professional Swift now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.