Welcome to compilers 131B: static semantic checking and code generation Read: Chapter 5 (review), Chapter 6 (Thursday and thereafter) Introduce people - self + interests in software engineering, compilers, programming languages, and parallel computing + aikido (martial arts), music, biking, hiking, fine food :) - TA's and proctors The course itself - A Compiler is a special case of a Translator + Translation from human to machine languages, with eye to optimization + How do gcc, g++, javac, etc. work? + Also teaches general techniques in translation: parsing web pages, e-mail messages, etc. + Focus here on "back-end" - Static semantic checking (is program consistent?) - Code generation to machine language - It's not just a lot of coding, but maybe biggest program you've written + Integrating and applying all the knowledge from previous classes (e.g, C/C++, data structures, automata, systems & assembly programming) + Learn about practical aspects of language design and computer architecture - This is a also course in Engineering: building large, complex systems + Design for separation of concerns, reuse (e.g., object-orientation) + Making good use of tools to save labor + Teamwork: cooperating with other people to complete a large task + Avoiding failure through planning (specify, design, and test) + Using domain-specific knowledge to simplify system building (e.g., parsing theory, software architecture) - In other words, this course is part of your preparation for becoming the next generation of great programmers, system builders, and engineers + You're the top students in California + 19th century engineer John Roebling designed the Brooklyn Bridge - at 1595.5 feet, the world's longest suspension bridge at the time - also arguably the most beautiful bridge, the centerpiece of the NYC skyline + Software - in baby steps - Ken Thompson and Dennis Ritchie - Unix - Linus Torvalds - Linux - Richard Stallman - GNU utilities - Charles Simonyi - MS Word - James Gosling and others - Java libraries + Behind each of these big names are a superb team of engineers - Engineering efforts are by definition the work of many good people working cooperatively Knowledge vs. Skill - This is not just a knowledge class (memorization and recall) - This is an experience/skill class: practice, failure, and learning from it - To get a good grade, you cannot just understand the material - You must be able to *apply* it successfully - If you are dedicated to this class, you will be successful + initial failures inform how to do things better later Organization, Exams, and Project - Everything you need to know is on the web + Project info, announcements + Notes for this class, also available at Soft Reserves. Bring them to class to aid your notetaking. - We are available a *lot* of the time + E-mail, discussion forum, sun lab, office hours, + In a pinch? drop by - 50% exams, 50% project - Exams: 15% quizzes (8-10 on Tuesdays, drop 2-3 lowest), 35% final + Drawn from material covered in lecture + Basic knowledge + Apply knowledge in new situations - Project + 2 projects: Static Semantic Checking, Code Generation - there will be weekly internal milestones and other techniques to ensure steady progress + See web site for details, updates + Review handout - static semantic checking - extend symbol table to represent types - extend parser to pass around variables/types - add actions to parser to manipulate types A Word on Academic Integrity - First, about FAIRNESS: each students should have equal access to materials to assist them in the class + Your fellow student's grade reflects what he or she knows + Your grade reflects what you know + Other people doing unfairly well makes you look worse - jobs, grad school, etc. - Also about competence and ability + Employers know what they are getting + Can build the software that the student's record promises + A huge deal in ``mission critical'' systems - from air traffic control to accounting systems - Living in the real world + Borrowing other people's work is called theft and fraud + Lose job, land in jail, ruin company - The ground rules for 131B + Can only use resources explicitly provided by me and TA's + In particular, cannot use or see someone else's Oberson compiler + We compare against every compiler developed over last 10 years - Penalties can be severe + Failure, suspension, explusion + Better to withdraw and retake, if necessary - Fact: violations often occur in a panic at the last minute + Start early + Keep your head - If you are unsure, ask Review Remaining Handouts Break: who needs partner, compiler, account, card signed?