Home > News content

How are you getting along with the wave that wants to replace C and Java?

via:开源中国     time:2020/5/19 9:57:21     readed:331

Some time ago, the Youth Festival speech video "houlang" launched by B station was swiped in the circle of friends, watching the colorful life of "houlang". Colleagues laughed at themselves as the one photographed on the beach, ravaged by life crazily. But in the programming language world,The waves raised by "houlang" are very limited. Compared with the emerging programming languages that have emerged in recent years, those "waves ahead" who have been at the peak of their careers for decades do not seem to want to abdicate.

In recent decades, there have been many emerging programming languages, some of which are designed to replace some old languages. Can these "back waves" in the programming language community catch up with the "front waves"? Now let's take a look at the well-known "afterwaves" in the programming industry these years.

Before waves C (1979)VS after wavesGo(2009)

The go language, which was born in 2009, is the second generation of programming languages. There are three early authors of go, rob pike, Ken Thompson and Robert Griesemer, all of whom are of great origin. Rob pike was a member of the UNIX team of Bell Labs and the plan 9 operating system plan. He worked with Thompson for many years and created the widely used UTF-8 character code. Ken Thompson is the author of B and c languages, the father of UNIX, the 1983 Turing Award and 1998 National Technology Award winner. Before developing go, Robert Griesemer was Google Major contributors to the V8, chubby, and hotspot JVMs.

Rob Pike thought in 2007 that C compiling on a distributed Google platform was too long, so he and Robert Griesemer began to explore "a greater improvement in simplifying programming languages than adding new features to bloated languages ". As soon as the two clapped, they immediately convinced the Ken Thompson, three around them to decide to try a new language. Several days later, they launched a project called Golang within the Google. Soon a new language that was optimized on the basis of C language was born, and that is Go..

Go grammar is used in many places as a C/C. to replace C/C new language Such as using curly braces as delimiters and semicolons as the end of statements, which makes it easy for Go to be accepted by developers proficient in C/C. On the basis of C/C basic syntax, Go has added a lot of practical functions for the current popular distributed system, such as ultra-lightweight threads goroutine, in high-concurrent systems, can write programs in a multi-thread way, thus ensuring the logic is clear and simple, and can obtain very high performance. The same thing needs to call a third-party framework in the C, if you use multithreading, it will cause too many system threads to bring a lot of context switching overhead; if you use a message-based architecture, although high efficiency can be achieved, but the program logic will be scattered, poor readability and maintainability.

Moreover, Go language, as a "son" of Google support, has a set of mature tools, such as compilation, testing, debugging, performance analysis, and so on. It is extremely efficient to compile, plus it has built in many libraries commonly used in the development of back-end systems, such as regular expressions which can be said to be a very mature engineering development language. And in this respect, C need to use a large number of third-party open source tools or libraries, in engineering needs to spend more energy on technology selection, but also not conducive to later maintenance.

Based on the above advantages, go language is recognized as very suitable for building command-line utilities and network services, especially for high concurrency applications in cloud computing scenarios. Nowadays, the popular container engine docker and container arrangement system kubernetes are all written in go, and go is also called "container language" by some people.

While Go have surpassed C/C, in many ways and have a place in cloud-related fields, it is still hard to shake the position of C/C language in a large number of industrial infrastructure terminals. The advantage of C/C is still its efficiency, and C is still the best choice for low-level device drivers, kernel space operating system components, and other tasks that require strict control over memory layout and management.

At present, go is at the top of the list of authoritative programming languages, and it has been on the rise. At present, with the construction of cloud native in full swing, go at least has completed the transcendence of the predecessors in the field of "cloud".

The Rust(2010) C (1979)VS the waves

Rust was originally created Mozilla address the inability of software at the language level to take real advantage of the performance enhancements that multicore computing brings, something similar to Go. Compared to the previous generation C ,Rust in the code security this feature is sufficient effort. For example, in memory security, Rust doesn't allow empty pointers, drape pointers, and data competition in security code, these problems do n' t pass at compile time. "Previously, we had to use C or C to write high-quality code with lower memory footprint ," Nichols the community's core developer. However, using these languages in production code requires you to manually manage memory and understand all the methods that can lead to undefined behavior ." Nichols point out that the ever-expanding database of CVE code vulnerabilities proves that even the best programmers are struggling with endless code vulnerabilities. "Rust the compiler is very strict to make sure you use memory safely so you can focus on the problems you really want to solve ."

