Running a single file

Just a quick question:
Does the following command run the code in test.swift like an interpreter, or does it do a compilation step first (without spitting out the binary)?

swift test.swift

The man page only says it "executes" the program.

Looks like that invocation expands to swift -frontend -interpret test.swift with some other arguments, which calls into:

  • swift::performFrontend
  • performCompile
  • llvm::ExecutionEngine::runFunctionAsMain
  • llvm::MCJIT::runFunction
Terms of Service

Privacy Policy

Cookie Policy