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

相关推荐
一只叫煤球的猫2 分钟前
ThreadForge 源码解读二:一个 Task 从 submit 到完成,内部到底发生了什么?
java·后端·面试
AI人工智能+电脑小能手2 小时前
【大白话说Java面试题 第110题】【并发篇】第10题:CAS 存在哪些问题?
java·开发语言·面试
秋92 小时前
Python工程师面试常问提问和回答(AI工程化方向 · 2026版)
人工智能·python·面试
西安邮电大学3 小时前
贪心算法详细讲解
java·后端·其他·算法·面试
黄昏回响5 小时前
信息系统基础知识(八):典型信息系统架构模型详解
程序人生·面试·系统架构·改行学it
触底反弹7 小时前
从 JS 引擎执行原理理解数据类型:栈内存、堆内存与作用域
javascript·数据结构·面试
胡萝卜术7 小时前
从零搞懂 AJAX:手把手带你从 XMLHttpRequest 到 fetch,彻底理解前后端数据交互
前端·后端·面试
程序员二叉8 小时前
【JUC】AQS底层深度拆解|独占/共享模式|队列原理全详解
java·开发语言·面试·juc
DogDaoDao8 小时前
C++核心技术深度剖析:从底层原理到工程实践
开发语言·c++·面试·程序员·指针·虚函数
枫子有风8 小时前
LLM-RAG(大厂面试常问问题)
面试·职场和发展·llm·rag