首页 > 其他分享 >《Programming from the Ground Up》阅读笔记:p181-p216

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

时间:2024-10-09 22:33:01浏览次数:1  
标签:p181 语言 language compiled Programming Up interpreted languages 编译

《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》:https://book.douban.com/subject/1787855/

2. 英语

(1)Etymology Dictionary:https://www.etymonline.com

(2) Cambridge Dictionary:https://dictionary.cambridge.org

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

标签:p181,语言,language,compiled,Programming,Up,interpreted,languages,编译
From: https://www.cnblogs.com/codists/p/18455343

相关文章

  • The 2023 ICPC Asia Hangzhou Regional Contest (The 2nd Universal Cup. Stage 22: H
    The2023ICPCAsiaHangzhouRegionalContest(The2ndUniversalCup.Stage22:Hangzhou)M.V-Diagram题意:给定一个“v图”,求平均值最大的子"v图"思路:原图的最低点以及左右两个点必须取,如何先取满左边或者右边在贪心即可voidsolve(){lln;cin>>n;vect......
  • xtrabackup备份工具使用指南
    一、xtrabackup介绍xtrabackup是由Percona公司开发的一个用于MySQL数据库物理热备的工具,开源免费。目前最新的xtrabbackup8.3版本可以备份MySQL8.3servers上的InnoDB,XtraDB,MyISAM,MyRocks表,PerconaServerforMySQLwithXtraDB,PerconaServerforMySQL8.3......
  • INFS3208 – Cloud Computing Programming
    SchoolofInformationTechnologyandElectricalEngineeringINFS3208–CloudComputingProgrammingAssignmentTaskIII(10Marks)Taskdescription:Inthisassignment,youareaskedtowriteapieceofSparkcodetocountoccurrencesofverbsintheUN......
  • nodeJS构建错误——digital envelope routines::unsupported
    最近正在调研开源工作流项目,从github上克隆的代码,执行npmrundev报错。错误如下:查找原因出现了问题,自然要想办法解决。在网上搜索了一圈,发现该问题早已出现,一般描述的大致原因就是:当 nodejs 升级到17+版本以后,开始支持 OpenSSL3.0,而 OpenSSL3.0 对各种摘要算法做......
  • 深度学习对对联:探索seq2seq-couplet项目的智能对联生成
    引言对联作为中国传统文化的瑰宝,一直以其对仗工整、意境深远而备受推崇。随着人工智能技术的发展,利用深度学习来生成对联成为了一个引人注目的研究方向。本文将深入探讨seq2seq-couplet项目,这是一个利用序列到序列(seq2seq)模型来实现智能对联生成的开源项目。seq2seq-couple......
  • C++编译并运行后出现Process finished with exit code 139 (interrupted by signal 11
    问题描述:        代码运行意外终止,报错信息为Processfinishedwithexitcode139(interruptedbysignal11:SIGSEGV)CMakeList文件如下:cmake_minimum_required(VERSION3.26)project(SLAM)set(CMAKE_CXX_STANDARD17)set(CMAKE_CXX_STANDARD_REQUIRED......
  • COMP612 Computer Graphics Programming
    COMP612ComputerGraphicsProgrammingSemester2,2024Project:HelicopterSceneThisisanindividualassignment.Allworkyousubmitmustbeentirelyyourown.Theassignmentisworth70%andwillbemarkedoutof100.Youmustworkfromtheprovided......
  • 收藏等于吃灰?SuperMemory:让信息不再迷失
    网上冲浪,永远在收藏,但是书到用时方恨少?你是否希望拥有一款工具,可以帮助你轻松管理、整理和检索所有重要信息?SuperMemory就是你需要的答案!它是一款强大的第二大脑工具,可以帮助你构建个人知识库,并轻松访问所有重要信息。 【使用场景】学习研究:保存有价值的文章、论文,构......
  • 基于GA遗传优化的GroupCNN分组卷积网络时间序列预测算法matlab仿真
    1.算法运行效果图预览(完整程序运行后无水印)  2.算法运行软件版本MATLAB2022A 3.部分核心程序(完整版代码包含详细中文注释和操作步骤视频)figureplot(Error2,'linewidth',2);gridonxlabel('迭代次数');ylabel('遗传算法优化过程');legend('Averagefitness'......
  • Error: Failed to download metadata for repo ‘update‘
    安装Rsync时报错:通常原因为从openEuler的官方仓库更新元数据时遇到超时或连接失败的问题。更换镜像源#移除旧的镜像源[[email protected]]#mv/etc/yum.repos.d/openEuler.repo/etc/yum.repos.d/openEuler.repo.bak#替换国产openEuler镜像源[root@nginx1yum......