According to Wikipedia:
- Swift is a general-purpose, multi-paradigm, compiled programming language developed by Apple Inc. and the open-source community. First released in 2014, Swift was developed as a replacement for Apple's earlier programming language Objective-C, as Objective-C had been largely unchanged since the early 1980s and lacked modern language features.
Running Swift-language builds and doing Swift development is possible on Linux.
Install AUR for the released version, which is a repackaged Fedora binary, or AUR for a native build from source.
UseAUR for the development version.
For code completion the sourcekit language server protocol, sourcekit-lsp is available, e.g. as plugin to visual studio code, . See below.
Editing and code completion
Install , then install sourcekit-lsp from source, is needed.
$ git clone firstname.lastname@example.org:apple/sourcekit-lsp.git $ cd Editors/vscode $ npm run createDevPackage $ code --install-extension out/sourcekit-lsp-vscode-dev.vsix
The Swift package manager allows to create example programs.
$ swift package init --type executable $ swift run
For a library:
$ swift package init $ swift build
Read eval print loop, REPL
For details on the swift REPL, see here.
Welcome to Swift version 5.3 (swift-5.3-RELEASE). Type :help for assistance. 1> 1+1 $R0: Int = 2 2>