While Rust has won some developers' favor with its code-security features, its early development has been lukewarm, given that it is not sufficiently both in performance and syntax, and because its learning curve is not smooth. Until last july, microsoft suddenly announced that it would embrace Rust, explore security alternatives using Rust as a C/C and other language to improve the security of applications. Microsoft believes Rust is the best choice for system programming in the industry, not only because it can write system-level programs in a memory-safe way, but also because of its precision.

Microsoft's move has led to the rise of the status of rust among developers. More and more enterprises and individuals have begun to pay attention to and attach importance to code security, so as to reexamine the new language. This is mainly reflected in several things that have happened around the rust language since 2020: Linux kernel maintainers have expressed their willingness to accept the development of linux drivers with rust; AWS has announced sponsorship First, Microsoft went a step further, developing and opening the new programming language Verona inspired by first this year; recently,Apple Step up and embrace it, plan to port some C code to Rust..

At present, the development of rust language is still relatively slow in general. According to the latest survey report, most developers who are not willing to accept rust think that the current problems of rust mainly lie in the steep learning curve, lack of required libraries, lack of IDE support, etc. It can be said that the development of rust still has a long way to go.

Objective-C (1986) vs back waveSwift(2014)

Swift is one of the few "back waves" that have successfully photographed "front waves" on the beach.

Perhaps inspired by the Go of competitors' Google in 2010, Apple executives decided to develop a new programming language to replace decades of Objective-C,, the first person to receive it Chris became a well-known compiler expert before graduating from university, and the papers published during his master's degree laid the foundation for LLVM framework. the LLVM Clang created by Chris became the compilation framework for Apple software products after joining the company. Swift language is another Chris after LLVM and Clang.

Swift is a modern language, in the process of design, Chris refer to the advantages of Objective-C、Rust、Haskell、Ruby、Python、C# and other languages, and finally form a Swift grammatical characteristics. the syntax of the Swift is more concise than the previous OC, such as no semicolon is required at the end of the line, no brackets are required for if/else statements ,[] is no longer nested when methods are called, string inserts are supported,% s,%d,%@ in the OC are omitted, and so on. Meanwhile, Swift combine oc header files. h and implementation files. m into a code file. swift, makes the Swift code easier to maintain. Most importantly, apple engineers who excel at optimisation allow Swift to run nearly 1.4 times C, than OC. After the birth of the Swift, Apple software developers only need to maintain the original half of the amount of code files, greatly improved development efficiency, reduce maintenance costs.

Qianlang JavaScript (1995) vs houlang Dart (2011)

Dart is another wheel made by Google engineers after go. Similar to go, dart was originally a group of Google engineers who thought JavaScript was not very good, so they wanted to rebuild a better language to replace it, so dart came into being.

According to Google engineers, the time from design to release of JS is very short (only 7 months), and there are inherent deficiencies in language specification and prudence, such as too loose syntax, lack of modularity, incomplete core library, unclear programming language paradigm, etc., and it is difficult to repair in an improved way. In fact, Google engineers have made many contributions to improving JavaScript performance over the years, especially through the V8 engine to strengthen the JIT's compilation ability of JS, so that the performance of Chrome browser is unique. This is enough to show that JavaScript at that time had many problems in the eyes of Google engineers.

Dart was originally born as a scripting language running in browsers. Google also built a dartvm engine in chrome to promote dart. Thanks to Chrome's huge user base, dart has accumulated a sizable early user base.

