Skip to content

Swift

Powerful and intuitive language for Apple platforms

Overview

Swift is Apple's modern programming language for iOS, macOS, watchOS, and tvOS development. It combines performance with safety and expressiveness.

Language Aliases

run swift "print(\"Hello\")"
run swiftlang "print(\"Hello\")"
# Output: Hello (x2)

Multi-line Code: Use Heredoc

For multi-line code, use heredoc (<< 'EOF') to avoid shell quoting and escaping issues.

REPL Behavior

Swift's REPL maintains state across commands. Variables, functions, and types persist within the same REPL session.