Swift for Beginners / Chapter 1 — Getting started (lessons 1–8) / Lesson 1

What Swift is (setting up and Hello World)

Time needed: about 3 min (estimate)

☆ Read later

You can try the opening of this lesson without an account.

What kind of language Swift is

Swift is a language Apple announced in 2014.

Three of its properties are worth knowing.

First, it is type-safe and compiled — the types of variables and functions are settled before you run, and any contradiction is a compile error.

You never have the accident of "I ran it and found I was adding a string to a number".

Second, it is not a language for iOS and macOS apps alone.

It is open source, runs on Linux and Windows, and is used for server-side work (Vapor) and command-line tools.

Third, it is designed to make safe code easy to write.

Optionals expressing nil in the type, constants that cannot be changed by default, arithmetic that does not let overflow slip past — the policy of closing off the bug-prone places in the language itself runs throughout.

swift --version

$ swift --version swift-driver version: 1.148.6 Apple Swift version 6.3.3 (swiftlang-6.3.3.1.3 clang-2100.1.1.101) Target: arm64-apple-macosx26.0

You do not need Xcode

Create a free account to keep reading

With an account you can read the rest of this lesson, take the quiz, and read every free lesson in this course. Lessons you answer correctly are recorded as complete.

Report a problem with this lesson

Log in to send a report.

Keyboard shortcuts

Keys available in a lesson
KeyAction
[ or Alt + ←Go to the previous lesson
] or Alt + →Go to the next lesson
?Open this list
EscClose this list

The keys do not work while the cursor is in a code editor or an input field.