Home >Backend Development >Python Tutorial >After the head of the Go language resigned, a domestic language was born

After the head of the Go language resigned, a domestic language was born

PHPz
PHPzforward
2023-04-10 12:21:031202browse

Event Review

Last week, Steve Francia, the head of Google’s Go language project, announced his resignation, and he The reason given was that work on the Go project had stalled, which made him feel uncomfortable. Interestingly, some domestic Gophers (the self-proclaimed name of Go language enthusiasts) also have new ideas about the Go language. For example, Gophers such as Chai Shushan, one of the first Go language enthusiasts in China, and Shi Bin, who has long been ranked in the top 50 of global Go contributors, decided to launch a new programming language based on the Go language: Ao Language™ (Ao). Pronounced "Wa").

Currently, the code of Concave Language™ has been open sourced on Github, and simple executable examples are provided. According to the introduction of its warehouse, the design goals of WaGo Language™ are as follows: 1. C language cloaked in Go and Rust syntax 2. The suffix of the source code file of Wago Language™ is .wa3, and the concave Language™ compiler is compatible with WaGo syntax. Concave grammar is consistent with WaGo grammar at the AST level (the two can generate the same AST and convert each other losslessly) 4. Concave Language™ supports Chinese/English bilingual keywords, that is, any keyword has a Chinese version and an English version. The two are equivalent at the grammatical level

After the head of the Go language resigned, a domestic language was born

concave language™ indication, image source @GitHub

According to Chai Shushan, Shi Bin and others, the "restrained" style of Go language is their greatest common denominator for the aesthetics of programming languages. Therefore, when the Concave Language™ project was launched, it drew heavily on Go’s design ideas and specific implementation.

Of course, they also said that choosing the Go language as the initial blueprint was a compromise that had to be made with limited investment. They hope that as the project develops, they will accumulate more original designs and contribute to the trend of independent innovation. Although Chai Shushan, Shi Bin and others are senior Gophers, it is not difficult to understand their preference for Go language, but we can't help but wonder: How magical is Go language that makes them so fascinated by Go language?

Why choose Go language

Looking at the evaluation of Go by many developers who have used Go language, Go The language has the following four characteristics in design.

1. Simple and easy to use
Different from those that use each other Drawing on mainstream programming languages ​​​​(such as C, Java, etc.) that are constantly adding new features, Go's designers refused to take the path of language feature integration at the beginning of language design, and chose "subtraction."

They left the complexity to the design and implementation of the language itself, to the Go core development team, and left the simplicity, ease of use and clarity to Most developers use Go language. Therefore, the Go language presents:

  • Concise, conventional syntax (no need to parse symbol tables), only 25 keywords;
  • No header file;
  • Explicit dependency (package);
  • No circular dependency (package);
  • Constants are just numbers;
  • The case of the first letter determines visibility;
  • Any type can have methods (No class);
  • No subtype inheritance (no subclass);
  • No arithmetic conversion;
  • There is no constructor or destructor;
  • Assignment is not an expression;
  • is defined in assignment and function call Evaluation order (no concept of "sequence points");
  • No pointer arithmetic;
  • Memory is always initialized to a zero value;
  • No type annotation syntax (such as const, static, etc. in C)
  • ......

2. Preference combination

Mainstream object-oriented languages ​​such as C and Java couple various parts of the program through a huge top-down type system, inheritance, explicit interface implementation and other mechanisms. However, in the Go language we find There is no syntax element, type system and inheritance mechanism of classic object-oriented.

So how does the Go language couple the various parts of the program together? It's a combination.

At the language design level, Go uses orthogonal grammatical elements, including the Go language typeless system. Types are independent and there is no concept of subtypes; each type has You can have your own set of methods, and type definitions and method implementations are orthogonal and independent.
Through type embedding between types, already implemented functions are embedded into new types to quickly meet the functional requirements of new types. When calling a method on an instance of a new type, method matching depends on the method name, not the type.
In addition, the aggregation of interface behaviors is achieved by embedding the interface type in the definition of the interface to form a large interface. This method is particularly commonly used in the standard library and has become An idiom of Go language.

