DOC PREVIEW
Berkeley COMPSCI 164 - Introduction to Programming Languages and Compilers

This preview shows page 1-2-3-26-27-28 out of 28 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Introduction to Programming Languages and CompilersProf. Richard FatemanAministriviaWill CS164 be the same as last or next semester?Should you wait ‘til next semester? Or later?Why Should You Study Compilers/ Programming Languages?5000 years ago: Babylonian clay tablet (base 60 numbers)500 years ago330 years ago (1675: Integral Calculus)100 years agoRussell/WhiteheadIverson’s APL (1960)OK, Notation helps thinking. Why ELSE Should We Study Programming Languages?Course StructureAcademic HonestyObjectives of the CourseThe Course ProjectYou have been writing programs for years– what more is there to learn?Overview: How are Languages Implemented?Common: Interpreters and Compilers bothAn orthogonal issue that is sometimes discussed: Is a language Batch or Interactive?There are Many Programming LanguagesBreak...Let’s Get Started with the Course Material!The Structure of a Typical CompilerLexical Analysis (The “lexer” or “scanner”)More Lexical AnalysisAnd More Lexical AnalysisParsing in a nutshell (we will spend several weeks elaborating on this, though)Diagramming an English SentenceProf Fateman CS 164 Lecture 1 1Introduction to Programming Languages and CompilersProf. Richard FatemanCS164 Fall 20059:30-11AMRoom 22 Warren HallTuesday / ThursdayProf Fateman CS 164 Lecture 1 2Aministrivia• Course home page:http://www-inst.eecs.berkeley.edu/~cs164• Course newsgroup: ucb.class.cs164 /note security issues• Pick up a class account here or at discussion section. You can negotiate a change in section if there is room. (TA: David Bindel)• NEXT LECTURE and thereafter: Meet in 306 Soda Hall (“HP auditorium”) [unless there are objections?]Prof Fateman CS 164 Lecture 1 3Will CS164 be the same as last or next semester?• No.– We are using a different text– We are using a different project– We will write programs using Common Lisp, not Java or C++• Yes.– Topics covered will be similar.– Sequence of topics will be similar.– Slides (like this) will be similar. (They’ve evolved over years)– Target languages COOL and MiniJava are not THAT different.Prof Fateman CS 164 Lecture 1 4Should you wait ‘til next semester? Or later?• It’s your call. Professors Bodik and Necula will use the “COOL” language. We will use a simpler language (MiniJava).• Professor Hilfinger has had students implementing much more elaborate languages..• We will build upon what you learned in CS61A, so if you thought Scheme was neat and want to understand that stuff better, stay here.Prof Fateman CS 164 Lecture 1 5Why Should You Study Compilers/ Programming Languages?• NOTATION MAKES THOUGHT POSSIBLEProf Fateman CS 164 Lecture 1 65000 years ago: Babylonian clay tablet (base 60 numbers)Prof Fateman CS 164 Lecture 1 7500 years ago• the modern + sign appeared at the end of the 1400s. • This illustration from 1579 is something that looks almost modern, particularly when you see it is written in English, until you realize that those funny squiggles aren't x's--they're special non-letter characters that represent different powers of the variable x.more info..• wolfram: MathML conferenceProf Fateman CS 164 Lecture 1 8330 years ago (1675: Integral Calculus)Prof Fateman CS 164 Lecture 1 9100 years agoRussell/WhiteheadPrincipia Mathematica1910Prof Fateman CS 164 Lecture 1 10Iverson’s APL (1960)Prof Fateman CS 164 Lecture 1 11OK, Notation helps thinking. Why ELSEShould We Study Programming Languages?• Improved background for choosing appropriate tools / languages• Increased ability to learn “new” languages or design new ones• Better understanding of the interchange between implementation and design• Appreciation of the beauty of relevant material from CS 61a/b/c CS170, Math 55Prof Fateman CS 164 Lecture 1 12Course Structure• Course has theoretical and practical aspects• Need both in programming languages!• Occasional written assignments = theory– Class hand-in• Programming assignments = practice– Electronic hand-inProf Fateman CS 164 Lecture 1 13Academic Honesty• Re-using programs is an important engineering technique. •BUT Please don’t use work from uncitedsources• (The Easy and Correct Solution: cite ALL sources, including friends, TAs, staff, old projects, partners.)• Please be sure that you understand what you hand in.• (it is NOT OK to say “my partner did that and I don’t know how it works”)• If you have questions about academic honesty, (yours or others) ask some faculty member.Prof Fateman CS 164 Lecture 1 14Objectives of the Course• This course is intended to be a learning experience, not an exercise in debugging.• The homeworks and programs are primarily for you to learn about programming languages and compilers.• Programming is not an endurance test. Delaying your project until the last minute and then staying up all night to complete it is not a good way to learn.• Unfortunately, assessment is part of the deal. We will grade you on your exams (especially), but also on your homeworks, to keep you motivated. (Details on handout).Prof Fateman CS 164 Lecture 1 15The Course Project• A “big” project. Written in Common Lisp.• … in several easy parts•Why Lisp?– Typical JAVA/C++ project code size: 5,000 lines– Typical Lisp code size: 2,000 lines.– You are given 1000 lines in “skeletons” either way, so the ratio is about 4:1 in favor of Lisp– You all know Scheme, or at least you used to know it; CL is like Scheme on steroids.Prof Fateman CS 164 Lecture 1 16You have been writing programs for years– what more is there to learn?• How do Basic, Pascal, C, C++, Assembler, Java, Scheme differ? And WHY?• What are the essential common threads in design(Variables? Arithmetic? Subroutines?)• What are the essential common threads in implementation? Do you remember anything from CS61a language implementation? (Some of you did a project to partially implement Logo).Prof Fateman CS 164 Lecture 1 17Overview: How are Languages Implemented?• Two major strategies:– Interpreters (simple, general, faster setup)– Compilers (complex, popular, slower setup, faster at runtime)• Interpreters run programs with only modest “digestion”; often easily portable to many hosts.• Compilers do extensive digestion, some of it specific to particular machine architectures. Often not portable.• We will study both strategies, as well as mixtures (e.g. Java VM, Lisp)Prof


View Full Document

Berkeley COMPSCI 164 - Introduction to Programming Languages and Compilers

Documents in this Course
Lecture 8

Lecture 8

40 pages

Load more
Download Introduction to Programming Languages and Compilers
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Introduction to Programming Languages and Compilers and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Introduction to Programming Languages and Compilers 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?