A general-purpose programming language that's approachable for newcomers and powerful for experts
open sourceApache-2.0 WITH Swift-exceptionfree
Swift is a general-purpose, type-safe compiled language for everything from systems programming and embedded devices to mobile and desktop apps and cloud services. It infers types, makes values non-optional by default so a nil is a compile-time error, checks arrays and integers for overflow, and manages memory with Automatic Reference Counting rather than a garbage collector; async/await and actors are built into the language. The toolchain includes the swift compiler, the standard library and core libraries such as Foundation, the LLDB debugger and REPL, SourceKit-LSP and the Swift Package Manager. It targets Apple's platforms, Linux and Windows, with SDKs for Android, WebAssembly and statically linked Linux binaries, and an Embedded Swift mode for microcontrollers. Open source under Apache-2.0 with a Runtime Library Exception since 2015.
Libraries for Swift
View 27 more
Browse all of them: 33 libraries, 12 frameworks, 47 APIs.
Problems it solves
- a safe, fast compiled language to write an iPhone and Mac app in
- share code between my iOS app and my server backend in one language
- a modern language with C-like performance but no manual memory management
- catch null pointer crashes at compile time instead of in production
- write concurrent code without data races, checked by the compiler
- a language I can use for apps, command-line tools and microcontrollers alike
- build a fully static Linux binary for a server from a friendly high-level language
- call C and C++ libraries directly without writing bindings
Features
- type inference and optionals that make nil a compile-time error
- Automatic Reference Counting for memory management
- async/await, actors and data-race safety checked at compile time
- generics, protocols, extensions and closures
- Swift Package Manager for building and distributing packages
- LLDB debugger with a REPL, and SourceKit-LSP for editors
- Static Linux SDK, Swift SDK for Android and Swift SDK for WebAssembly
- Embedded Swift for microcontrollers
- C and C++ interoperability
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what Swift does.
- Dart An approachable, portable, and productive language for high-quality apps on any platform
- Odin The Data-Oriented Language for People Who Ship Software
- V Simple, fast, safe, compiled. For developing maintainable software
- Hare A systems programming language designed to be simple, stable, and robust
- C# A modern, open-source programming language
- Nim Efficient, expressive, elegant
