「Swift」の版間の差分
ナビゲーションに移動
検索に移動
Kusanaginoturugi (トーク | 投稿記録) (新規作成) |
(言語間リンクを追加) |
||
1行目: | 1行目: | ||
[[Category:プログラミング言語]] |
[[Category:プログラミング言語]] |
||
+ | [[en:Swift]] |
||
Running swift-language builds and doing swift development is possible on linux. To install swift use {{AUR|swift-bin}} for the released version, repackaged Fedora binary, or {{AUR|swift-language}} for a native build from source. {{AUR|swift-language-git}} will give the latest from git. For code completion the sourcekit language server protocol, [https://github.com/apple/sourcekit-lsp sourcekit-lsp] is available, e.g. as plugin to visual studio code, {{Pkg|code}}. |
Running swift-language builds and doing swift development is possible on linux. To install swift use {{AUR|swift-bin}} for the released version, repackaged Fedora binary, or {{AUR|swift-language}} for a native build from source. {{AUR|swift-language-git}} will give the latest from git. For code completion the sourcekit language server protocol, [https://github.com/apple/sourcekit-lsp sourcekit-lsp] is available, e.g. as plugin to visual studio code, {{Pkg|code}}. |
||
37行目: | 38行目: | ||
2> |
2> |
||
}} |
}} |
||
+ | |||
+ | {{TranslationStatus|Swift|2022-06-28|738421}} |
2022年8月14日 (日) 10:11時点における版
Running swift-language builds and doing swift development is possible on linux. To install swift use swift-binAUR for the released version, repackaged Fedora binary, or swift-languageAUR for a native build from source. swift-language-gitAUR will give the latest from git. For code completion the sourcekit language server protocol, sourcekit-lsp is available, e.g. as plugin to visual studio code, code.
Edit and code completion
Install code, then install sourcekit-lsp from source, nodejs is needed.
install vscode sourcekit-lsp from source
git clone git@github.com:apple/sourcekit-lsp.git cd Editors/vscode npm run createDevPackage code --install-extension out/sourcekit-lsp-vscode-dev.vsix
hello world
swift package manager allows to create example programs.
hello-world executable
swift package init --type executable swift run
hello-world library
swift package init swift build
read eval print loop, REPL
For details on the swift REPL, see here.
read eval print loop
> swift Welcome to Swift version 5.3 (swift-5.3-RELEASE). Type :help for assistance. 1> 1+1 $R0: Int = 2 2>