Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 78 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
78
Dung lượng
490,5 KB
Nội dung
1 Languages and Compilers (SProg og Oversættere) Lecture 1 Bent Thomsen Department of Computer Science Aalborg University 2 Lecturer • Bent Thomsen – (Database and Programming Technology Research Group) • Research interests: – Programming Language design and implementation – Programming » Mobile systems » Embedded Systems » Distributed system – Formal foundations » Concurrency theory » Type systems » Semantics 3 Assistant • Kostas Tzoumas – 4 What is the Most Important Open Problem in Computing? Increasing Programmer Productivity – Write programs quickly – Write programs easily – Write programs correctly • Why? – Decreases development cost – Decreases time to market – Decreases support cost – Increases satisfaction 5 How to increase Programmer Productivity? 3 ways of increasing programmer productivity: 1. Process (software engineering) – Controlling programmers – Good process can yield up to 20% increase 2. Tools (verification, static analysis, program generation) – Good tools can yield up to 10% increase 3. Better designed Languages the center of the universe! – Core abstractions, mechanisms, services, guarantees – Affect how programmers approach a task (C vs. SML) – New languages can yield 700% increase 6 Well … "Some believe that we lacked the programming language to describe your perfect world" Agent Smith - The Matrix 7 What is this course about? • Programming Language Design – – – • Compiler Construction – – – 8 Curricula (Studie ordning) 9 What should you expect to get out of this course Ideas, principles and techniques to help you – – – ! 10 Something for everybody • Design – " – – • User experience and feedback • Lots of programming at different levels • Clever algorithms • Formal specification and proofs • History – [...]... grammar, rules of semantics – Syntax and Semantics 18 Why Are There So Many Programming Languages • Why do some people speak French? • Programming languages have evolved over time as better ways have been developed to design them – First programming languages were developed in the 1950s – Since then thousands of languages have been developed • Different programming languages are designed for different... on C#, said the newest version of the language, C# 3.0, was the first chance to step back and look at the evolution of the language "The taxonomies of programming languages are starting to break down," Hejlsberg said, point to dynamic languages, programming languages, and functional languages He said "future languages are going to be an amalgam of all of the above 26 What determines a “good” language... corridors, in the coffee room, by email, … • Don’t tell me through the semester group minutes 16 Programming Languages and Compilers are at the core of Computing All software is written in a programming language Learning about compilers will teach you a lot about the programming languages you already know Compilers are big – therefore you need to apply all you knowledge of software engineering The compiler... Individual exercises • Train specific techniques and methods – Group exercises • Help you discuss concepts, ideas, problems and solutions • Home reading Litterature 11 Literature • Concepts of Programming Languages (Seventh Edition), Robert W Sebesta, Prentice Hall, ISBN 0 321 312511 • Programming Language Processors in Java – Compilers and Interpreters, David A Watt and Deryck F Brown, Prentice Hall, ISBN... Train techniques and tools (sub-groups or individually) • Project – Put it all together 13 What is expected of you at the end? • One goal for this course is for you to be able to explain concepts, techniques, tools and theories to others – Your future colleagues, customers and boss – (especially me and the examiner at the exam ;-) • That implies you have to – Understand the concepts and theories – Know... features should look similar and behave similar • Maintainability – errors can be found and corrected and new features added easily • Generality – avoid special cases in the availability or use of constructs and by combining closely related constructs into a single more general one • Extensibility – provide some general mechanism for the user to add new constructs to a language • Standardability – allow programs... Implementability – ensure a translator or interpreter can be written 29 Different Programming Language Design Philosophies C Other languages If all you have is a hammer, then everything looks like a nail 30 Programming languages are languages • But Computer languages lack ambiguity and vagueness • In English sentences can be ambiguous – I saw the man with a telescope • Who had the telescope? – Take a pinch... to use the tools and techniques – Be able to put it all together • I.e You have to know and know that you know 14 What you need to know beyond this course • • • • • Know about programming Know about machine architectures Know about operating systems Know about formal syntax and semantics So pay attention in those courses! 15 Before we get started • • • • Tell me if you don’t understand Tell me if I... important – – – – Ease of designing, coding Debugging Maintenance Reusability • FADS 27 Criteria in a good language design • Readability – understand and comprehend a computation easily and accurately • Write-ability – express a computation clearly, correctly, concisely, and quickly • Reliability – assures a program will not behave in unexpected or disastrous ways • Orthogonality – A relatively small set of... Programming Languages • First Generation Languages Machine 0000 0001 0110 1110 0100 0000 0001 0010 • Second Generation Languages Assembly LOAD x ADD R1 R2 • Third Generation Languages High-level imperative/object oriented public Token scan ( ) { while (currentchar == ‘ ’ || currentchar == ‘\n’) {….} } Fortran, Pascal, Ada, C, C++, Java, C# • Fourth Generation Languages Database select fname, lname SQL . minutes 17 Programming Languages and Compilers are at the core of Computing All software is written in a programming language Learning about compilers will teach you a lot about the programming languages. 1 Languages and Compilers (SProg og Oversættere) Lecture 1 Bent Thomsen Department of Computer Science Aalborg University 2 Lecturer • Bent Thomsen – (Database and Programming. Prentice Hall, ISBN 0 321 312511 • Programming Language Processors in Java – Compilers and Interpreters, David A Watt and Deryck F Brown, Prentice Hall, ISBN 0-13- 025786-9 • Some web references 13 Format