IITM BS Compiler Design (BSCS4032): Syllabus and Tips
By Editorial TeamLast reviewed
5 min readData ScienceOn this page
Compiler Design (BSCS4032) is a 4 credit elective at the degree level of the IITM BS in Data Science. You need Programming in C (BSCS3005) before you take it. Over 12 weeks you learn how a compiler turns source code into machine code, and you build one for a small subset of C using Flex and Bison.
| Code | Credits | Level | Prerequisites |
|---|---|---|---|
| BSCS4032 | 4 | Degree (4xxx code) | Programming in C (BSCS3005) |
The course is taught by Prof. Partha Pratim Das, Professor of Computer Science at Ashoka University. He also teaches Database Management Systems and Theory of Computation in the programme.
Handbook check. Compiler Design is not in the handbook's degree level course table (updated 18 March 2026). The handbook says a course code shows its level, so a 4xxx code points to level 4. But the handbook gives no stream tag and no term plan for this course. Check the registration page each term.
What you learn in Compiler Design
The weeks follow the path a program takes through a compiler.
- Weeks 1 and 2: the big picture and scanning. The front end and back end of a compiler, and where preprocessors, linkers and loaders fit. Then lexical analysis: tokens, regular expressions, turning an NFA into a DFA, and writing a scanner with Flex.
- Weeks 3 to 5: parsing and meaning. Grammars, recursive descent and LL(1) parsing with FIRST and FOLLOW sets. Then shift-reduce parsing, the LR family of parsers and a parser in Bison. Week 5 adds attribute grammars and type checking.
- Weeks 6 to 8: symbol tables and intermediate code. How names and scopes are stored, memory layout and activation records. Then translating expressions, arrays, boolean logic, loops and function calls into three-address code.
- Weeks 9 and 10: optimisation. Basic blocks and control flow graphs, removing repeated or dead code, constant folding and peephole fixes. Then data flow analysis, liveness and loop improvements.
- Weeks 11 and 12: target code and beyond. Instruction selection, register allocation by graph colouring and converting three-address code to assembly. The last week surveys garbage collection, JIT compilation and tools like LLVM.
The course page calls its teaching language nanoC, a subset of C. One learning outcome says picoC instead. The page does not explain the difference, so check the first week's material.
The main textbook is Compilers: Principles, Techniques, and Tools by Aho, Lam, Sethi and Ullman (updated 2nd edition, 2024). The page also lists a Flex and Bison manual by John Levine.
How the course is assessed
The course page points to the standard course structure on the programme's Academics page. It does not say how the compiler building work is graded. Ask the course team early.
Where Compiler Design counts
The course page lists it as an elective, so it fills elective credits at the degree level. Because it is missing from the handbook table, the handbook does not say whether it counts toward the rule of 2 programming stream courses at level 4 or higher. Ask support before you count on it for that. It is not part of any minor in the handbook. See the BS degree level and the full DS electives list.
Who finds it hard and how to prepare
The theory and the coding pull in different directions. Some students like the automata and grammar weeks but struggle when the C code grows past a few hundred lines. Others can code but find LR parsing tables slow and confusing.
- Set up Flex, Bison and a C compiler on a Linux machine before week 1. Run one sample file through all three.
- Build a tiny calculator with Flex and Bison on your own. It covers most of weeks 2 to 5 in miniature.
- Work out FIRST and FOLLOW sets and one small LR table by hand. Tool output makes much more sense after that.
- Keep your compiler in Git from day one, with one folder per phase. Later weeks build on earlier code.
- Read the matching textbook chapter after each week's lectures, not before.
What to take before and after
Programming in C (BSCS3005) is the formal prerequisite. Theory of Computation (BSCS3021) is not required, but its weeks on finite automata, regular expressions and context-free languages match Compiler Design weeks 2 to 4. Computer Systems Design (BSCS3031) ends with instruction sets and CPU design, which helps in the code generation weeks.
Common questions
Do I really build a full compiler?
The course page says you will build a working compiler for a C subset that goes through every stage down to machine code. It does not say how much of that is graded or how it is split across weeks.
Is Compiler Design useful for a data science student?
It is a programming heavy elective, not a data course. It suits you if you enjoyed C and want to understand how languages and tools work inside. If you want machine learning depth, other electives fit better.
Which assembly language does the course use?
The learning outcomes mention x86 as a target architecture. The week 11 topics cover turning three-address code into assembly and function calling conventions.
Official sources
Read next
- IITM BS Advanced Algorithms (BSCS4021): Syllabus and Tips
- IITM BS App Dev Lab (BSCS4010): Syllabus and Tips
- IITM BS Data Visualization Design (BSCS4001): Syllabus and Tips
- IITM BS Deep Learning Practice (BSDA5013): Syllabus and Tips
- IITM BS Operating System (BSCS4022): Syllabus and Tips
- IITM BS Reinforcement Learning (BSDA5007): Syllabus and Tips