I thought that under the protection of Google, dart could develop steadily and eventually catch up with JavaScript. However, what Google didn't expect was that it killed a node.js halfway. Node.js is a JavaScript running environment, which enables JavaScript to develop back-end programs and realize almost all the functions of other back-end languages, which means that JavaScript can be on the same level with PHP, Java, python,. Net, ruby and other back-end languages. Since then, "all applications that can be written in JavaScript will be written in JavaScript" has been widely spread in the circle. It is worth mentioning that node.js was developed based on Google's own open source JavaScript engine V8. V8 was originally used for Chrome's interpreter of JavaScript. Ryan Dahl moved V8 to the server to make the software for the server and achieved success. In the next few years, the model of front-end development has changed due to JavaScript. The star projects based on JavaScript such as react, react native, Vue, etc. have risen rapidly, and dart is gradually forgotten in the corner.

However, Google never gave up dart. In 2018, Google restructured dart and launched dart 2.0 in August, redefining it as a language with rich toolkits and components that supports both web and mobile client development. In December of the same year, Google released the cross platform application development tool flutter written by dart, which enables dart to write command-line programs on the server side and compile JavaScript to run in the browser on the front end. Later, Google began a new round of efforts to promote the new dart, including the launch of the corresponding dart version for another well-known front-end framework, angular, and the designation of dart as the official development language of future operating system fuchsia. The dart community is full of vitality.

It can be said that in the first few years of its birth, dart, as a scripting language running in browsers, was completely defeated by the predecessor JavaScript. Now, with the "big front end" wave of change, it's not realistic to surpass JavaScript (after all, "everything that can be written in JavaScript will be written in JavaScript"), but dart is still a potential "afterwave" representative in the future.

Qianlang Java (1995) vs houlang kotlin (2011)

Kotlin is Google's new programming language after go. Kotlin was born in 2010, from JetBrains, and officially opened in 2012. Kotlin was originally designed to create a Java compatible programming language and make it better than Java.

As a relatively new JVM language, kotlin is strongly supported by Google. In 2017, Google announced at the I / O developers conference that kotlin officially became the official development language of Android. At the I / O conference two years later, Google added kotlin code again and announced that it became the official preferred language for Android development.

Kotlin's syntax integrates the features of Scala, groovy, python, swift and many other languages. If you have used any of them, it will be very easy to start kotlin. Compared with Java, kotlin introduces functional programming, and various syntactic sugars simplify the code. But unlike other new languages trying to replace Qianlang,Kotlin is on a 100% Java compatible path(join if you can't beat)As we all know, the reason why Java has been standing for so many years is because of its huge ecosystem accumulated over the years, including rich function libraries, ides, compilers, mature application ecology and so on. Kotlin can call the vast majority of Java libraries and directly use the existing Java ecosystem. Therefore, many developers choose to mix kotlin and Java.

Due to the mode of harmonious coexistence with predecessors, kotlin has now surpassed Scala and clojure to become the second most popular language on JVM, especially in the field of Android development, which has been recognized by many developers at home and abroad, and is also a very promising excellent "afterwave".

epilogue

Few of these new languages, born after the 21st century (around 2010) to replace the old ones, have succeeded in replacing the former ones. Some take advantage of the new technology in a new field has become an industry benchmark. Some in the "front waves" in the harmonious symbiosis in the development of indecency, waiting for the future counterattack. Of course, more disappeared in the long river of history, not even a ripple... Even though most of them were born in the last century, they have always been optimized for the needs of the new era, and have undergone dozens or even hundreds of many of which are completely different from the beginning.Coupled with their own rich system of function library, IDE, compiler and application ecology accumulated over the past decades, it is hard for "houlang" to catch up with them.

From the commercial point of view, when there is no subversive change in the industry structure, the existing popular language can form a monopoly by relying on the huge user base accumulated over the years. Even if there are better new languages, they can quickly absorb the excellent features of these new languages. Just like large enterprises merging small enterprises or directly copying their excellent business functions, they can make themselves better and more easily accepted by most developers. So if we want to shoot the "front wave" people on the beach in the programming language world, the "back wave" people have a long way to go.

Finally, thousands of words are put together to fill in the blank:

______The best language in the world! [manual dog head]

China IT News APP

Download China IT News APP

Please rate this news

The average score will be displayed after you score.

Post comment

Do not see clearly? Click for a new code.

User comments