解释型和编译型编程语言_解释型和编译型编程语言:有什么区别?
解释型和编译型编程语言
Every program is a set of instructions, whether it’s to add two numbers or send a request over the internet. Compilers and interpreters take human-readable code and convert it to computer-readable machine code.
每个程序都是一组指令,无论是添加两个数字还是通过Internet发送请求。 编译器和解释器将人类可读的代码转换为计算机可读的机器代码。
In a compiled language, the target machine directly translates the program. In an interpreted language, the source code is not directly translated by the target machine. Instead, a different program, aka the interpreter, reads and executes the code.
目标计算机以编译语言直接翻译程序。 在一种解释性语言中,源代码不会直接由目标计算机翻译。 而是由另一个程序(也称为解释器)读取并执行代码。
好的,但这实际上是什么意思? (Okay… but what does that actually mean?)
Imagine you have a hummus recipe that you want to make, but it's written in ancient Greek. There are two ways you, a non-ancient-Greek speaker, could follow its directions.
想象您有一个鹰嘴豆泥食谱要制作,但是它是用古希腊语写的。 作为非古希腊语讲者,您可以通过两种方式遵循其指示。
The first is if someone had already translated it into English for you. You (and anyone else who can speak English) could read the English version of the recipe and make hummus. Think of this translated recipe as the compiled version.
首先是有人已经为您翻译成英文。 您(以及其他会讲英语的人)可以阅读食谱的英文版本,做鹰嘴豆泥。 将此翻译的配方视为编译版本。
The second way is if you have a friend who knows ancient Greek. When you're ready to make hummus, your friend sits next to you and translates the recipe into English as you go, line by line. In this case, your friend is the interpreter for the interpreted version of the recipe.
第二种方法是,如果您有一位了解古希腊语的朋友。 当您准备制作鹰嘴豆泥时,您的朋友会坐在您旁边,并逐步将食谱翻译成英文。 在这种情况下,您的朋友是食谱解释版本的解释者 。
编译语言 (Compiled Languages)
Compiled languages are converted directly into machine code that the processor can execute. As a result, they tend to be faster and more efficient to execute than interpreted languages. They also give the developer more control over hardware aspects, like memory management and CPU usage.
编译的语言直接转换为处理器可以执行的机器代码。 结果,它们往往比解释语言更快,更高效地执行。 它们还使开发人员可以更好地控制硬件方面,例如内存管理和CPU使用率。
Compiled languages need a “build” step – they need to be manually compiled first. You need to “rebuild” the program every time you need to make a change. In our hummus example, the entire translation is written before it gets to you. If the original author decides that he wants to use a different kind of olive oil, the entire recipe would need to be translated again and resent to you.
编译语言需要一个“构建”步骤-首先需要对其进行手动编译。 每次需要进行更改时,您都需要“重建”程序。 在我们的鹰嘴豆泥示例中,整个翻译是在您到达之前编写的。 如果原始作者决定他要使用其他种类的橄榄油,则需要重新翻译整个食谱并重新发送给您。
Examples of pure compiled languages are C, C++, Erlang, Haskell, Rust, and Go.
纯编译语言的示例是C,C ++,Erlang,Haskell,Rust和Go。
口译语言 (Interpreted Languages)
Interpreters run through a program line by line and execute each command. Here, if the author decides he wants to use a different kind of olive oil, he could scratch the old one out and add the new one. Your translator friend can then convey that change to you as it happens.
口译员逐行执行程序并执行每个命令。 在这里,如果作者决定使用其他种类的橄榄油,则可以将旧的橄榄油划掉,然后添加新的橄榄油。 然后,您的翻译朋友可以随时将更改传达给您。
Interpreted languages were once significantly slower than compiled languages. But, with the development of just-in-time compilation, that gap is shrinking.
口译语言曾经远比编译语言慢。 但是,随着即时编译的发展 ,这种差距正在缩小。
Examples of common interpreted languages are PHP, Ruby, Python, and JavaScript.
常见解释语言的示例是PHP,Ruby,Python和JavaScript。
一个小警告 (A Small Caveat)
Most programming languages can have both compiled and interpreted implementations – the language itself is not necessarily compiled or interpreted. However, for simplicity’s sake, they’re typically referred to as such.
大多数编程语言可以同时具有编译和解释的实现-语言本身不一定是编译或解释的。 但是,为简单起见,通常将它们称为此类。
Python, for example, can be executed as either a compiled program or as an interpreted language in interactive mode. On the other hand, most command line tools, CLIs, and shells can theoretically be classified as interpreted languages.
例如,Python可以在交互模式下作为编译程序或解释语言执行。 另一方面,大多数命令行工具,CLI和外壳程序在理论上可以归类为解释语言。
的优点和缺点 (Advantages and disadvantages)
编译语言的优势 (Advantages of compiled languages)
Programs that are compiled into native machine code tend to be faster than interpreted code. This is because the process of translating code at run time adds to the overhead, and can cause the program to be slower overall.
编译为本地机器代码的程序往往比解释的代码要快。 这是因为在运行时翻译代码的过程增加了开销,并可能导致程序整体变慢。
编译语言的缺点 (Disadvantages of compiled languages)
The most notable disadvantages are:
最明显的缺点是:
- Additional time needed to complete the entire compilation step before testing测试之前完成整个编译步骤需要额外的时间
- Platform dependence of the generated binary code生成的二进制代码的平台依赖性
口译语言的优势 (Advantages of interpreted languages)
Interpreted languages tend to be more flexible, and often offer features like dynamic typing and smaller program size. Also, because interpreters execute the source program code themselves, the code itself is platform independent.
口译语言趋向于更灵活,并且经常提供诸如动态键入和较小程序大小的功能。 另外,由于解释器自己执行源程序代码,因此代码本身是平台无关的。
解释语言的缺点 (Disadvantages of interpreted languages)
The most notable disadvantage is typical execution speed compared to compiled languages.
与编译语言相比,最明显的缺点是典型的执行速度。
翻译自: https://www.freecodecamp.org/news/compiled-versus-interpreted-languages/
解释型和编译型编程语言
相关文章:

