1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "swift 1"
.TH swift 1 2024-12-25 "swift\ 5.10.1" "Swift Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
swift \-\- Safe, fast, and expressive general\-purpose programming language
.SH SYNOPSIS
.IX Header "SYNOPSIS"
To invoke the Swift REPL (Read-Eval-Print-Loop):
.Sp
.RS 4
\&\fBswift\fR repl
.RE
.PP
To execute a Swift program:
.Sp
.RS 4
\&\fBswift\fR program.swift <arguments>
.RE
.PP
To work with the Swift Package Manager:
.Sp
.RS 4
\&\fBswift\fR build|package|run|test [options] <inputs>
.RE
.PP
To invoke the Swift compiler:
.Sp
.RS 4
\&\fBswiftc\fR [options] <inputs>
.RE
.PP
A list of supported options is available through the "\-help" option:
.Sp
.RS 4
\&\fBswift\fR \-help
.Sp
\&\fBswift\fR build \-help
.Sp
\&\fBswiftc\fR \-help
.RE
.SH DESCRIPTION
.IX Header "DESCRIPTION"
Swift is a general-purpose programming language built using a modern approach to
safety, performance, and software design patterns.
.PP
The goal of the Swift project is to create the best available language for uses
ranging from systems programming, to mobile and desktop apps, scaling up to
cloud services. Most importantly, Swift is designed to make writing and
maintaining \fIcorrect\fR programs easier for the developer. To achieve this goal,
we believe that the most obvious way to write Swift code must also be:
.PP
\&\fBSafe.\fR The most obvious way to write code should also behave in a safe manner.
Undefined behavior is the enemy of safety, and developer mistakes should be
caught before software is in production. Opting for safety sometimes means Swift
will feel strict, but we believe that clarity saves time in the long run.
.PP
\&\fBFast.\fR Swift is intended as a replacement for C\-based languages (C, C++, and
Objective-C). As such, Swift must be comparable to those languages in
performance for most tasks. Performance must also be predictable and consistent,
not just fast in short bursts that require clean-up later. There are lots of
languages with novel features \- being fast is rare.
.PP
\&\fBExpressive.\fR Swift benefits from decades of advancement in computer science to
offer syntax that is a joy to use, with modern features developers expect. But
Swift is never done. We will monitor language advancements and embrace what
works, continually evolving to make Swift even better.
.SH BUGS
.IX Header "BUGS"
Reporting bugs is a great way for anyone to help improve Swift. The issue
tracker for Swift, an open-source project, is located at
<https://github.com/swiftlang/swift/issues>.
.PP
If a bug can be reproduced only within an Xcode project or a playground, or if
the bug is associated with an Apple NDA, please file a report to Apple's
Feedback Assistant at <https://feedbackassistant.apple.com> instead.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
.SS "HOME PAGE"
.IX Subsection "HOME PAGE"
<https://swift.org>
.SS "APPLE DEVELOPER RESOURCES"
.IX Subsection "APPLE DEVELOPER RESOURCES"
<https://developer.apple.com/swift/resources>
.SS "CODE REPOSITORIES"
.IX Subsection "CODE REPOSITORIES"
Swift Programming Language at <https://github.com/swiftlang/swift>
.PP
Swift Package Manager at <https://github.com/swiftlang/swift\-package\-manager>
|