Add Constant Folding and Dead Code Elimination to a Teaching Compiler
Overview
What this challenge is about.
Add Constant Folding and Dead Code Elimination to a Teaching Compiler. Intermediate challenge in design. Designing real products under real constraints, earn...
The Brief
What you'll do, and what you'll demonstrate.
Design and propose constant folding and dead code elimination passes over the compiler's existing intermediate representation, prove they preserve behavior, and demonstrate measurable instruction-count reductions on a benchmark suite.
This is not a design exercise. It is the work a product designer does between a brief and a shipped interface. That distinction matters to every hiring manager who has seen candidates redesign Spotify's homepage and none who have worked under real product constraints.
When you finish, you will have something most graduates do not: a real-world deliverable, verified by Ewance, that you can show to a hiring manager and say "I did this. Here is the proof."
Earning criteria — what you'll demonstrate
- Read and reason about a three-address, register-based intermediate representation, including which instructions carry side effects.
- Implement constant folding as a structure-preserving intermediate-representation transformation.
- Implement dead code elimination with a worklist algorithm that reaches a fixed point and never removes observable behavior.
- Design a reproducible benchmark that measures the right signal (instruction-count reduction) rather than noisy proxies.
- Package a behavior-preserving change as a review-sized, maintainer-acceptable contribution.
Program Fit
Where this fits in your program.
Sharpens the same skills your degree expects you to demonstrate.
Aligned coursework coming soon.
Skills
Skills you'll demonstrate.
Each one shows up on your verified credential.
- Intermediate Representation
Apply intermediate representation to solve real industry problems and demonstrate production-level capability.
- Constant Folding
Apply constant folding to solve real industry problems and demonstrate production-level capability.
- Dead Code Elimination
Apply dead code elimination to solve real industry problems and demonstrate production-level capability.
- Compiler Passes
Apply compiler passes to solve real industry problems and demonstrate production-level capability.
- Benchmarking
Apply benchmarking to solve real industry problems and demonstrate production-level capability.
- Unit Testing
Apply unit testing to solve real industry problems and demonstrate production-level capability.
Careers
Career paths this challenge builds toward
Completing this challenge demonstrates skills that transfer directly to these roles:
Compiler Engineer
Building correct, fixed-point optimization passes over an intermediate representation is the core daily work of compiler teams. This challenge has you reason about a real instruction format, preserve semantics, and prove improvements — exactly what production optimization work demands.
This challenge sharpens
- intermediate-representation
- constant-folding
- dead-code-elimination
Developer Tools Engineer
Toolchain and developer-tooling roles require shipping behavior-preserving transformations and proving they help without breaking users. Here you design passes, measure their effect, and package the change for review, mirroring how tooling teams land improvements safely.
This challenge sharpens
- compiler-passes
- benchmarking
- unit-testing
Performance Engineer
Performance work lives or dies by trustworthy measurement and safe transformations. This challenge trains you to define the right metric, reproduce it across a suite, and prove an optimization actually reduces work rather than just looking faster.
This challenge sharpens
- benchmarking
- compiler-passes
- constant-folding