Đang chuẩn bị liên kết để tải về tài liệu:
Lecture Programming languages (2/e): Chapter 1 - Tucker, Noonan
Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG
Tải xuống
Chapter 1 - Overview. The main contents of this chapter include all of the following: Principles, paradigms, special topics, a brief history, on language design (design constraints, outcomes and goals), compilers and virtual machines. | Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is a conceptual universe for thinking about programming. A. Perlis Contents 1.1 Principles 1.2 Paradigms 1.3 Special Topics 1.4 A Brief History 1.5 On Language Design 1.5.1 Design Constraints 1.5.2 Outcomes and Goals 1.6 Compilers and Virtual Machines Programming languages have four properties: Syntax Names Types Semantics For any language: Its designers must define these properties Its programmers must master these properties 1.1 Principles Syntax The syntax of a programming language is a precise description of all its grammatically correct programs. When studying syntax, we ask questions like: What is the grammar for the language? What is the basic vocabulary? How are syntax errors detected? Names Various kinds of entities in a program have names: variables, types, functions, parameters, classes, objects, Named entities are bound in a running program to: Scope Visibility Type Lifetime Types A type is a collection of values and a collection of operations on those values. Simple types numbers, characters, booleans, Structured types Strings, lists, trees, hash tables, A language’s type system can help to: Determine legal operations Detect type errors Semantics The meaning of a program is called its semantics. In studying semantics, we ask questions like: When a program is running, what happens to the values of the variables? What does each statement mean? What underlying model governs run-time behavior, such as function call? How are objects allocated to memory at run-time? A programming paradigm is a pattern of problem-solving thought that underlies a particular genre of programs and languages. There are four main programming paradigms: Imperative Object-oriented Functional Logic (declarative) 1.2 Paradigms Imperative Paradigm Follows the classic von Neumann-Eckert model: Program and data are indistinguishable in memory Program = a sequence of commands State = . | Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is a conceptual universe for thinking about programming. A. Perlis Contents 1.1 Principles 1.2 Paradigms 1.3 Special Topics 1.4 A Brief History 1.5 On Language Design 1.5.1 Design Constraints 1.5.2 Outcomes and Goals 1.6 Compilers and Virtual Machines Programming languages have four properties: Syntax Names Types Semantics For any language: Its designers must define these properties Its programmers must master these properties 1.1 Principles Syntax The syntax of a programming language is a precise description of all its grammatically correct programs. When studying syntax, we ask questions like: What is the grammar for the language? What is the basic vocabulary? How are syntax errors detected? Names Various kinds of entities in a program have names: variables, types, functions, parameters, classes, objects, Named entities are bound in a running program to: Scope Visibility Type .