学编程用什么编译器_什么是编程编译器?

学编程用什么编译器

A compiler is a software program that converts computer programming code written by a human programmer into binary code (machine code) that can be understood and executed by a specific CPU. The act of transforming source code into machine code is called "compilation." When all the code is transformed at one time before it reaches the platforms that run it, the process is called ahead-of-time (AOT) compilation.

编译器是将人类程序员编写的计算机编程代码转换成可由特定CPU理解和执行的二进制代码(机器代码)的软件程序。 将源代码转换为机器代码的行为称为“编译”。 当所有代码在到达运行它的平台之前一次转换时,该过程称为提前(AOT)编译。

哪些编程语言使用AOT编译器? ( Which Programming Languages Use an AOT Compiler? )

Many well-known programming languages require a compiler including:

许多著名的编程语言都需要编译器,其中包括:

  • Fortran

    Fortran
  • Pascal

    帕斯卡
  • Assembly Language

    汇编语言
  • C

    C
  • C++

    C ++
  • Swift

    Swift

Before Java and C#, all computer programs were either compiled or interpreted.

在Java和C#之前,所有计算机程序都是经过编译或解释的

那解释代码呢? ( What About Interpreted Code? )

Interpreted code executes instructions in a program without compiling them into machine language. The interpreted code parses the source code directly, is paired with a virtual machine that translates the code for the machine at the time of execution, or takes advantage of precompiled code. Javascript is usually interpreted.​

解释后的代码将在程序中执行指令,而无需将其编译为机器语言。 解释后的代码直接解析源代码,与虚拟机配对,该虚拟机在执行时为该机器翻译代码,或者利用预编译的代码。 通常会解释Java语言

Compiled code runs faster than interpreted code because it doesn't need to do any work at the time the action takes place. The work is already done.

编译后的代码比解释后的代码运行得更快,因为在执行操作时它不需要做任何工作。 工作已经完成。

哪种编程语言使用JIT编译器? ( Which Programming Languages Use a JIT Compiler? )

Java and C# use just-in-time compilers. Just-in-time compilers are a combination of AOT compilers and interpreters. After a Java program is written, the JIT compiler turns the code into bytecode rather than into code that contains instructions for a specific hardware platform's processor. The bytecode is platform independent and can be sent and run on any platform that supports Java. In a sense, the program is compiled in a two-stage process. ​

Java和C#使用即时编译器。 即时编译器是AOT编译器和解释器的组合。 编写Java程序后,JIT编译器将代码转换为字节码,而不是包含用于特定硬件平台处理器的指令的代码。 字节码与平台无关,可以在支持Java的任何平台上发送和运行。 从某种意义上说,该程序是分两个阶段进行编译的。

Similarly, C# uses a JIT compiler that is part of the Common Language Runtime, which manages the execution of all .NET applications. Each target platform has a JIT compiler. As long as the intermediate bytecode language conversion can be understood by the platform, the program runs.

同样,C#使用作为公共语言运行时一部分的JIT编译器,该编译器管理所有.NET应用程序的执行。 每个目标平台都有一个JIT编译器。 只要平台可以理解中间字节码语言转换,程序就可以运行。

AOT和JIT编译的优缺点 ( Pros and Cons of AOT and JIT Compilation )

Ahead-of-time (AOT) compilation delivers faster startup time, particularly when much of the code executes at startup. However, it requires more memory and more disk space. JOT compilation must target the least capable of all possible execution platforms.

提前(AOT)编译可缩短启动时间,尤其是在启动时执行许多代码时。 但是,它需要更多的内存和更多的磁盘空间。 JOT编译必须针对所有可能执行平台中功能最弱的目标。

Just-in-time (JIT) compilation profiles the target platform while it runs and re-compiles on the fly to deliver improved performance. JIT generates improved code because it targets the current platform, although it usually takes more time to run than AOT compiled code.

即时(JIT)编译会在目标平台运行时对其进行概要分析,并即时对其进行重新编译以提供改进的性能。 JIT生成了改进的代码,因为它针对当前平台,尽管通常比AOT编译的代码花费更多的时间来运行。

翻译自: https://www.thoughtco.com/definition-of-compiler-958198

学编程用什么编译器

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值