# CS 6120: 고급 컴파일러 자기주도 온라인 강좌 (2020)

> Clean Markdown view of GeekNews topic #30649. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=30649](https://news.hada.io/topic?id=30649)
- GeekNews Markdown: [https://news.hada.io/topic/30649.md](https://news.hada.io/topic/30649.md)
- Type: GN+
- Author: [neo](https://news.hada.io/@neo)
- Published: 2026-06-20T00:41:16+09:00
- Updated: 2026-06-20T00:41:16+09:00
- Original source: [cs.cornell.edu](https://www.cs.cornell.edu/courses/cs6120/2025fa/self-guided/)
- Points: 1
- Comments: 1

## Topic Body

- Cornell CS의 박사 수준 강좌 **CS 6120**은 컴파일러와 프로그래밍 언어 구현을 체계적으로 배우려는 사람에게 중간 표현, 데이터 흐름, 최적화, 병렬화, JIT, 가비지 컬렉션까지 한 흐름으로 제공함
- 자기주도 버전은 가상의 대학에서 **4학점 무성적**으로 수강하는 형식이며, 영상·필기 노트·논문 읽기·구현 과제를 선형 일정으로 따라가게 되어 있음
- 실습은 **LLVM**과 교육용 IR인 **Bril**을 사용해 추상적인 컴파일러 개념을 실제 코드 작성으로 확인하도록 설계됨
- 실제 Cornell 수업과 달리 과제 마감일을 무시할 수 있지만 Zulip 토론에는 참여할 수 없고, 학기말 프로젝트 대신 자기주도 버전만의 마지막 과제가 주어짐
- 강좌 자료는 GitHub에 **오픈소스**로 공개되어 있어 문제를 제보할 수 있으며, 수료 후 피드백 폼을 통해 개선 의견을 보낼 수 있음

---

### 강좌 구성과 수강 방식
- **CS 6120**은 [Cornell CS](https://www.cs.cornell.edu/)의 Adrian Sampson이 만든 프로그래밍 언어 구현 강좌임
- 범용 컴파일러의 기본 주제와 연구 성격의 주제를 함께 다룸
  - 중간 표현
  - 데이터 흐름
  - 고전적 최적화
  - 병렬화
  - JIT 컴파일
  - 가비지 컬렉션
- 학습은 논문 읽기와 오픈소스 해킹 과제로 이어짐
  - [LLVM](https://llvm.org/)을 사용함
  - 수업용 교육 IR인 [Bril](https://capra.cs.cornell.edu/bril/)을 사용함
- 자기주도 커리큘럼은 영상 시청과 논문 읽기를 섞은 **선형 일정**으로 구성됨
- 일부 레슨에는 **구현 과제**가 포함되어 있으며, 개방형 코드 작성으로 추상 개념을 익히게 함
- 실제 CS 6120과 자기주도 버전에는 차이가 있음
  - 과제 마감일을 무시할 수 있음
  - Zulip 토론 스레드에는 참여할 수 없음
  - 실제 수업에는 학기말 프로젝트가 있음
  - 자기주도 버전의 학기말 과제는 “컴파일러의 마법으로 세상을 바꾸는 것”임
- 강좌는 [GitHub에 오픈소스](https://github.com/sampsyo/cs6120)로 공개되어 있어 문제가 있으면 버그를 제보할 수 있음
- 수료 후 [피드백 폼](https://forms.gle/GuRiMa728DUvTbZQ7)을 작성할 수 있음

### 레슨과 읽기 자료 흐름
- ## 입문과 프로그램 표현
  - [Lesson 1: Welcome & Overview](https://www.cs.cornell.edu/courses/cs6120/2025fa/lesson/1/)
    - [video](https://vod.video.cornell.edu/media/0_bug89uok)
    - [Producing Wrong Data Without Doing Anything Obviously Wrong!](https://dl.acm.org/citation.cfm?id=1508275)
    - [SIGPLAN Empirical Evaluation Guidelines](https://www.sigplan.org/Resources/EmpiricalEvaluation/)
  - [Lesson 2: Representing Programs](https://www.cs.cornell.edu/courses/cs6120/2025fa/lesson/2/)
    - [representing programs](https://vod.video.cornell.edu/media/1_vnx6laq9)
    - [getting started with Bril](https://vod.video.cornell.edu/media/1_jc91ke0h)
- ## 분석과 최적화의 기본기
  - [Lesson 3: Local Analysis & Optimization](https://www.cs.cornell.edu/courses/cs6120/2025fa/lesson/3/)
    - [simple dead code elimination](https://vod.video.cornell.edu/media/1_6k52flbg)
    - [local value numbering](https://vod.video.cornell.edu/media/1_i2gnhw41)
  - [Lesson 4: Data Flow](https://www.cs.cornell.edu/courses/cs6120/2025fa/lesson/4/)
    - [data flow](https://vod.video.cornell.edu/media/1_72tqupsb)
    - [implementation task](https://vod.video.cornell.edu/media/1_mjy6lamo)
  - [Lesson 5: Global Analysis](https://www.cs.cornell.edu/courses/cs6120/2025fa/lesson/5/)
    - [global analysis & optimization](https://vod.video.cornell.edu/media/1_i5apfx6t)
    - [Efficient Path Profiling](https://dl.acm.org/citation.cfm?id=243857)
  - [Lesson 6: Static Single Assignment](https://www.cs.cornell.edu/courses/cs6120/2025fa/lesson/6/)
    - [static single assignment](https://vod.video.cornell.edu/media/1_130pq2fh)
    - [Provably Correct Peephole Optimizations with Alive](https://dl.acm.org/citation.cfm?id=2737965)
- ## LLVM과 루프·프로시저 간 분석
  - [Lesson 7: LLVM](https://www.cs.cornell.edu/courses/cs6120/2025fa/lesson/7/)
    - [introduction to LLVM](https://vod.video.cornell.edu/media/1_f231lwkz)
    - [writing an LLVM pass](https://vod.video.cornell.edu/media/1_4nrtmvc9)
  - [Lesson 8: Loop Optimization](https://www.cs.cornell.edu/courses/cs6120/2025fa/lesson/8/)
    - [video](https://vod.video.cornell.edu/media/1_2shcxd1h)
  - [Lesson 9: Interprocedural Analysis](https://www.cs.cornell.edu/courses/cs6120/2025fa/lesson/9/)
    - [video](https://vod.video.cornell.edu/media/1_9csov2la)
    - [Type-Based Alias Analysis](https://dl.acm.org/citation.cfm?id=277670)
- ## 메모리 관리와 동적 컴파일러
  - [Lesson 10: Alias Analysis](https://www.cs.cornell.edu/courses/cs6120/2025fa/lesson/10/)
    - [video](https://vod.video.cornell.edu/media/1_7ngps985)
    - [A Unified Theory of Garbage Collection](https://dl.acm.org/citation.cfm?id=1028982)
    - [Fast Conservative Garbage Collection](http://www.cs.utexas.edu/~mckinley/papers/conservative-gc-oopsla-2014.pdf)
  - [Lesson 11: Memory Management](https://www.cs.cornell.edu/courses/cs6120/2025fa/lesson/11/)
    - [video](https://vod.video.cornell.edu/media/1_21p8mjsw)
    - [An Efficient Implementation of SELF, a Dynamically-Typed Object-Oriented Language Based on Prototypes](http://portal.acm.org/citation.cfm?id=74884)
    - [Trace-Based Just-in-Time Type Specialization for Dynamic Languages](https://dl.acm.org/citation.cfm?id=1542476.1542528)
  - [Lesson 12: Dynamic Compilers](https://www.cs.cornell.edu/courses/cs6120/2025fa/lesson/12/)
    - [Dynamic Compilers](https://vod.video.cornell.edu/media/1_ltb1t94i)
    - [Tracing via Speculation](https://vod.video.cornell.edu/media/1_nk1o4hzm)
    - [Superoptimizer: A Look at the Smallest Program](https://courses.cs.washington.edu/courses/cse501/15sp/papers/massalin.pdf)
    - [Chlorophyll: Synthesis-Aided Compiler for Low-Power Spatial Architectures](https://dl.acm.org/citation.cfm?id=2594339)
- ## 병렬성과 빠른 컴파일러
  - [Lesson 13: Concurrency & Parallelism](https://www.cs.cornell.edu/courses/cs6120/2025fa/lesson/13/)
    - [video](https://vod.video.cornell.edu/media/1_8cpusna2)
    - [Threads Cannot Be Implemented as a Library](https://dl.acm.org/doi/10.1145/1065010.1065042)
    - [Exploiting Superword Level Parallelism with Multimedia Instruction Sets](https://dl.acm.org/doi/10.1145/358438.349320)
    - [A Type and Effect System for Deterministic Parallel Java](http://dpj.cs.illinois.edu/DPJ/Publications_files/DPJ-OOPSLA-2009.pdf)
    - [Formal Verification of a Realistic Compiler](https://dl.acm.org/citation.cfm?id=1538814)
  - [Lesson 14: Fast Compilers](https://www.cs.cornell.edu/courses/cs6120/2025fa/lesson/14/)
    - 제목만 목록에 포함되어 있음

## Comments



### Comment 59992

- Author: neo
- Created: 2026-06-20T00:41:17+09:00
- Points: 1

###### [Hacker News 의견들](https://news.ycombinator.com/item?id=48583606) 
- 동적 컴파일러 부분은 거의 전부 **트레이스 컴파일**에 대한 내용에 가깝다. 일반적으로 트레이스 컴파일은 막다른 길이었고 여러 번 버려져 왔음  
  여기서 더 중요한 개념은 **타입 피드백**, 추측 실행과 역최적화, 빠른 컴파일러와 계층화라고 봄  
  강의 전체는 좋아 보이고, 이렇게 많은 자료가 온라인에 공개된 것도 훌륭함
  - 트레이싱은 역사적으로 조직 원리로는 실용적이지 않다는 게 드러났지만, 배워두면 사고를 넓혀주는 개념이라고 생각함  
    말한 것처럼 산업계에서 **실제로 잘 작동하는 것**에 대한 맥락을 더 제공하고 싶음
  - PyTorch의 **torch.compile** 작업을 하고 있는데, 이것도 트레이싱 컴파일러임  
    다만 이 영역은 꽤 좁을 수 있고, 전통적인 컴파일러와도 많이 달라서 우리가 하는 일 중 일부를 보면 꽤 불편해할지도 모름
  - JAX도 **트레이싱 컴파일러**임  
    물론 TraceMonkey나 LuaJIT와는 문제 공간이 극단적으로 다르다는 건 알고 있음
  - TraceMonkey 논문이 박사 자격시험 읽기 목록에 있었고, 마침 그 시험 시기가 TraceMonkey가 SpiderMonkey에서 제거되던 때와 겹쳤음  
    당시 개발자 중 한 명, 아마 Jason Orendorff였던 사람과 이야기했는데, 트레이싱은 잘 안 풀린다고 했고, 제한적인 조건에서는 가능할 수도 있다고 봤음  
    다만 그 조건이 무엇이었는지는 완전히 잊어버림
  - 트레이스 컴파일은 막다른 길이 **아님**  
    **LuaJIT**는 큰 프로그램에서도, 수억 대의 서버와 기기에서도 잘 작동함  
    학자들조차 이 상투적인 얘기를 계속 반복하는 게 정말 안타까움. 모르는 게 약이라는 말이 떠오름

- 이전 관련 글들:  
  CS 6120: Advanced Compilers: The Self-Guided Online Course - [https://news.ycombinator.com/item?id=39577878](<https://news.ycombinator.com/item?id=39577878>) - 2024년 3월, 댓글 102개  
  Advanced Compilers: Self-Guided Online Course - [https://news.ycombinator.com/item?id=35130975](<https://news.ycombinator.com/item?id=35130975>) - 2023년 3월, 댓글 82개  
  Advanced Compilers: Self-Guided Online Course - [https://news.ycombinator.com/item?id=25386756](<https://news.ycombinator.com/item?id=25386756>) - 2020년 12월, 댓글 232개

- 이 강의가 왜 **고급**인지 조금 헷갈림. 대부분의 주제, 예를 들어 죽은 코드 제거, 데이터 흐름, 지배자 분석, SSA 형식은 컴파일러 첫 강의에 들어갈 것처럼 보임
  - 강의 번호가 꽤 규칙적이라 “입문 컴파일러” 강의가 뭔지 찾아볼 수 있음: [https://www.cs.cornell.edu/courses/cs4120/2026sp/?schedule](<https://www.cs.cornell.edu/courses/cs4120/2026sp/?schedule>)  
    짧게 말하면 컴파일러는 사실상 두 과목으로 나뉘고, 첫 과목은 컴파일러를 만들기 위한 최소 요소인 어휘 분석, 구문 분석, 코드 생성, 레지스터 할당을 다룸  
    두 번째 과목은 **최적화 컴파일러**를 만드는 방법에 해당함
  - 관련 자료를 엄청 많이 읽었지만, 그런 내용은 대부분에 포함되지 않았음  
    실제로 컴파일러든 인터프리터든 **백엔드**는 거의 항상 “독자에게 맡기는 연습문제”로 남겨짐  
    클로저를 만드는 법, 환경을 추적하는 법, 패턴 매칭, 메모리 표현 등 아직 찾아내야 할 게 얼마나 많은지 상상하기 어려울 정도임  
    흥미로운 모든 것은 직접 찾아봐야 함  
    추신: 이건 그중 한 해 분량일 뿐임: [https://gist.githubusercontent.com/mamcx/e1743571b9a1ea163a7...](<https://gist.githubusercontent.com/mamcx/e1743571b9a1ea163a7f9f07aa6a8ae2/raw/1352e98e586805168c01cbc53d42a5fba7445488/Lang.mkdown>)
  - 비전문가들은 대개 구문 분석부터 시작하고 **백엔드**를 접하지 못하는 경우가 많다고 봄  
    인터프리터와 컴파일러 책을 두 권 읽었는데, 백엔드는 많이 다루지 않았음  
    아마 백엔드 입문 강의에 가까운 것 아닐까 싶음
  - 그럼 무엇이 고급인지 궁금함. 죽은 코드 제거, 데이터 흐름, SSA, 명령어 선택, 레지스터 할당을 제대로 다루면 사실상 **백엔드의 98%** 에 가깝다

- 이런 식의 **자기 주도형 온라인 대학 수준 컴퓨터과학 강의**가 또 있을까?
  - 수십 개는 있음. “mooc”로 검색하면 됨  
    어떤 교수들은 “mooc” 프레임워크 밖에서도 강의와 과제를 공개함  
    댓글로 질문했을 때 답해준 교수도 있었음. 인터넷은 아직 꽤 멋질 때가 있음

- Nora Sandler의 **Writing a C compiler**와 비교했을 때, 독자가 얻을 수 있는 이득은 어떻게 다를까?
  - 그 책은 학부 수준 컴파일러 강의에서 얻는 내용에 더 가깝고, 이 강의는 그보다 **더 고급 내용**을 다룸  
    초보자나 취미로 파보는 사람이라면 그 책이나 비슷한 수준의 자료로 시작한 뒤, 이 강의를 시도하면서 빈틈을 채우는 편이 좋음

- 고급 단계로 들어가기 전에 볼 수 있는 **기초 컴파일러** 자기 주도형 강의도 있을까?
  - Essentials of Compilation [1][2]와 Writing a C Compiler [3]의 구성을 좋아함  
    인터프리터부터 시작하고 싶다면 Essentials of Programming Languages [4]가 좋음  
    이 사이트와 다른 곳에서 Crafting Interpreters가 인기 있는 건 인정하지만 개인적으로는 좋아하지 않음. 그래도 다른 사람들은 좋아하니 시도해볼 만하고 무료로 볼 수 있음  
    EOC와 EOPL은 다소 학술적인 편이지만, Scheme과 Racket에 불편함을 느끼는 사람들을 제외하면 꽤 접근하기 좋다고 봄. EOC의 Python 버전은 그 문제를 줄여줌  
    그다음에는 더 깊고 학술적인 컴파일러 책들이 더 쉽게 다가옴  
    [1] [https://mitpress.mit.edu/9780262047760/essentials-of-compila...](<https://mitpress.mit.edu/9780262047760/essentials-of-compilation/>) - Racket 버전, 오픈 액세스 버전 있음  
    [2] [https://mitpress.mit.edu/9780262048248/essentials-of-compila...](<https://mitpress.mit.edu/9780262048248/essentials-of-compilation/>) - Python 버전, 오픈 액세스 버전 있음  
    [3] [https://nostarch.com/writing-c-compiler](<https://nostarch.com/writing-c-compiler>) - 구현 언어 선택 가능  
    [4] [https://mitpress.mit.edu/9780262062794/essentials-of-program...](<https://mitpress.mit.edu/9780262062794/essentials-of-programming-languages/>) - Scheme이지만 Racket에서 사용 가능
  - **Crafting Interpreters** [1]를 보는 걸 추천함  
    두 부분으로 되어 있고, 첫 번째는 Java로 트리 순회 인터프리터를 만든 뒤 C로 작성한 버전으로 더 나아감  
    1. [https://craftinginterpreters.com/](<https://craftinginterpreters.com/>)
  - 직접 해보진 않았지만 “the-super-tiny-compiler”가 있음:  
    [https://github.com/jamiebuilds/the-super-tiny-compiler](<https://github.com/jamiebuilds/the-super-tiny-compiler>)
  - 오래됐지만 고전인 David Gries의 **Compiler Construction for Digital Computers**로 시작하는 걸 추천함  
    여기서 추천된 현대적인 책 몇 권과 함께 보면 충분할 것임  
    David Gries - [https://www.cs.cornell.edu/gries/](<https://www.cs.cornell.edu/gries/>) 및 [https://en.wikipedia.org/wiki/David_Gries](<https://en.wikipedia.org/wiki/David_Gries>)  
    네덜란드 컴퓨터과학자 Dick Grune는 Compiler Construction for Digital Computers에 대해 “여러 세대의 컴파일러 제작자가 이 책과 함께 성장했고, 그들은 후회하지 않았다”고 썼음  
    Dick Grune 본인도 컴파일러와 프로그래밍 언어 책으로 유명함 - [https://dickgrune.com/index.html](<https://dickgrune.com/index.html>) 및 [https://en.wikipedia.org/wiki/Dick_Grune](<https://en.wikipedia.org/wiki/Dick_Grune>)

- Rust 컴파일러를 다룬 팟캐스트를 봤는데, 시스템을 크래시시킬 수 있는 코드인지 판단하는 데 어떤 지점에서는 **기계학습 알고리즘**이 들어간다고 했던 것 같음
  - 그런 얘기는 들어본 적이 없고 거의 틀렸다고 확신함. 물론 “기계학습”이라는 말이 넓긴 함  
    출처가 있을까?

- alexia massalin이 요즘 **microunity 특허 로열티**를 받는 것 말고 뭘 하고 있는지 정말 궁금함
