Home  >  Article  >  Backend Development  >  Is go language a machine language?

Is go language a machine language?

青灯夜游
青灯夜游Original
2023-01-05 19:23:114361browse

Go language is not machine language; machine language is a low-level language, and go language is a high-level language. Go language is a high-level programming language open sourced by Google in 2009. It is designed to solve practical problems in the development process of large-scale systems. It supports concurrency, unified specifications, simplicity, elegance, and powerful performance; its main goal is to "have both The development speed of dynamic languages ​​such as Python and the performance and security of compiled languages ​​such as C/C.”

Is go language a machine language?

The operating environment of this tutorial: Windows 7 system, GO version 1.18, Dell G3 computer.

Go language is not machine language; machine language is a low-level language, and go language is a high-level language.

What is machine language, assembly language and high-level language

  • Machine language is a language expressed in binary code. It is the only language that a computer can directly recognize and execute. It has the advantages of being directly executable by a computer, concise, and fast in operation. However, it is not intuitive and is very error-prone. Program inspection and debugging They are all relatively difficult, and they are also very dependent on machines.

  • Assembly language is to solve the shortcomings of machine language that is difficult to understand and remember. It uses names and symbols that are easy to understand and remember to represent the operation codes in machine instructions. This A language composed of instruction mnemonics is called assembly language. The machine cannot directly execute programs written in assembly language, it also depends on the machine.

  • High-level language provides users with a way of working that is close to natural language, can use mathematical expressions, and is relatively independent of machines. Like assembly language, machines cannot directly execute programs written in high-level languages.

High-level language is mainly relative to assembly language. It is programming that is closer to natural language and mathematical formulas. It is basically separated from the hardware system of the machine and uses a way that is easier for people to understand. Programming. The program written is called the source program.

High-level language does not refer to a specific language, but includes many programming languages, such as the popular go language, java, c, c, C#, pascal, python, lisp, prolog, FoxPro , Easy Language, Chinese version of C language, etc. The syntax and command format of these languages ​​are different.

go language is a high-level language

Go language is a high-level programming language open sourced by Google in 2009 , it is designed to solve practical problems in the development process of large-scale systems. It supports concurrency, unified specifications, simplicity, elegance, and powerful performance. It is praised by many Go language evangelists as "C language in the cloud computing era." The main goal of the Go language is to "have both the development speed of dynamic languages ​​such as Python and the performance and security of compiled languages ​​such as C/C."

Is go language a machine language?

#The Go language is sometimes described as a "C-like language", or "the C language of the 21st century". Go inherits similar expression syntax, control flow structure, basic data types, call parameter value transfer, pointers and many other ideas from C language. It also has the running efficiency of compiled machine code that C language has always valued and is consistent with existing Seamless adaptation to the operating system.

Go’s AdvantagesDisadvantages

Programmer’s Voice: I can prototype, test, and deploy a production system in a matter of days if the real world requires it, and It can handle 5 times more requests per second than the original, and the CPU and memory overhead are still very small. I think only the Go language can do it.

Go language has the following advantages:

  • Separate binary release: Go project compilation will generate a static executable file. This file can be run independently without any other dependencies. This approach is particularly suitable for cloud-native container environments.
  • Cross-compilation: Compile binaries on any operating system that run on other platforms. For example, on a Mac system, binary files can be compiled that can run on Linux and Windows.
  • Garbage collection: Go language supports garbage collection. In comparison, C, Rust, etc. require developers to control themselves.
  • Execution performance: Go is very fast. Performance is close to C. Much higher than Java, Python, and Node.
  • Development efficiency: Go language has both the running performance of static languages ​​and the development efficiency of dynamic languages.
  • Simplicity and efficiency: The design philosophy of the Go language includes simplicity and efficiency. A typical counterexample is the complex and bloated Java language.
  • Concurrency: The language level supports concurrency, simplifies concurrent development through coroutines and channels, and improves concurrency performance.
  • Rich standard library: The Go standard library covers text, IO, network, encryption, Web services, remote RPC, template engine and other functions.
  • C language can be called: C language functions can be called to further optimize performance and reuse the huge ecosystem of C language.
  • Fast compilation time: Go compiles very quickly. You can refer to two static blog generation systems, Hexo (developed by Node) and Hugo (developed by Go).
  • Engineering type: The purpose of Go language design is to become an engineering language to solve actual engineering problems. The Go language defines development specifications and provides a wealth of tools. Using Go language, you can write programs that are easy to read and understand, and easy to test, maintain and expand. [Related recommendations: Go video tutorial, Programming teaching]

Go language has the following shortcomings:

  • Lack of heavyweight framework. Such as Ruby's Rails, Python's Django, and Java's Spring.
  • Error handling: No exception system. Go officials are fixing this problem.
  • Software package management: For a long time, Go has not officially had a package management system. Until recently, Go version 1.13 officially introduced Go Module as an official dependency management tool.
  • is not a standard object-oriented programming model: this is also an innovation of the Go language. If you are a solid OOP advocate, you may feel a little uncomfortable

#Expand knowledge: the difference between machine language, assembly language and high-level language

1. Efficiency:

Machine language: high execution efficiency and fast speed;

Assembly language: low-level programming efficiency;

High-level language: The execution efficiency is not as good as machine language, but the programming efficiency is higher than assembly language.

2. Composition:

Machine language: Machine language is an instruction set composed of 0 and 1 arranged according to certain rules: it is the only one that a computer can recognize and execute. language.

Assembly language: An instruction system that uses mnemonics to represent opcodes and operands in machine instructions. Enhanced readability and fast execution speed;

High-level language: a language that is closer to human natural language and mathematical language. Programs written in it can greatly reduce the labor of programmers, so it also has Better portability.

3. Oriented type:

Machine language: It is a machine-oriented language with poor readability.

Assembly language: It is still a machine-oriented language with strong readability;

High-level language: Simplified natural language that is close to humans and has high readability.

For more programming related knowledge, please visit: Programming Video! !

The above is the detailed content of Is go language a machine language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn