LEVEL 5
কম্পাইলার
Compilers
এই মডিউল যে প্রশ্নের উত্তর দেয়একটা text file কীভাবে চলমান machine code হয়ে ওঠে?
Compiler হলো CS-এর সবচেয়ে সুন্দর pipeline-গুলোর একটা। এখানে আমরা পুরোটা নিজে বানাব — lexer থেকে code generation পর্যন্ত। এরপর আপনি আর কোনো compiler-কে black box মনে করবেন না।
লেসন
এই মডিউলের লেসন এখনো লেখা হচ্ছে। নিচে যা যা থাকছে অংশে পুরো outline দেখতে পাচ্ছেন — সেই ক্রমেই কনটেন্ট আসবে।
যা যা থাকছে
- Compiler pipeline overview
- Lexical analysis, regular languages, DFA construction
- Parsing — recursive descent, LL, LR, Pratt
- Grammars, ambiguity, precedence
- AST design
- Semantic analysis, symbol tables, scoping
- Type checking ও type errors
- Intermediate representation — three-address code, SSA
- Control flow graph ও dataflow analysis
- Optimizations — constant folding, DCE, CSE, inlining, loop opts
- Register allocation (graph coloring, linear scan)
- Instruction selection ও scheduling
- Code generation
- Linking — static, dynamic, relocation, symbol resolution
- Loading ও dynamic linker
- JIT compilation
প্রজেক্ট
Lexer + Pratt Parser
●●●○○Expression language-এর precedence-correct parser।
Bytecode VM
●●●●○Stack machine, compiler থেকে bytecode, dispatch loop।
Full Toy Compiler
●●●●●নিজের ভাষা → x86-64 assembly → চলমান binary।