Beta 冲刺 (1/7)
队名:天机组 组员1友林 228(组长) 今日完成:查找了相关资料及api文档。明天计划:继续相关资料及源码。剩余任务:优化网络通讯机制主要困难:查找的代码调试较为困难。收获及疑问:暂无…

Vue全局路由侦听beforeEach路由守卫附代码使用示例
使用路由守卫beforeEach,可以实现路由侦听; 全局侦听路由跳转的实现代码: app.vue onLaunch: function(e) {this.$router.beforeEach((to, from, next) > {console.log($router,to,from);next();}); } to 是跳转路由之后的page对象&am…

Debug模式下加载文件,运行程序异常的慢
今天在进行单元测试的时候,debug模式下加载速度很慢,但是run模式下速度很快。 原因:在debug模式下,断点位置不当,解决办法 移除编译器中的所有断点。转载于:https://www.cnblogs.com/nww57/p/5277113.html

如何在Python中对字符串进行子字符串化
Python offers many ways to substring a string. It is often called ‘slicing’.Python提供了许多对字符串进行子字符串化的方法。 它通常被称为“切片”。 It follows this template:它遵循以下模板: string[start: end: step]Where,哪里, start:…

HttpPost导包遇到的问题
直接在当前项目 build.gradle文件修改如下 android { useLibrary org.apache.http.legacy compileSdkVersion 24 buildToolsVersion "24.0.0" defaultConfig { applicationId "com.ican.subjects" minSdkVe…

真相也许是这样
这两天同学们陆续上传了自己编写的小程序,等老师审查给成绩的时候才发现一部分同学是负分。原因就是他们有抄袭之嫌。恰巧我当时就在一位得了负分的同学旁边,他一脸郁闷的对我说”没道理啊,这是我自己编的啊“。这个我知道,的确是…

微信小程序全局监听路由变化
小程序有一个API可以侦听全局路由跳转,官方文档里面没有但是可以使用。 wx.onAppRoute((res) > { console.log(路由监听,{res}) })

c语言面向对象编程中的类_C ++中的面向对象编程
c语言面向对象编程中的类Object oriented programming, OOP for short, aims to implement real world entities like inheritance, hiding and polymorphism in programming. 面向对象的编程,简称OOP,旨在在编程中实现诸如继承,隐藏和多态性…

Maven build标签
前言: <build >设置,主要用于编译设置 1.分类 在Maven的pom.xml文件中,存在如下两种<build>: (1)全局配置(project build) 针对整个项目的所有情况都有效 (2…

Ant Design Vue 表格内编辑(附完整源码及效果图)
效果图: 实现关键代码就是表单的 columns 属性对象下标的 scopedSlots: scopedSlots: {customRender: } 实现完整代码: <template><div><div class"table-wrapper"><!--每个列的宽度必须比列名总长度大才能…

shell基本用法
#!/bin/bash #使用哪个shell执行echo "hello world" username"tom" echo $username#chmod x ./test.sh 设置可以执行文件#for循环输出 for skill in Ada Coffe Action Java; doecho "I am good at ${skill}Script" done #for file in ls /etc; d…

brad wu_一百万归功于Brad Traversy
brad wuBrad Traversy is one of the most appreciated web development teachers on YouTube and he is getting close to 1 Million subscribers. We decided to help him reach this goal by the end of 2019.布拉德特拉弗西 ( Brad Traversy)是YouTube上最受赞赏的网络开发…

CSS常见布局解决方案
最近要准备移动端项目,大半年没好好写过CSS了,今天恶补了一下CSS的一些布局,下面做一些分享。 水平居中布局 1.margin 定宽 <div class"parent"><div class"child">Demo</div> </div><style…

java.io.EOFException java.io.ObjectInputStream$PeekInputStream.readFully 错误
omcat 启动时报以下错误: java.io.EOFException at java.io.ObjectInputStream$PeekInputStream.readFully 错误 这个错误 碰到好几次了,我的tomcat使用非常频繁,而且部署项目比较多,经常会出一些自己看不懂的问题, 今天解决了这…

SQL替换字段中部分字符
示例: tb_item表中image字段中一数据为:jd/4ef8861cf6854de9889f3db9b24dc371.jpg update tb_item set image replace(image,jd,taobao); 替换后: taobao/4ef8861cf6854de9889f3db9b24dc371.jpg

flexbox_Flexbox中的Flex基础属性
flexbox弹性基础 (Flex Basis) The flex-basis property defines the size of the flex-item along the main axis of the flex container. The main axis is horizontal if flex-direction is set to row and it’ll be vertical if the flex-direction property is set to co…

OpenStack之虚拟机热迁移
这里的环境是centos7版本,openstack K版 1.在各个计算节点设置权限 chmod 755 /var/lib/nova/instances 2.修改各个节点的nova.conf(/etc/nova/nova.conf) vncserver_proxyclient_address虚拟机IP # vncserver_listen0.0.0.0 3.修改所有计算节点libvirt 3.1 修改/e…

软件工程概论个人作业02
可怜的二柱子同学,老师又对他的自动出题系统提出了新的要求: 1、题目避免重复; 2、可定制(数量/打印方式); 3、可以控制下列参数: 是否有乘除法; 是否有括号(最多可以支持十个数参与计算)&#…

前端开发学习常用网站网址及介绍(都是免费的)
在开发的时候,想记住所有的单词基本是不可能的,所以就需要进入文档,只要理清需求能做出来,就很不差了!! 扫码加博主微信 1.百度,俗称度娘,有不懂的就问百度,有问必答&am…

sql语句语法多表关联_SQL Delete语句-如何删除行或表,语法示例
sql语句语法多表关联To delete a record in a table you use the DELETE statement.要删除表中的记录,请使用DELETE语句。 Be careful. You can delete all records of the table or just a few. Use the WHERE condition to specify which records do you wan…

数据库 大数据访问及分区分块优化方案
本文导读:当系统要满足每秒数万次的读写请求的需求时,我们可以用分布式计算、编写优良的程序代码、对海量数据进行分区操作、建立广泛的索引、建立缓存机制、加大虚拟内存、分批处理、使用数据仓库和多维数据库存储、使用负载均衡技术、将数据库的读写分…

每周算法讲堂 floyd
http://www.bilibili.com/video/av4108914/ 转载于:https://www.cnblogs.com/qscqesze/p/5284554.html

小程序云开发常用语句宝库
查询语句,返回的是 res.data[] 数组 调用云函数返回的是res.result get 数据获取返回的是 res.data{} 对象 1.调用云函数 this.DB wx.cloud.database() wx.cloud.init({env: mm-4t7rg }) wx.cloud.callFunction({name: "login",data: {},success(res)…

初学api测试_面向初学者的API-在此免费视频课程中学习如何使用API
初学api测试What exactly is an API? How do you use an API? Weve just published a full beginners course about Application Programming Interfaces (APIs) on the freeCodeCamp.org YouTube channel.API到底是什么? 您如何使用API? 我们刚刚…

整理Simple.Data使用方法
官方:http://simplefx.org/simpledata/docs/index.html Insert var user db.Users.Insert(Name: "Ford", Password: "hoopy", Age: 29);var user new User {Name "Zaphod", Password "zarquon", Age 42}; var actual db.Users.I…

css3之border-radius理解
在日常项目过程中,border-radius这个属性算是非常常用的属性之一了,通过设置元素的border-radius值,可以轻松给元素设置圆角边框,甚至实现绘制圆、半圆、四分之一的圆等各种圆角图形。 通常我在使用这个属性的时候,一般…

deepLink iOS 应用到自己APP 记录
1.了解deeplink 详细的介绍可以在网上查询,这里简单说一下.这项技术主要是为了方便广告跳转而产生的.最大的例子就是淘宝,天猫,京东等购物APP.在第三方APP中点击广告链接直接跳转到对应的客户端的商品的详情中,节省用户的时间,一步到位. 2.自己APP实现deeplink需要的准备工作…

小程序 reduce_使用reduce制作的10个更多实用程序功能
小程序 reduceThis time, with a test suite! 这次,带有测试套件! Previously I wrote about 10 utility functions implemented with JavaScripts reduce function. It was well-received, and I walked away with an even deeper appreciation for th…

洛谷1216 数字三角形
题目描述 观察下面的数字金字塔。 写一个程序来查找从最高点到底部任意处结束的路径,使路径经过数字的和最大。每一步可以走到左下方的点也可以到达右下方的点。 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 在上面的样例中,从7 到 3 到 8 到 7 到 5 的路径产生了最大 …

iOS 依次执行 异步网络请求的一种实现
1.首先先介绍一个概念dispatch_semaphore dispatch_semaphore信号量为基于计数器的一种多线程同步机制。用于解决在多个线程访问共有资源时候,会因为多线程的特性而引发数据出错的问题.如果semaphore计数大于等于1,计数-1,返回,程…