Title here
Summary here
Our first program will print the classic “hello world” message. Here’s the full source code.
import Foundation
print("hello world")To run the program, save the code in a file with a .swift extension and use the Swift compiler to run it.
$ swift hello-world.swift
hello worldSometimes we’ll want to build our programs into binaries. We can do this using the Swift compiler.
First, compile the code into an executable:
$ swiftc hello-world.swift -o hello-world
$ ls
hello-world hello-world.swiftWe can then execute the built binary directly.
$ ./hello-world
hello worldNow that we can run and build basic Swift programs, let’s learn more about the language.