Flutter 들어가기 전에
Dart compiler

Dart Compiler는 Dart로 작성된 소스코드를 dart virtual machine에서 작동되도록 중간 언어 또는 기계어로 바꿔주는 툴이다.
Architecture에 따른 사용 compiler 종류
Dart는 Dart 언어를 변환할 때 용도(Development/Product)에 따라 다른 compiler를 사용한다.

- CPU Architecture(ARM32, ARM64, X86_64)
- Development - JIT(Just In Time) Compiler
- Product - AOT(Ahead Of Time) Compiler
- Web(Javascript)
- Development - dartdevc
- Product - dart2js
→ 왜 용도/목적에 따라 다른 compiler를 사용하는거지?
JIT? AOT?
Development Phase - Just In Time Compiler(JIT)

- JIT는 필요한 code만 compile한다.
- Runtime 환경에서 compile 하기 때문에 성능이 중요한 Production 상황에서는 적합하지 않음.
- JIT는 incremental recompilation이 가능하기 때문에 필요할 경우 수정된 부분만 recompile이 가능하다.
- 이는 Hot Reload라는 기능을 사용할 수 있도록 한다.
- 개발시 수정한 부분만 빠르게 적용해 확인할 수 있음. 매번 모든 코드를 recompile할 필요가 없기 때문에 생산성 부분에서 이점을 가져갈 수 있다.
Production Phase - Ahead Of Time Compiler(AOT)

- AOT는 모든 code를 기계어로 compile 한다.
- Debug tool 없음
- 성능 중시: production phase에 적합함.
JIT vs AOT

- Debug 관련해서는 JIT가 적합, 특히 Hot Reload
- Start time 및 Run time을 고려하면 AOT가 적합
→ 생산성을 중시하는 Production Phase에는 Hot Reload가 가능한 JIT, 성능을 중시하는 Production Phase에는 모든 Code를 최적화하는 AOT Compiler를 사용한다.
Flutter
공부하다가 든 생각:
javascript 기반 react native로 개발하면 dart라는 새로운 언어 안배워도 되는데 왜 flutter를 쓰지?
Rendering Procedures

Rendering (React Native vs Flutter)

출처
How does dart VM work? - Raahavaijth
Flutter architectural overview
[Flutter] 3. 플러터의 렌더링
Flutter vs. React Native - detailed framework comparison