具体描述
内容简介
本书对用于开发现代程序设计语言的主要模式作了概述,着重
讨论对现代程序设计极端重要的语言。作者在前两版基础上进行了
全面修订以反映程序设计语言设计的新进展,本书通过使用
和smalltalk介绍过程型语言和面向对象型语言,通过LISP,Prol0g和
ML讨论各种程序设计模式,FORTRAN90和Ad0-95用了新标准,LISP
和Pasca的内容作了更新。书内对每种重要的程序设计语言都作了
充分介绍,使读者不需要再购买单种语言的参考资料就可以解决所
关心的问题,每章后的阅读建议使读者有可能扩大对重要问题的了
解。
作者简介
目录信息
1 The Study of Programming Languages
1.1 Why Study Programming Languages?
1.2 A Short History of Programming Languages
1.2.1 Development of Early Languages
1.2.2 Role of Programming Languages
1.3 What Makes a Good Language?
1.3.1 Attributes of a Good Language
1.3.2 Application Domains
1.3.3 T anguage Standardization
1.4 Effects of Environments on Languages
1.4.1 Batch-Processing Environments
1.4.2 Interactive Environments
1.4.3 Embedded System Environments
1.4.4 Programming Environments
1.4.5 Environment Frameworks
1.5 Suggestions for Further Reading
1.6 Problems
2 Language Design Issues
2.1 The Structure and Operation of a Computer
2.1.1 The Hardware of the Computer
2.1.2 Firmware Computers
2.1.3 Translators and Software-Simulated Computers
2.2 Virtual Computers and Binding Times
2.2.1 Syntax and Semantics
2.2.2 Virtual Computers and Language Implementations
2.2.3 Hierarchies of Computers
2.2.4 Binding and Binding Time
2.3 Language Paradigms
2.4 Suggestions for Further Reading
2.5 Problems
3 Language Translation Issues
3.1 Programming Language Syntax
3.1.1 General Syntactic Criteria
3.1.2 Syntactic Elements of a Language
3.1.3 Overall Program-Subprogram Structure
3.2 Stages in Translation
3.2.1 Analysis of the Source Program
3.2.2 Synthesis of the Object Program
3.3 Formal Translation Models
3.3.1 BNF Grammars
3.3.2 Finite-State Automata
3.3.3 Pushdown Automata
3.3.4 Efficient Parsing Algorithms
3.3.5 Semantic Modeling
3.4 Suggestions for Further Reading
3.5 Problems
4 Data Types
4.1 Properties of Types and Objects
4.1.1 Data Objects, Variables, and Constants
4.1.2 Data Types
4.1.3 Specification of Elementary Data Types
4.1.4 Implementation of Elementary Data Types
4.1.5 Declarations
4.1.6 Type Checking and Type Conversion
4.1.7 Assignment and Initialization
4.2 Elementary Data Types
4.2.1 Numeric Data Types
4.2.2 Enumerations
4.2.3 Booleans
4.2.4 Characters
4.2.5 Internationalization
4.3 Structured Data Types
4.3.1 Structured Data Objects and Data Types
4.3.2 Specification of Data Structure Types
4.3.3 Implementation of Data Structure Types
4.3.4 Declarations and Type Checking for Data Structures
4.3.5 Vectors and Arrays
4.3.6 Records
4.3.7 Lists
4.3.8 Character Strings
4.3.9 Pointers and Programmer-Constructed Data Objects
4.3.10 Sets
4.3.11 Executable Data Objects
4.3.12 Files and Input-Output
4.4 Suggestions for Further Reading
4.5 Problems
5 Abstraction 1: Encapsulation
5.1 Abstract Data Types
5.1.1 Evolution of the Data Type Concept
5.1.2 Information Hiding
5.2 Encapsulation by Subprograms
5.2.1 Subprograms as Abstract Operations
5.2.2 Subprogram Definition and Invocation
5.2.3 Subprogram Definitions as Data Objects
5.3 Type Definitions
5.3.1 Type Equivalence
5.3.2 Type Definitions with Parameters
5.4 Storage Management
5.4.1 Major Run-Time Elements Requiring Storage
5.4.2 Programmer- and System-Controlled Storage Management
5.4.3 Static Storage Management
5.4.4 Stack-Based Storage Management
5.4.5 Heap Storage Management: Fixed-Size Elements
5.4.6 Heap Storage Management: Variable-Size Elements
5.5 Suggestions for Purther Reading
5.6 Problems
6 Sequence Control
6.1 Implicit and Explicit Sequence Control
6.2 Sequencing with Arithmetic Expressions
6.2.1 Tree-Structure Representation
6.2.2 Execution-Time Representation
6.3 Sequencing with Nonarithmetic Expressions
6.3.1 Pattern Matching
6.3.2 Unification
6.3.3 Backtracking
6.4 Sequence Control Between Statements
6.4.1 Basic Statements
6.4.2 Structured Sequence Control
6.4.3 Prime Programs
6.5 Suggestions for Further Reading
6.6 Problems
7 Subprogram Control
7.1 Subprogram Sequence Control
7.1.1 Simple Call-Return Subprograms
7.1.2 Recursive Subprograms
7.2 Attributes of Data Control
7.2.1 Names and Referencing Environments
7.2.2 Static and Dynamic Scope
7.2.3 Block Structure
7.2.4 Local Data and Local Referencing Environments
7.3 Shared Data in Subprograms
7.3.1 Parameters and Parameter Transmission
7.3.2 Explicit Common Environments
7.3.3 Dynamic Scope
7.3.4 Static Scope and Block Structure
7.4 Suggestions for Further Reading
7.5 Problems
8 Abstraction 11: Inheritance
8.1 Abstract Data Types Revisited
8.2 Inheritance
8.2.1 Derived Classes
8.2.2 Methods
8.2.3 Abstract Classes
8.2.4 Objects and Messages
8.2.5 Abstraction Concepts
8.3 Polymorphism
8.4 Suggestions for Further Reading
8.5 Problems
9 Advances in Language Design
9.1 Variations on Subprogram Control
9.1.1 Exceptions and Exception Handlers
9.1.2 Coroutines
9.1.3 Scheduled Subprograms
9.1.4 Nonsequential Execution
9.2 Parallel Programming
9.2.1 Concurrent Execution
9.2.2 Guarded Commands
9.2.3 Tasks
9.2.4 Synchronization of Tasks
9.3 Formal Properties of Languages
9.3.1 Chomsky Hierarchy
9.3.2 Undecidability
9.3.3 Algorithm Complexity
9.4 Language Semantics
9.4.1 Denotational Semantics
9.4.2 Program Verification
9.4.3 Algebraic Data Types
9.4.4 Resolution
9.5 Hardware Developments
9.5.1 Processor Design
9.5.2 System Design
9.6 Software Architecture
9.6.1 Persistent Data and Transaction Systems
9.6.2 Networks and Client/Server Computing
9.6.3 Desktop Publishing
9.6.4 Programming Language Trends
9.7 Suggestions for Further Reading
9.8 Problems
Part 11. Paradigms and Languages
10 Simple Procedural Languages
10.1 FORTRAN
10.1.1 History
10.1.2 Hello World
10.1.3 Brief Overview of the Language
10.1.4 Data Objects
10.1.5 Sequence Control
10.1.6 Subprograms and Storage Management
10.1.7 Abstraction and Encapsulation
10.1.8 Language Evaluation
10.2 C
10.2.1 History
10.2.2 Hello World
10.2.3 Brief Overview of the Language
10.2.4 Data Objects
10.2.5 Sequence Control
10.2.6 Subprograms and Storage Management
10.2.7 Abstraction and Encapsulation
10.2.8 Language Evaluation
10.3 Suggestions for Further Reading
10.4 Problems
11 Block-Structured Procedural Languages
11.1 Pascal
11.1.1 History
11.1.2 Hello World
11.1.3 Brief Overview of the Language
11.1.4 Data Objects
11.1.5 Sequence Control
11.1.6 Subprograms and Storage Management
11.1.7 Abstraction and Encapsulation
11.1.8 Language Evaluation
11.2 Suggestions for Further Reading
11.3 Problems
12 Object-Based Languages
12.1 Ada
12:1.1 History
12.1.2 Hello World
12.1.3 Brief Overview of the Language
12.1.4 Data Objects
12.1.5 Sequence Control
12.1.6 Subprograms and Storage Management
12.1.7 Abstraction and Encapsulation
12.1.8 Language Evaluation
12.2 C++
12.2.1 History
12.2.2 Hello World
12.2.3 Brief Overview of the Language
12.2.4 Data Objects
12.2.5 Sequence Control
12.2.6 Subprograms and Storage Management
12.2.7 Abstraction and Encapsulation
12.2.8 Language Evaluation
12.3 Smalltalk
12.3,1 History
12.3.2 HelloWorld
12.3.3 Brief Overview of the Language
12.3.4 Data Objects
12.3.5 Sequence Control
12.3.6 Subprograms and Storage Management
12.3.7 Abstraction and Encapsulation
12.3.8 Language Evaluation
12.4 Suggestions for Further Reading
12.5 Problems
13 Functional Languages
13.1 LISP
13.1.1 History
13.1.2 HelloWorld
13.1.3 Brief Overview of the Language
13.1.4 Data Objects
13.1.5 Sequence Control
13.1.6 Subprograms and Storage Management
13.1.7 Abstraction and Encapsulation
13.1.8 Language Evaluation
13.2 ML
13.2.1 History
13.2.2 HelloWorld
13.2.3 Brief Overview of the Language
13.2.4 Data Objects
13.2.5 Sequence Control
13.2.6 Subprograms and Storage Management
13.2.7 Abstraction and Encapsulation
13.2.8 Language Evaluation
13.3 Suggestions for Further Reading
13.4 Problems
14 Logic Programming Languages
14.1 Prolog
14.1.1 History
14.1.2 HelloWorld
14.1.3 Brief Overview of the Language
14.1.4 Data Objects
14.1.5 Sequence Control
14.1.6 Subprograms and Storage Management
14.1.7 Abstraction and Encapsulation
14.1.8 Language Evaluation
14.2 Suggestions for Purther Reading
14.3 Problems
References
Index
· · · · · · (收起)
读后感
用户评价
从个人成长的角度来看,这本书带来的影响是潜移默化的,它改变了我编写代码的底层思维习惯。过去,我可能更关注于快速实现功能,而现在,我会不自觉地去思考我使用的语言的“动机”是什么,以及我的代码结构是否符合该语言的设计哲学。这种内省能力的提升,使得我对代码的结构、模块的划分以及抽象层次的把握更加精准和审慎。它不像那些速成手册,承诺你几天内就能掌握某个框架,而是提供了一套长期的、构建底层认知能力的框架。阅读过程中,我经常需要停下来,合上书本,在白板上画出流程图,试图用我自己的语言重新组织那些复杂的转换过程。这种主动的知识重构是深度学习的标志,而这本书的结构和深度恰好鼓励并最大化了这种重构过程。毫不夸张地说,它为我的职业生涯中下一阶段的技术深度探索,打下了一个极其坚实、几乎无法撼动的地基。
这本书在对不同设计范式进行比较分析时的深度和广度,绝对是同类书籍中少有的。它不像某些教材那样,只是一味推崇某一种特定的设计哲学(比如纯函数式或纯面向对象),而是以一种非常公正、客观的立场,剖析了每种范式背后的权衡(Trade-offs)。作者在描述一种特性时,总会附带说明在特定场景下它带来的性能优势、维护成本增加,以及在理论上的优雅性损失。我尤其欣赏它对“为什么不这样做”的探讨,很多时候,理解为什么一个看似美好的设计在工程实践中被放弃,比仅仅知道如何实现它更有价值。这种批判性思维的培养,对于一个有志于设计自己语言组件的工程师来说至关重要。读完相关章节后,我感觉自己看待编程语言的视角不再是单一的视角,而是拥有了一个多维度的衡量工具,能够更成熟地去评估一个语言特性的利弊。它教会我的不是“如何造轮子”,而是“在什么环境下,什么样的轮子才是最优解”。
这本书的封面设计着实让人眼前一亮,那种沉稳中又不失现代感的配色,恰到好处地抓住了读者的目光。我拿到手的时候,首先感受到的是纸张的质感,厚实而又不失细腻,翻页的手感非常舒适,显然是在制作材料上没有妥协。更别提内页的排版了,字体大小和行间距的设定简直是教科书级别的典范,即便是面对厚厚的篇幅,长时间阅读也不会让人感到视觉疲劳,这一点对于需要长时间沉浸在复杂概念中的程序员来说,简直是福音。很多技术书籍在排版上往往顾此失彼,要么是密密麻麻如同代码的墙,要么是留白过多显得过于松散,但这一本却找到了一个完美的平衡点。尤其是那些关键性的图表和示意图,它们的清晰度和准确性,使得那些抽象的编译原理和语言结构得以直观地展现,让原本晦涩的知识点瞬间变得立体起来,这种对细节的打磨,让我对书中内容的专业性有了初步的信心。我常常觉得,一本好书,光是拿在手里的感觉,就已经完成了对读者尊重的第一步,而这本,无疑是做到了极致。它不仅仅是一本工具书,更像是一件精心打磨的艺术品,让人爱不释手,愿意时常把它摆在书架最显眼的位置,随时准备翻阅。
初次翻阅时,我被其内容组织方式的逻辑性深深吸引住了。作者似乎非常懂得读者的学习曲线,知识点的引入并非突兀地抛出深奥的理论,而是循序渐进,总是在铺垫了足够的背景知识和动机之后,才开始深入探讨核心机制。比如,在讨论某种新的类型系统设计时,它没有急于展示复杂的数学模型,而是先用几个贴近实际编程痛点的例子,让读者切身感受到现有方法的不足,从而自然而然地产生“为什么需要这个新东西”的求知欲。这种以“问题驱动”的学习路径,极大地增强了阅读的参与感和理解的深度,避免了那种“为了理论而理论”的枯燥感。我发现自己不是在被动地接收信息,而是在主动地与作者进行一场关于语言设计哲学的对话。这种行文风格的流畅性,使得即便是那些初学者可能会感到棘手的递归下降分析或者中间代码生成部分,也因为前后的衔接得当,变得更容易被消化和吸收。阅读体验就像是跟着一位经验丰富的大师,他不仅知道答案,更知道如何引导你一步步走到答案的门口,而不是直接把你扔到终点线上。
内容的技术深度毋庸置疑,但真正让我感到惊喜的是其中穿插的“历史视角”和“工程实践洞察”。书中关于某些经典语言特性演变的历史背景描述,简直是一部微型的计算机科学发展史。了解一个特性是如何在早期的硬件限制和理论探索中艰难诞生的,能让人对它产生一种近乎敬畏的理解,远非简单的语法规则学习所能比拟。更重要的是,作者似乎在每一章的结尾,都会留出一些关于“真实世界实现”的片段——可能是关于垃圾回收器在实际内存压力下的优化难题,或是某个解析器在面对海量遗留代码时的鲁棒性设计挑战。这些“幕后故事”将理论的纯净面与工程的泥泞面进行了精妙的结合,让读者意识到,编译器和解释器在真实运行环境下的复杂性远超实验室模型。这使得这本书不仅是理论的殿堂,更是一本实战的指南,它弥补了纯学术著作往往脱离实际工程落地的遗憾。