This is an innovative design of the Go language: the interface is just a collection of methods, and the relationship with the implementer is implicit, which can reduce the coupling between various parts of the program. to the lowest.
3. Concurrency and lightweight

Three things about Go language Designers Rob Pike, Robert Griesemer and Ken Thompson once believed that the C standard committee was short-sighted in thinking, because the hardware is likely to undergo major changes in the next ten years, and it is very unwise to tightly couple the language with the hardware at that time. It cannot bring much help to developers when writing large-scale concurrent programs.
So they regard multi-core oriented, native built-in concurrency support as one of the design principles of the new language.

The design philosophy of Go language’s native support for concurrency is reflected in the following two points.
# (1) The Go language adopts a lightweight coroutine concurrency model, making Go applications more scalable when facing multi-core hardware. (2) The Go language provides developers with syntax elements and mechanisms that support concurrency.
4. Engineering-oriented

# Designers of Go language In the initial design stage of the Go language, solving engineering problems was regarded as one of Go's design principles, and then the design of Go's grammar, tool chain and standard library was considered. This is also the design idea between Go and those more academic and research-oriented programming languages. a major difference.
#This makes the Go language specification simple and flexible enough that programmers with a foundation in other languages ​​can quickly get started. More importantly, Go comes with a complete tool chain, which greatly improves the consistency of team collaboration. For example, Gofmt automatically formats Go code, which largely eliminates the problem of inconsistent formatting styles of codes written by different people. Configure the editor to automatically run Gofmt when editing an archive, so that you can place it anywhere when writing code, and it will automatically become correctly formatted code when archiving. In addition, there are very useful tools such as Gofix and Govet.

In short, Go’s simplicity at the language level allows Go to gain expressiveness that is not inferior to C/Java, etc., while also gaining better readability and more flexibility. High development efficiency and other more important elements in the field of software engineering.

The future of concave language™

Although today, Gowith its superior performance , has become one of the mainstream programming languages ​​​​(more than 75%#CNCF projects, including Kubernetes and Istio are both written in Go. In addition, Go is also one of the major cloud application languages), Go language is also quite popular in China, but we still can’t help but worry about being born out of Go# Will ##’s concave language™ have a bright future?


#It has always been difficult to predict the future. However, fortunately, there is a forerunner in front of Concave Language™-Go language. We might as well based on Go development, to roughly speculate on the future of Concave Language™.

Go is a programming language invented by Qiniu Cloud CEO Xu Shiwei. It was officially released in July 2020 and version 1.0 was launched in October 2021. The latest version is currently released on June 13 this year. Released version 1.1. In other words, after nearly two years from its official release to now, Go is still in its initial stage and is still far away from large-scale application. It can be foreseen that Concave Language™ will not enter the market for a long time in the future. In the eyes of the majority of developers.

In addition, according to Xu Shiwei’s views at the ECUG Con 2022 conference, although everyone pays more attention to the performance of programming languages, from a performance perspective alone, Xu Shiwei believes that Python is among the scripting languages. It can only be considered second-rate, and Python is actually not fast.

In Xu Shiwei’s view, the most important thing for a new language is the target group it chooses. The target group chosen by Go is the whole people. Xu Shiwei calls it "a language that even children can master." Therefore, Go starts from the integration of engineering and STEM education to lay a user base.

It is these characteristics of Go that make some developers optimistic about the future of Go. The positive expectations for Go will help Go's further development.

This principle is also applicable to Concave Language™:

The development focus of Concave Language™ may not lie in performance, but in which groups it chooses as its target audience, and How to obtain seed users.

If the project team of Ao Language™ will announce these news in the future, then the future of Ao Language™ can still be looked forward to.

The above is the detailed content of After the head of the Go language resigned, a domestic language was born. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:51cto.com. If there is any infringement, please contact admin@php.cn delete