DrainOpener
DrainOpener

Reputation: 196

Compile times and run times concept

I am trying to understand behind the scenes periods when writing codes to clicking on iPhone Screen. I made some enumerations to make question clear.

Time 1: I am writing codes on Xcode ( compile time )


Time 2: There is a syntax error or I forgot the override keyword ( compiler works on behind the scene and say hey you have an error, fix this)


Time 3: I fixed the error, looks like there is no error. ( compile time )


Time 4: I pushed the Command + B and no error ( compile time - swift compiler converted my front end code to assembly code for my CPU and RAM


Time 5: Command R ( Run time )


Time 6: My app works fine. ( Run time )

Rather than pointing stack on compile time and heap on run time ( value types on stack - reference types on heap ) ,

I almost read all resources so I have some background but I could not imagine what is going on exactly when I divide this time slots. Thanks

Upvotes: 1

Views: 761

Answers (1)

Ptit Xav
Ptit Xav

Reputation: 3219

Just to resume a little : Time 1 to Time 3 are editor time. What happens there is that the compiler is run only to check for syntax, variable initialization, parameters validity,... This is just ´precompilation’

Time 4 is compile time where machine code is generated, link who’s all needed libraries and frameworks.

Time 5 is installation, start (eventually debugger connection to running process)

Time 6 is application is running and interacting with user

Upvotes: 2

Related Questions