《Programming from the Ground Up》阅读笔记:p181-p216

《Programming from the Ground Up》学习第10天,p181-p216总结,总计34页。

一、技术总结

第10章主要讲计算机是如何计算的,如十进制、二进制、八进制、十六进制以及浮点数和负数的表示。属于比较基础的内容,如果有一定基础,本章可跳过。

1.exponent & mantissa

示例:p197, 12345.2 is stored as 1.23452 * 10^4. The mantissa is 1.23452 and the exponent is 4.

2.compiled and interpreted language

(1)compiled language

p231, Many languages are compiled languages. When you write assembly language,each instruction you write is translated into exactly one machine instruction for processing. With compilers, a statement can translate into one or hundreds of machine instructions.

很多语言属于编译型语言。当使用汇编语言(assembly language)编程时,每一条指令会被转换成一条机器执行进行处理。使用编译器(compiler),一条语句(statement)可以被转换成一条或者多条机器指令。

(2)interpreted language

p214, There are also languages that are interpreted languages. These languages require

that the user run a program called an interpreter that in turn runs the given program.

也有很多语言属于解释型语言。解释型语言要求用户运行称为解释器(interpreter)的的程序来执行指定的程序。

(3)hybrid language(compiled and interpreted language)

There is also a class of hybrid languages which partially compile a program before execution into byte-codes.

还有一类混合语言,程序在执行前会被部分编译(partially compile,这里暂时想不出什么好的翻译,将就理解吧)成字节码。

总结:什么样的语言称为编译型语言(compiled language),什么的语言称为解释型语(interpreted language)?其实作者并没有给出很明确的定义,引用维基百科里面的一段话来概括吧:The term is vague since, in principle, any language can be compiled or interpreted and in practice some languages are both (in different environments).In some environments, source code is first compiled (to an intermediate form; often bytecode) and then interpreted(这个术语是模糊的,因为原则上,任何语言都可以被编译或解释,在实践中,有些语言两者都可以(在不同的环境中)。在某些环境中,源代码首先被编译成一种中间形式(通常是字节码),然后再进行解释。

为了改善编译语言的效率而发展出的即时编译技术,已经缩小了这两种语言间的差距。这种技术混合了编译语言与解释型语言的优点,它像编译语言一样,先把程序源代码编译成字节码。到执行期时,再将字节码直译,之后执行。Java就是这种技术的代表产物。

以前自己对这两个概念很纠结,到底怎么区分?看完维基百科的这段话后觉得很有道理,个人理解就是看语言的行为,一门语言既可以是解释性语言,也可以是编译型语言,也可以是两者的结合(如:JAVA)。

二、英语总结

1.hallway vs hall

p187, We have a switch for outside lights, a switch for the hallway lights, a switch for the living room lights, and a switch for the bedroom lights.

hallway和hall的意思差不多,都是指"a passage in a house(走廊)", 它们之间的一个微小差别是:hallway implies "narrow passage", hall implies "large space or room"。

2.flinch at

flinch: make a sudden small movement of pain or fear(这是物理意义上的),也可以用于比喻意义(退缩)。

示例:p213, Languages are simply tools, and learning to use a new tool should not be something a programmer flinches at.

3.negligible

p214, However, in well-made interpreters, this time can be fairly negligible.

(1)negligible: negligence + -ible。

(2)negligence: neglect。

(3) neglect: *ne-("not") + *leg-("to collect, gather").vt. to not give enough care or attention to sth(忽视)。

三、其它

今日没有什么想说的。

四、参考资料

1. 编程

(1)Jonathan Bartlett,《Programming From The Ground Up》:book.douban.com/subject/178...

2. 英语

(1)Etymology Dictionary:www.etymonline.com

(2) Cambridge Dictionary:dictionary.cambridge.org

欢迎搜索及关注:编程人(a_codists)

相关推荐
野生技术架构师7 分钟前
互联网大厂必备 Java 面试八股文真题解析
java·开发语言·面试
Kiyra1 小时前
如何在面试中优雅地把自己“卖”个好价钱?
面试·职场和发展
Lee川2 小时前
🚀 JavaScript 内存大揭秘:从“栈堆搬家”到“闭包时空胶囊”
前端·javascript·面试
摸鱼仙人~2 小时前
前端面试最常考、最容易被问崩的 50 道八股精简版
前端·面试·职场和发展
马士兵教育3 小时前
2026年IT行业基本预测!计算机专业学生就业编程语言Java/C/C++/Python该如何选择?
java·开发语言·c++·人工智能·python·面试·职场和发展
野犬寒鸦3 小时前
面试常问:HTTP 1.0 VS HTTP 2.0 VS HTTP 3.0 的核心区别及底层实现逻辑
服务器·开发语言·网络·后端·面试
前端Hardy3 小时前
Vite 8 来了:彻底抛弃 Rollup 和 esbuild!Rust 重写后,快到 Webpack 连尾灯都看不见
前端·面试·vite
姗姗的鱼尾喵4 小时前
Java 面试内容分享
java·spring boot·面试
进击的编程阿伟4 小时前
C#开发工程师-面经
面试·c#
星辰_mya5 小时前
并发容器全家桶:选择正确的“交通工具”
java·开发语言·面试