main.rs Program.cs rustc Roslyn app.exe app.dll OS loader .NET Runtime CPU JIT Run Run
인사이트북 · 언어 런타임 비교
Rust vs C#
코드 한 줄이 실행되기까지 두 언어가 걷는 6단계
6 단계 · Source → Run
2 언어 · Rust, C#
1 장의 원문 인포그래픽
대표님께 드리는 정리 원문: TechWorld with Milan · 2026. 11
Contents
목차
01 원문 인포그래픽 p.3
02 한눈에 보는 6단계 p.4
03 PART · 6단계 나란히 p.5
04 Source · 소스 파일 p.6
05 Compile · 컴파일 p.8
06 Artifacts · 결과물 p.10
07 Load · 적재 p.12
08 Execute · 실행 p.14
09 Run · 동작 p.16
10 한 장 요약표 p.18
11 언제 무엇을 고르나 (해설) p.19
12 맺음 p.20
제목을 누르면 해당 쪽으로 이동합니다
읽는 법 색과 쪽 구성
Rust C# 주황 = Rust Cargo · rustc · native binary 보라 = C# Roslyn · IL · .NET Runtime 각 단계 = 두 쪽 왼쪽: 도식으로 풀어 쓴 쪽 · 오른쪽: 원문 그림 2× 확대
해설 해설 표시가 붙은 글은 원문 인포그래픽 밖의 일반 설명입니다. 나머지 라벨·수치는 모두 원문 그대로입니다.
01 · Original
원문 인포그래픽 한 장
대표님, 이 책은 아래 한 장을 단계별로 풀어 쓴 것입니다. 그림을 누르면 크게 볼 수 있습니다.
출처: TechWorld with Milan, "Rust vs C#" 인포그래픽 · 전체
02 · Big picture
같은 6단계,다른 시점 에 machine code
두 언어 모두 Source에서 Run까지 같은 6단계를 지나지만, CPU가 읽는 코드가 만들어지는 때가 다릅니다.
Rust C# Source main.rs Program.cs Compile Cargo build · rustc → Linker Roslyn → IL code Artifacts app / app.exe (native) app.dll (IL) Load OS loader → main() .NET Runtime · Loader Execute CPU runs machine code Tier 0 → Tier 1 JIT Run Runs native code directly Runs JIT-compiled code machine code 생성 native code 생성
한 줄 정리 Rust는 Compile에서 LLVM backend가 machine code를 내고, C#은 Execute에서 JIT가 native code를 만듭니다.
6
PART · 6 STEPS
여섯 단계 나란히 보기
단계마다 두 쪽입니다. 왼쪽은 도식, 오른쪽은 원문 그림입니다.
01 Source
02 Compile
03 Artifacts
04 Load
05 Execute
06 Run
01 · Source
출발점은 같다: 에디터와 소스 파일
두 언어 모두 Code Editor에서 소스 파일을 씁니다. 파일 이름만 다르고, 갈림길은 다음 단계부터입니다.
Rust C# Code Editor Source File main.rs Code Editor Source File Program.cs Cargo build 다음 단계 Roslyn compiler 다음 단계
RUST Source File main.rs → Cargo build로
C# Source File Program.cs → Roslyn compiler로
01 · Source · 원문 그림
출처: TechWorld with Milan, "Rust vs C#" 인포그래픽 · Source · Rust 출처: TechWorld with Milan, "Rust vs C#" 인포그래픽 · Source · C#
한 줄 정리 같은 출발점에서 Rust는 Cargo build로, C#은 Roslyn compiler로 넘어갑니다.
02 · Compile
Rust는 machine code까지, C#은 IL 까지
Rust의 rustc는 네 단계를 거쳐 machine code를 내고 Linker가 묶습니다. C#의 Roslyn은 IL과 metadata를 냅니다.
Rust C# Cargo build rustc compiler crates.io Parse expand macros → AST Type check types and traits Borrow check ownership, lifetimes LLVM backend emits machine code Linker app / app.exe Roslyn compiler Parse source → syntax tree Type check types, nullability Emit IL IL + metadata dotnet build IL IL code compile to IL app.dll
03 · Artifacts
결과물: 한 개의 binary vs app.dll
Rust는 std와 crates까지 한 binary로 묶어 바로 CPU가 읽을 수 있는 파일을 냅니다. C#의 app.dll은 아직 IL입니다.
Rust C# std crates app / app.exe one binary native machine code std + crates linked in one binary, no VM needed app.dll IL run time JIT native code IL, not machine code yet the JIT compiles it at run time (Native AOT: compiled at publish instead) Native AOT → publish 때 미리 컴파일
RUST app / app.exe · native machine code · no VM needed
C# app.dll · IL, not machine code yet · JIT가 run time에 컴파일
03 · Artifacts · 원문 그림
출처: TechWorld with Milan, "Rust vs C#" 인포그래픽 · Artifacts · Rust 출처: TechWorld with Milan, "Rust vs C#" 인포그래픽 · Artifacts · C#
해설 IL(Intermediate Language)은 특정 CPU 명령어가 아닌 중간 코드입니다. 그래서 실행하는 쪽(.NET Runtime)이 그 기계에 맞는 native code로 바꿔야 합니다.
해설 Native AOT는 원문에 괄호로만 나오는 선택지입니다. 이 방식을 쓰면 실행 시 JIT 대신 publish 시점에 미리 컴파일됩니다.
04 · Load
Load: OS loader 한 번 vs .NET Runtime
Rust는 OS loader가 system libs를 붙이고 바로 main()을 부릅니다. C#은 .NET Runtime이 assembly를 싣고 type을 읽어 들입니다.
Rust C# OS loader system libs libc / ucrt dynamically linked ← shared libs calls main() No VM or JIT to start up app.dll NuGet load assemblies → .NET Runtime (CLR + BCL) Loader + JIT Assembly Loader Type Loader ↓ first call → Execute Base Class Library System.* Garbage Collector frees objects no longer reachable
04 · Load · 원문 그림
출처: TechWorld with Milan, "Rust vs C#" 인포그래픽 · Load · Rust 출처: TechWorld with Milan, "Rust vs C#" 인포그래픽 · Load · C#
해설 CLR은 .NET의 실행 엔진(Common Language Runtime), BCL은 기본 클래스 라이브러리(Base Class Library)입니다. NuGet은 .NET의 패키지 관리자입니다.
05 · Execute
실행: CPU가 바로 vs JIT가 두 단계 로
Rust는 이미 만든 machine code를 CPU가 실행하고, 메모리는 ownership 규칙으로 정리합니다. C#은 처음 호출 때 Tier 0 JIT, 자주 쓰면 Tier 1 JIT로 다시 컴파일합니다.
Rust C# CPU runs machine code Ownership drop() runs when the owner goes out of scope, decided at compile time drop() owner scope 끝 Type Loader first call hot methods 30+ calls Tier 0 JIT unoptimized Tier 1 JIT optimized + PGO native code Garbage Collector frees objects no longer reachable gen 0/1/2
06 · Run
Run: 둘 다 결국native code 를 돌린다
마지막 화면은 비슷합니다. 차이는 native code를 언제 만들었는지, 그리고 메모리를 누가 정리하는지입니다.
Rust C# Runs native code directly ✕ no JIT warm-up ✕ no GC pauses Runs JIT-compiled native code memory managed by the GC native code가 만들어진 때 Compile 단계 LLVM backend Execute 단계 Tier 0 / Tier 1 JIT
RUST · 메모리 Ownership: owner가 scope를 벗어나면 drop(), compile time에 결정
C# · 메모리 Garbage Collector: 더는 닿지 않는 객체를 정리 (gen 0/1/2)
06 · Run · 원문 그림
출처: TechWorld with Milan, "Rust vs C#" 인포그래픽 · Run · Rust 출처: TechWorld with Milan, "Rust vs C#" 인포그래픽 · Run · C#
해설 JIT warm-up은 프로그램 초기에 메서드를 처음 컴파일하는 동안 생기는 지연을, GC pause는 garbage collector가 정리하는 동안 실행이 잠시 멈추는 현상을 흔히 부르는 말입니다. 크기는 프로그램과 설정에 따라 다르며, 원문은 수치를 제시하지 않습니다.
10 · Summary
한 장 요약표
원문 라벨을 단계별로 옮겼습니다. 굵은 차이는 Compile·Artifacts·Execute에 몰려 있습니다.
단계 Rust C# Source main.rsProgram.csCompile Cargo build + rustc: Parse → Type check → Borrow check → LLVM backend, 이후 Linker (crates.io) Roslyn: Parse → Type check → Emit IL (IL + metadata), dotnet build Artifacts app / app.exe · native machine code · std + crates를 한 binary로, no VM neededapp.dll · IL, not machine code yet · JIT가 run time에 컴파일 (Native AOT는 publish 때)Load OS loader + system libs (libc / ucrt, dynamically linked) → calls main() · No VM or JIT to start up .NET Runtime (CLR + BCL): app.dll·NuGet → Assembly Loader → Type Loader Execute CPU runs machine code · Ownership: scope 끝에 drop(), compile time에 결정 Tier 0 JIT (unoptimized) → 30+ calls → Tier 1 JIT (optimized + PGO) → native code · GC (gen 0/1/2) Run Runs native code directly · no JIT warm-up, no GC pauses Runs JIT-compiled native code · memory managed by the GC
11 · 해설 · Choosing
언제 무엇을 고르나
해설 원문 인포그래픽은 어느 쪽이 낫다고 말하지 않습니다. 이 쪽 전체가 해설이며, 원문에 나온 차이를 고를 때 던질 질문 으로 바꿔 본 것입니다.
질문 Rust 쪽 원문 근거 C# 쪽 원문 근거 배포물 한 binary, no VM needed app.dll + .NET Runtime (Native AOT 선택지 있음) 시작 직후 성능 no JIT warm-up Tier 0 → 30+ calls → Tier 1 (optimized + PGO) 메모리 정리 Ownership · drop() · Borrow check (compile time) Garbage Collector (gen 0/1/2) 라이브러리 crates.io · std NuGet · Base Class Library (System.*)
해설 · RUST 쪽으로 기울 때 runtime 없이 한 파일로 배포하고, 시작부터 JIT warm-up·GC pause 없이 돌아야 할 때
해설 · C# 쪽으로 기울 때 .NET Runtime이 주는 JIT 최적화(PGO), GC, 넓은 BCL에 메모리·최적화를 맡기고 싶을 때
해설 실제 선택은 팀의 경험, 기존 코드, 대상 플랫폼, 개발 속도처럼 이 인포그래픽 밖의 요소도 함께 봐야 합니다.