Command Palette

Search for a command to run...

Page Inspect

https://www.swift.org/
Internal Links
26
External Links
9
Images
0
Headings
19

Page Content

Title:Swift.org
Description:Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns.
HTML Size:33 KB
Markdown Size:5 KB
Fetched At:November 17, 2025

Page Structure

h1Swift is the powerful, flexible, multiplatform programming language.
h2Fast. Expressive. Safe.
h2Create using Swift
h3Cloud Services
h3Command Line
h3Embedded
h4iOS apps
h4Windows apps
h4Machine Learning & AI
h4Packages
h3Fast
h3Expressive
h3Safe
h3Interoperable
h3Adaptable
h3Open Source
h3Tools
h3Community
h3Governance

Markdown Content

Swift Programming Language

#

- Docs
- Community
- Packages
- Blog

- Install (6.2.1)

- Docs
- Community
- Packages
- Blog

- Install (6.2.1)

# Swift is the powerful, flexible,
multiplatform programming language.

## Fast. Expressive. Safe.

Install

Tools for Linux, macOS, and Windows

## Create using Swift

- ### Cloud Services

Run performant services on Linux and deploy to the cloud.
- ### Command Line

Create powerful CLI tools that are fast and memory safe.
- ### Embedded

Develop efficient, reliable firmware for devices like microcontrollers.

- #### iOS apps
- #### Windows apps
- #### Machine Learning & AI
- #### Packages

Swift is the only language that scales from embedded devices and kernels to apps and cloud infrastructure. It’s simple, and expressive, with incredible performance and safety. And it has unmatched interoperability with C and C++.



It's the combination of approachability, speed, safety, and all of
Swift’s strengths that make it so unique.

### Fast

Build with speed and performance.

Swift meets the most performance-critical needs, while allowing your code to remain expressive and approachable. Swift compiles directly to native code and provides predictable memory management.

// Vectorized check that a utf8 buffer is all ASCII
func isASCII(utf8: Span<SIMD16<UInt8>>) -> Bool {
// combine all the code units into a single entry
utf8.indices.reduce(into: SIMD16()) {
// fold each set of code units into the result
$0 |= utf8[$1]
}
// check that every entry is in the ASCII range
.max() < 0x80
}


### Expressive

Concise code. Powerful results.

Swift empowers you to write advanced code in a concise, readable syntax that even a beginner can understand. Swift supports object-oriented, functional, and generic programming patterns that experienced developers are familiar with. Its progressive disclosure allows you to pick up the language quickly, taking advantage of power-user features as you need them.

import ArgumentParser

// Complete implementation of a command line tool
@main struct Describe: ParsableCommand {
@Argument(help: "The values to describe.")
var values: [Double] = []

mutating func run() {
values.sort()
let total = values.reduce(0, +)

print(
"""
Smallest: \(values.first, default: "No value")
Total:    \(total)
Mean:     \(total / Double(values.count))
""")
}
}


### Safe

Protect memory safety.

Swift prioritizes safety and eliminates entire classes of bugs and vulnerabilities by its design. Memory safety and data race safety are core features of the language, making them straightforward to integrate into your codebase. Safety is required at compile time, before your applications are ever run.

let transform = Affine2DTransformBuilder()
.translate([10.0, 20.0].span)
.rotate(30.0)
.build()

let v = [11.0, 22.0, 1.0]

// Call C functions safely with Swift types
let u = mat_vec_mul(
transform, rowCount, colCount, v.span, allocator)
let uMagnitude = vec_mag(u.span)


### Interoperable

Adopt in existing code incrementally.

Swift provides unmatched interoperability with its combination of natively understanding C and C++ types without the need for foreign function interfaces, and by providing bridging for bi-directional access. Swift’s interoperability features allow you to incrementally adopt the language into existing codebases without requiring a full code rewrite.

import CxxStdlib

// Use types from C++, like std::string, directly
let beverages: [std.string] = [
"apple juice", "grape juice", "green tea"
]

let juices = beverages.filter { cppstring in
// and call methods directly on C++ types
cppstring.find(.init("juice")) != std.string.npos
}


### Adaptable

From microcontrollers to servers.

The only language that can span from embedded and kernel, to server and apps. Swift excels no matter where it’s used: from constrained environments like firmware where every byte counts, to cloud services handling billions of requests a day.

// Configure UART by direct register manipulation
// using Swift MMIO. Enables RX and TX, and sets
// baud rate to 115,200. Compiles down to an
// optimal assembly sequence with no overhead.

usart1.brr.modify { rw in
rw.raw.brr_field = 16_000_000 / 115_200
}

usart1.cr1.modify { rw in
rw.ue = .Enabled
rw.re = .Enabled
rw.te = .Enabled
}


### Open Source

Contribute and get involved.

View SwiftLang on GitHub Join the forums

- Docs
- Community
- Packages
- Blog
- Install

### Tools

- Xcode
- Visual Studio Code
- Emacs
- Neovim
- Other Editors

### Community

- Overview
- Swift Evolution
- Diversity
- Mentorship
- Contributing

### Governance

- Code of Conduct
- License
- Security

Color scheme preference  Light  Dark  Auto

Copyright © 2025 Apple Inc. All rights reserved.

Swift and the Swift logo are trademarks of Apple Inc.

- Privacy Policy
- Cookies
- API

-
-
-
-