Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOS: AOT ahead of time, what is it?

I have read an article from Xamarin, and came across a particular computer science word : Ahead of Time. According to some google search result, this AOT does not allow for code generation during run time. Does it mean, it does not support dynamic stuff?

I know this question may stupid and I have 0 knowledge in IOS, hopefully can get some answer from here. thanks

like image 246
WenHao Avatar asked Mar 28 '13 14:03

WenHao


People also ask

Is iOS AOT?

iOS applications run within the Mono execution environment, and use full Ahead of Time (AOT) compilation to compile C# code to ARM assembly language. This runs side-by-side with the Objective-C Runtime.

What would you use ahead of time AOT compilation?

The Angular ahead-of-time (AOT) compiler converts your Angular HTML and TypeScript code into efficient JavaScript code during the build phase before the browser downloads and runs that code. Compiling your application during the build process provides a faster rendering in the browser.

Why AOT is used for Xamarin iOS?

Apple has put a security feature on iOS where it disallows any dynamically generated codes on that device. Xamarin. iOS understands this safety restriction and uses Ahead of Time compiler also known as AOT and compiles the managed codes of Microsoft Intermediate Language (MSIL) and produces a native iOS binary code.

What does AOT compilation mean?

In computer science, ahead-of-time compilation (AOT compilation) is the act of compiling an (often) higher-level programming language into an (often) lower-level language before execution of a program, usually at build-time, to reduce the amount of work needed to be performed at run time.


1 Answers

First, what is the definition of dynamic? For the general public, dynamic code mean the application can change functionality at run-time. For the iOS platform, the binaries are signed to prevent malware. And Apple don't like apps that can load functionality at run-time.

An ahead-of-time (AOT) compiler has nothing to do with dynamic code per se. It's has to do with intermediate language that are just-in-time compilation (JIT). The biggest example of intermediate language is Java bytecode; compile once, run anywhere. When a Java application is executing, the compiled code is JIT to native machine code. AOT compiler is just doing it ahead of time, to save time.

For the iOS platform, Xcode compiles Objective-C to a native binary for the device.

like image 177
Black Frog Avatar answered Sep 20 '22 20:09

Black Frog