2.2. Built-in, application interface, and compound functions
Swift’s built-in functions are implemented by the Swift runtime system and perform various utility functions (numeric
conversion, string manipulation, etc.). Built-in operators (+, *, etc.) behave similarly.
An application interface function (declared by using the app keyword) specifies both the interface (input files and parameters;
output files) of an application program and the command-line syntax used to invoke the program. It thus provides the
information that the Swift runtime system requires to invoke that program in a location-independent manner.
For example, the following application interface defines a Swift function rotate that uses the common image processing
utility convert [5] to rotate an image by a specified angle. The convert executable will be located at run time in a catalog of
applications or through the PATH environment variable.
app (image output) rotate (image input, int angle) {
convert "-rotate" angle @input @output;
}