Programming Languages - Shriram Krishnamurthi

Programming Languages

Shriram Krishnamurthi

出版社

出版时间

2007-01-01

ISBN

9780272692233

评分

★★★★★
AI导读
核心看点
  • C语言之父亲笔撰写,定义K&R C标准
  • 正文仅160余页,极致简洁,无一句废话
  • 深入解析指针、内存管理及标准库实现
适合谁读
  • 具备基础编程知识,欲深入理解C语言者
  • 计算机专业学生及从事系统级开发的工程师
  • 追求代码简洁优雅,希望提升编程内功者
读前提醒
  • 非零基础入门书,建议先读国内教材打底
  • 务必动手完成书中习题,最好在Linux下实践
  • 结合Unix环境阅读,方能体会其设计精髓
读者共识
  • 计算机领域常青树,被誉为编程界的圣经
  • 文字精炼如诗,被读者戏称为‘高级鸡汤’
  • 虽薄却重,是检验程序员功力的试金石

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • ""相对于#define语句来说,它的优势在于常量值可以自动生成。尽管可以声明enum类型的变量,但编译器不检查这种类型的变量中存储的值是否为该枚举的有效值。不过,枚举变量提供这种检查,因此枚举比#define更具优势。此外,调试程序可以以符号形式打印出枚举变量的值";"
  • "If a name that has not been previously declared occurs in an expression and is followed by a left parenthesis, it is declared by context to be a function name, the function is assumed to return an int, and nothing is assumed about its arguments. Furthermore, if a function declaration does not includ"
  • "float类型通常是32位,它至少有6位有效数字,取值范围一般在10^-38 ~ 10 ^ 38之间"
  • "BCPL and B are "typeless" languages. By contrast, C provides a variety of data types. The fundamental types are characters, and integers and floating-point numbers of several sizes. In addition, there is a hierarchy of derived data types created with pointers, arrays, structures, and unions. Express"
  • "Right shifting a signed quantity will fill sign bits ("arithmetic shift") or on some machines ans with 0-bits ("logical shift") on others"
  • "Declaring the argument x to be unsigned ensures that when it is right-shifted, vacated bits will be filled with zeros, not sign bits, regardless of the machine the program run on."
  • "char *fgets(char *line, int maxline, FILE *fp) fgets reads the next input line (including the newline) from file fp into the character array line; at most maxline-1 characters will be read. The resulting line is terminated with '\0'. Normally fgets returns line; on end of file or error it returns NU"
  • "void *realloc(void *p, size_t size) realloc changes the size of the object pointed to by p to size. The contents will be unchanged up to the minimum of the old and new sizes. If the new size is larger, the new space is uninitialized. realloc returns a pointer to the new space, or NULL if the request"
作者简介
Brian W. Kernighan works in the Computing Science Research Center at Bell Laboratories, Lucent Technologies. He is Consulting Editor for Addison-Wesley's Professional Computing Series and the author, with Dennis Ritchie, of The C Programming Language. Dennis Ritchie is a computer scientist notable for his influence on ALTRAN, B, BCPL, C, Multics, and Unix.
用户评论
本书使用racket的变种plai-typed,类型系统做了修改以近似于sml,熟悉racket或者scheme的读者要稍稍适应。plai是本书名字的缩写。作者要求的是以动手为主,理论方面方面扼要介绍后即开始实践。以循序渐进的方式从计算器开始,不断添加各种语言特性。作者还在不断更新本书,基于另一个版本。有2012年的课程视频。我人为本书适于三类读者:有一定编程经验、思考过语言特性的;熟悉编程语言理论、寻找提纲挈领提示的;正在上编程语言课程,能从老师或其他资源得到支持的读者。因为本书比较简略,内容涵盖广而不深入,虽然有大量程序说明,但一些部分需要读者自己实现,而且网络资源支持不像某些著名教材那么丰富,如果缺少支持或者自身储备不足,或许理解内容会有困难。
这本书超赞!
一个Interpreter应有的
姑且算浏览一遍
虽然是简单的解释器的构造,但是循序渐进真是太有意思了,而且探讨的一些问题也很有意思,动动脑筋挺不错~
勉强读过一遍,书的内容略有跳跃,需要自己自己琢磨。有一些练习题会在后续内容引用到。 20210317: 花了一个多月看了第一版,看到类型之前这本书讲的都不错。不过讲语义类型的时候,引入了一些符号,有点突兀。类型只是解说了下,没有具体实现,第二版倒是有一些实现。总的来说,两个版本需要一起看。
未来四个月将和它为伍。:up-side-down-smile: ----------------------------------------- 读完四章更新,这书是我读了这么多 textbook 以来见过写得最差的一本。上学期读的算法书和统计学的书真的相比下来,不知道高到哪里去了。 选词不够简洁直白(喜欢用一些花哨的词和类比,反而让读者理解困难)逻辑很不清晰,读得人非常头昏脑涨。在我看来,这书作为教科书,对知识传递的效率可以说是相当低。 -----------------------------------------读完更新:可能是我的版本不对,没有配图标记,但依旧不觉得这是一本好书,作者的逻辑顺序真的很难 follow。最后成绩还可以,而且也算是学到点东西,最多三星吧。
在讲述how to do it的同时,也why do it的理由,并同时讨论了一些language design space方面的问题
收藏