《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)

相关推荐
掘金安东尼1 小时前
字节前端三面复盘:基础不花哨,代码要扎实(含高频题解)
前端·面试·github
顾林海2 小时前
从"面条代码"到"精装别墅":Android MVPS架构的逆袭之路
android·面试·架构
FogLetter2 小时前
面试官问我Function Call,我这样回答拿到了Offer!
前端·面试·openai
AAA修煤气灶刘哥2 小时前
日志排查不用慌!从采集到 ELK 实战,手把手教你搞定线上问题
后端·面试·debug
似水流年流不尽思念2 小时前
MySQL 的 MVCC 到底解决了幻读问题没有?请举例说明。
mysql·面试
就是帅我不改2 小时前
SpringBoot多租户架构设计终极指南:5种方案彻底解决企业级SaaS隔离难题
后端·面试·架构
页面仔Dony3 小时前
任务队列的中断和恢复实现
javascript·面试
言兴3 小时前
深度解析:React Fiber 机制 —— 从“同步阻塞”到“可中断调度”的革命
前端·javascript·面试
前端小巷子4 小时前
从 Vue 2 到 Vue 3
前端·vue.js·面试
Mi_Manchikkk4 小时前
Java高级面试实战:Spring Boot微服务与Redis缓存整合案例解析
java·spring boot·redis·缓存·微服务·面试