Preface

Why use Swift for hacking AI? Common Lisp has been my go-to language for artificial intelligence development and research since 1982. My transition to often using Swift is motivated by practical aspects of Swift and the Swift ecosystem.

The Swift language has also replaced much of my Python workflow for AI work.

Requests from the Author

This book will always be available to read free online at https://leanpub.com/SwiftAI/read.

That said, I appreciate it when readers purchase my books because the income enables me to spend more time writing.

Both the source code examples and the manuscript for this book are kept in one github repository:

https://github.com/mark-watson/SwiftAI-book

Visit My Website

https://markwatson.com

Parts of this Book are Specific for macOS and iOS, with Some Support for Linux

Swift is a general purpose language that is well supported in macOS, iOS, and Linux, with some support in Windows. Here, we cover the use of Swift on macOS and iOS. Some of the examples in this book rely on libraries that are specifically available on macOS and iOS like CoreML and the NLP libraries. Several book examples also work on Linux, such as the examples using SQLite, the Microsoft Azure search APIs, web scraping, and semantic web/linked data.

Code for this Book

Because of the way the Swift Package Manager works, I organized all book examples that build libraries as separate directories in the subdirectory source-code in the GitHub repository:

https://github.com/mark-watson/SwiftAI-book

Author’s Background

I have written 20+ books, mostly about artificial intelligence. I have over 50 US patents.

I write about technologies that I have used throughout my career: knowledge representation using semantic web and linked data, machine learning and deep learning, and natural language processing. I am grateful for the companies where I have worked (SAIC, Google, Capital One, Olive AI, Babylist, etc.) that have supported this work since 1982.

As an author, I hope that the material in this book entertains you and will be useful in your work.

Cover Art

The cover picture was taken by WikiMedia Commons user Keta and is available for use under the Creative Commons License CC BY-SA 2.5.

Swift 3rd Party Libraries

We use the following 3rd party libraries:

Acknowledgements

I thank my wife Carol for editing this manuscript, finding typos, and suggesting improvements.