DOC PREVIEW
CMU CS 15312 - Lecture

This preview shows page 1-2-16-17-18-33-34 out of 34 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 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 34 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 34 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 34 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 34 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 34 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 34 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Teaching StaffOutlineFactors in Programmer ProductivityLanguage Is CriticalTwo QuotesToo Many Languages?Language Evaluation CriteriaFrom the Perl ManualFrom the TeX manualSome Obfuscated TeX CodeSome Obfuscated C CodeScience of Programming LanguagesBasic ToolsOutlineApproach I: VivisectionApproach II: AutopsyApproach III: GenesisApproach IV: TaxonomyApproach V: Study Basic ConceptsOur Approach and GoalsOutlineCore TopicsLanguage Features (Tentative)Course ReadingOutlineWritten AssignmentsProgramming AssignmentsAssignment PoliciesExaminationsOutlineRecitationOutlineSummary15-312 Foundations of Programming LanguagesLecture 1: OverviewFrank Pfenninghttp://www.cs.cmu.edu/˜fp/courses/312/Carnegie Mellon UniversityAugust 31, 200415-312 Lecture 1: Overview – p.1Teaching Staff•Frank Pfenning <[email protected]>•Office Hour: Tue 3:00-4:00, WeH 8117•Matt Moore <[email protected]>•Office Hour: Wed 2:30-3:30, 7th floor whiteboards•Jason Reed <[email protected]>•Office Hour: WeH 3721, Thu 5-6pm•Course web pagehttp://www.cs.cmu.edu/˜fp/courses/312/•Blackboard area only for grade sheet15-312 Lecture 1: Overview – p.2Outline•The Science of Programming Languages•Our Approach•Topic Overview•Assignments and Exams•Recitation•Summary15-312 Lecture 1: Overview – p.3Factors in Programmer Productivity•Programmer productivity•Initial development time•Program correctness and robustness•Software maintainability•Crucial factors•Programming language(s)•Development environment•Software engineering practices15-312 Lecture 1: Overview – p.4Language Is Critical•How do we implement data structures?•How do we design and structure the code?•How do we express assumptions and guarantees?•How do we read and analyze a program?15-312 Lecture 1: Overview – p.5Two QuotesAn ideal language allows us to express easily what isuseful for the programming task and at the same timemakes it difficult to write what leads to incomprehensibleor incorrect programs.—Nico HabermannGood languages make it easier to establish, verify, andmaintain the relationship between code and itsproperties. —Robert Harper15-312 Lecture 1: Overview – p.6Too Many Languages?•In the last three years I have written code in atleast the following languages:Standard ML Emacs Lisp TwelfTeX Csh CPHP Java MySql•Different languages for different purposes•Many are poorly designed•The authors did not take 15-312!•Your favorite mis-feature?15-312 Lecture 1: Overview – p.7Language Evaluation Criteria•Some objective criteria•Is the grammar LALR(1)?•Is the language type-safe?•Is the language dynamically or statically typed?•Is the language Turing-complete?•Is the language call-by-value or call-by-name?•Is the language completely specified?•Does the language require a heap?•Does the language require dynamic dispatch?•A subjective statement: “(I ((like Lisp)) (syntax))”15-312 Lecture 1: Overview – p.8From the Perl ManualWhen presented with something that might have severaldifferent interpretations, Perl uses the DWIM (that’s ”DoWhat I Mean”) principle to pick the most probableinterpretation. This strategy is so successful that Perlprogrammers often do not suspect the ambivalence ofwhat they write. But from time to time, Perl’s notionsdiffer substantially from what the author honestly meant.15-312 Lecture 1: Overview – p.9From the TEX manualPlease don’t read this material until you’ve had plenty ofexperience with plain TEX. After you have read andunderstood the secrets below, you’ll know all sort ofdevious combinations of TEX commands, and you willoften be tempted to write inscrutable macros.—Donald E. Knuth15-312 Lecture 1: Overview – p.10Some Obfuscated TEX Code\let˜\catcode˜‘76˜‘A13˜‘F1˜‘j00˜‘P2jdefA71F˜‘7113jdefPALLFPA’’FwPA;;FPAZZFLaLPA//71F71iPAHHFLPAzzFenPASSFthP;A$$FevPA@@FfPARR717273F737271P;ADDFRgniPAWW71FPATTFvePA**FstRsamPAGGFRruoPAqq71.72.F717271PAYY7172F727171PA??Fi*LmPA&&71jfiFjfi71PAVVFjbigskipRPWGAUU71727374 75,76Fjpar71727375Djifx:76jelse&U76jfiPLAKK7172F71l7271PAXX71FVLnOSeL71SLRyadR@oLRrhC?yLRurtKFeLPFovPgaTLtReRomL;PABB71 72,73:Fjif.73.jelseB73:jfiXF71PU71 72,73:PWs;AMM71F71diPAJJFRdriPAQQFRsreLPAII71Fo71dPA!!FRgiePBt’el@ lTLqdrYmu.Q.,Ke;vz vzLqpip.Q.,tz;;Lql.IrsZ.eap,qn.i. i.eLlMaesLdRcna,;!;h htLqm.MRasZ.ilk,%s$;z zLqs’.ansZ.Ymi,/sx ;LYegseZRyal,@i;@ TLRlogdLrDsW,@;GLcYlaDLbJsW,SWXJW ree @rzchLhzsW,;WERcesInW qt.’oL.Rtrul;edoTsW,Wk;Rri@stW aHAHHFndZPpqar.tridgeLinZpe.LtYer.W,:jbye15-312 Lecture 1: Overview – p.11Some Obfuscated C Code•Prior TEX code in obf-tex.tex•See obf-tex.pdf for result ofpdftex obf-tex.tex•Also see separate source obf-c.c•See output obf-c.txt15-312 Lecture 1: Overview – p.12Science of Programming Languages•There is an established science of programminglanguages. Among its first papers:“Some Properties of Conversion”, AlonzoChurch and J.B. Rosser, Transactions of theAmerican Mathematical Society, Vol. 39(3),pp. 472–482, May 1936.15-312 Lecture 1: Overview – p.13Basic Tools•Type theory: Techniques for structuringlanguages to ensure safety and modularity ofprograms•Operational semantics: Techniques fordescribing the execution behavior of programs, atvarious level of abstraction•Mathematical logic: Techniques for specifyingand verifying programs15-312 Lecture 1: Overview – p.14Outline•The Science of Programming Languages•Our Approach•Topic Overview•Assignments and Exams•Recitation•Summary15-312 Lecture 1: Overview – p.15Approach I: Vivisection•Take one or several living languages, preferablywidely used•Analyze it or them in minute detail•Syntax: Grammar and parsing•Semantics: Type-checking and operationalsemantics•Pragmatics: Programming methodology andimplementation strategies•Can be interesting and instructive•Not our approach15-312 Lecture 1: Overview – p.16Approach II: Autopsy•Take one or several dead languages, preferablyused•Analyze it or them in minute detail•Syntax: Grammar and parsing•Semantics: Type-checking and operationalsemantics•Pragmatics: Programming methodology andimplementation strategies•Can be interesting and instructive•Not our approach15-312 Lecture 1: Overview – p.17Approach III: Genesis•Take a problem domain, preferably useful•Design the ultimate language•Syntax: Grammar and parsing•Semantics: Type-checking and operationalsemantics•Pragmatics: Programming methodology


View Full Document

CMU CS 15312 - Lecture

Download Lecture
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 Lecture 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 Lecture 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?