你好!欢迎来到深圳市品慧电子有限公司!
语言
当前位置:首页 >> 技术中心 >> 传感技术 >> Li Sanhong from Alibaba Cloud: Sustainability Should Be Considered When Upgrading Java 原创

Li Sanhong from Alibaba Cloud: Sustainability Should Be Considered When Upgrading Java 原创



【This interview is part of 51CTO's T·Front series, which features in-depth discussions with senior architects, business leaders, and experts to provide a comprehensive overview of technical practices and trends to advance the development of cutting-edge technologies.】

It has been 30 years since Java's predecessor Oka was introduced. A revolutionary programming language, Java, was created by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sheridan to make it portable (cross-platform). In the days following the advent of Java, Bill Joy, Arthur van Hoff and a number of other contributors have brought infinite possibilities to the Internet world.

Currently, Java's stability, scalability, and security of performance have made it very popular across numerous industries. Despite this, 30 years later, due to the emergence of other programming languages such as Python, Go, Ruby, and Rust, Java is often criticized for being slow, lacking flexibility, and having a high level of abstraction.

In the world of software development, Java seems to be ubiquitous. It is familiar to developers worldwide but can also be confusing in real applications. As a result, questions will remain regarding its future development directions, such as how this language will evolve in the cloud-native era and how we will view the competitive landscape between various programming languages.

During the session "Languages, Platforms and Trends" in the Core Java Week 2022, the technical community had an opportunity to learn more about modern Java practices and how they have evolved in the cloud-native era.

In this article, 51CTO and the Huazhang Branch of China Machine Press conducted an interview with the chairman of the conference, Mr. Li Sanhong, a Java Champion and the head of the programming language and compiler team at Alibaba Cloud, to discuss new features of Java, the development of OpenJDK in China, and the future of the development of programming languages.



The driving force of Java's development

Q: Mr. Li, could you please briefly introduce yourself to our readers?

A: I am currently the head of the programming language and compiler team at Alibaba Cloud. Specifically, our team works on the needs of Alibaba and its affiliate Ant Group in the areas of cloud computing, developing new technologies, and introducing new hardware. Aside from that, we also conduct research and development in compilers, language runtimes, etc. Presently, the language toolchain consists of several products such as Alibaba Dragonwell (Java) and Alibaba LLVM (C++) to support our business. A significant portion of my job responsibilities involves runtimes and compilers.


Q: What made you pursue Java as your research area of interest, and how does Java differ from other programming languages?

A: It was a fortuitous choice. When I was a student at college, I noticed that Java was the primary programming language used for most enterprise computing scenarios. In 1997, James Gosling, the father of Java, published an article in Computer entitled "The Feel of Java". In this article, he discussed something like architecture neutral, object-oriented, distributed objects, and other essential features that have laid the foundation for Java's development. Different conclusions may be drawn regarding the language's strengths and characteristics depending on the comparison perspective taken.

In terms of the software delivery cycle, Java still exhibits significant advantages. Based on Conway's Law theory, best practices of microservices can significantly improve the parallel R & D efficiency of various teams in a large and complex organization.

Java provides Metaprogramming support that is development-friendly and framework-oriented,which is an important contributor to the success of many Java frameworks. Microservices-oriented technology systems can be rapidly built using Java open source frameworks based on the diversity of the Java stack.

Java provides a wealth of technical tools during the operation and maintenance phase of the software, including JFR (low-overhead JVM profiling technology), BCI (Bytecode Instrument), JMX, and several other monitoring and probing technologies that significantly improve the online Java applications, especially the observability of large-scale cluster deployment. Furthermore, a large number of Java performance diagnosis and problem-solving tools, such as J*(jstack, jmap), Eclipse MAT/JIFA, VisualVM, JConsole, Java Mission Control, can assist developers in diagnosing and resolving problems encountered in production.



Upgrading to a new version: considerations for sustainability and stability

Q: What advice do you have for upgrading Java, especially for enterprises?

A: First, let us take a look at some of the Java versions. During Oracle Code One (formerly JavaOne) 2018, an important change was announced in the Java release model: there will be a new release every six months and LTS (Long-term support) versions every two years (Oracle announced last year that the LTS period would be reduced from three years to two years).

For security and stability reasons, it is ideal for an application to keep up with the latest version of Java, which I am afraid is not feasible for most organizations. Upgrades to software, especially in underlying systems, test an organization's agility.

It is necessary to have sufficient capabilities for this to be achieved, such as ensuring the Java Infrastructure in the enterprise is unified and tightly controlled, supporting grayscale testing of different software versions, performing effective pre-release testing to overcome incompatibility issues, and providing support tools for developers to automate stages of the upgrade process.

I want to introduce an open-source tool from Alibaba that would assist with Java upgrades: Eclipse Migration Tool for Java (EMT4J), a project that is currently being incubated under Eclipse Adoptium. Our goal is to incorporate Alibaba's years of expertise in upgrading Java on a large scale into this tool to assist Java community users in adopting new versions as quickly as possible.


Q: In your opinion, why are developers reluctant to upgrade Java?

A: Indeed, it often takes a long time for the upgrade to reach all users. It has been almost four years since Java 11 (OpenJDK11) was released, and as far as I am aware, most users in China are still using Java 8. Alibaba has already migrated to Java 11 on a large scale, and some will migrate directly from Java 8 to Java 17.

A lack of motivation may be due to various factors, the most direct reason being that the upgrade will lead to some compatibility issues and resulting stability issues, which will have an adverse effect on business continuity. The purpose of open-sourcing EMT4J is to facilitate the process of upgrading Java applications through the automation of tools that assist Java applications in seamlessly upgrading to the latest version of the JDK. In its current state, EMT4J primarily supports the upgrade from Java 8 to Java 11 and Java 17.

About the topic of the upgrade, we can discuss it from another perspective: software sustainability. Titus Winter, the library lead for Google's C++ codebase, discusses the concept of Codebase Sustainability of organization in his book "Software Engineering at Google : Lessons Learned from Programming Over Time". There are two main points to this idea: first, your software code should be able to make all the adjustments you need, regardless of whether they are technical or business requirements. second, these changes will not harm the health and security of your code.

It is recommended that Java architects take the Software Sustainability into account when upgrading the langugage, as well as apply relevant constraints to code development specifications, such as having your code not rely on undisclosed APIs within the JDK (through reflection), making sure your implementation does not depend on a specific version of the JDK, etc.

A desirable architecture would enable Java applications to be seamlessly upgraded to a non-JDK version (sustainability) based on actual needs, not as little as possible (stability concerns).


Q: In September 2021, Java 17 was released as an LTS version; we also noted that the 12th edition of "Core Java" was published recently based on Java 17. Do you have any suggestions about what to read about the book?

A: The 12th edition of "Core Java" continues the excellent tradition of previous ones by updating the book with the latest LTS release of Java. This book provides a comprehensive introduction to the latest features of Java 17 and helps developers understand the principles and details involved in designing and implementing Java software.


Q: Based on the current Java features and development direction, do you believe it can solve the current business challenges facing developers?

A: In 2019, two Turing Award winners John L. Hennessy and David A. Patterson presented a report in Communications of the ACM entitled "A New Golden Age for Computer Architecture" that described in detail the changes that have created this new generation of computer architecture. Computing power will slow down in the post-Moore era, and more parallel computing technologies such as multi-core, SIMD (Single Instruction, Multiple Data Streams), and heterogeneity will be employed to expand computing power.

For example, in general-purpose CPUs, the OpenJDK community's Vector API project can rely on the CPU's SIMD capability to obtain exponential improvements in computational performance. The upcoming OpenJDK 19 introduces Virtual Threads (Preview), which aims to help Java developers efficiently handle concurrency (especially for IO-intensive scenarios).

On the heterogeneity front, AMD shared the Sumatra project at JVM Language Summit 2014, which attempts to integrate JVMs and heterogeneous systems architectures; developed by The University of Manchester, TornadoVM enables Java developers to create heterogeneous-oriented parallel applications without the need to know any GPU programming languages or architectures.

In addition, the advent of the cloud-native era has led to a fundamental shift in software delivery. Take Java as an example: previously, it was the application itself that was being delivered, specifically in the form of 'jar' or 'war' delivery.

Cloud-native best practices, on the other hand, are based on microservices, containers as the basic delivery units, and K8S orchestration.

The requirements of cloud-native applications include faster startup times, per-volume resource use, elastic scaling, and observability. There is no doubt that Java is evolving in the age of cloud-native computing. Here are some examples: various features supporting container deployment have been added to OpenJDK versions (e.g., the UseContainerSupport option). As part of the effort to optimize the startup performance of Java, many innovative OpenJDK-based projects are exploring the limits of the Java technology stack, such as CRaC (Coordinated Restore at Checkpoint), Leyden, and Fast Startup Incubator Project(incubated in Eclipse Adoptium) with major contributors like Alibaba and Google.

Regarding JVM resource elasticity, Alibaba Dragonwell's ElasticHeap feature aims to solve the elasticity problem of memory resource usage in cloud computing environments. Additionally, the JFR and JFR Streaming technologies provide essential technical support for building Java-based cloud-native observable tools.


Q: What are the attitudes of Chinese vendors towards OpenJDK? In the future, how will major vendors compete on OpenJDK? For Java, IT companies, and cloud vendors, how will deep involvement in OpenJDK affect them?

A: The OpenJDK is an open-source reference implementation of Java SE that was announced at the JavaOne conference in 2006 by Sun (later acquired by Oracle). This period has witnessed a gradual opening up of the Java ecosystem, with a growing number of companies becoming members of the OpenJDK community. Alibaba signed the OCA in 2012, contributing to the development of OpenJDK. Tencent, Huawei, and Loongson are also some domestic companies actively participating in this community. It is good to see more vendors involved in collaborative efforts to build a healthy and sustainable Java community, which is what a healthy technology community wants.


Q: In the Core Java Week 2022, we noticed that Java is evolving in a new direction and that a closed Java deployment model and virtual machines are transforming in the cloud-native era. What is your perspective on the trend in programming languages? How is the situation at the moment?

A: The FORTRAN team led by John Backus of IBM introduced the first complete compiler in 1957. Fortran was also the first widely used high-level language. The most significant accomplishment in programming language compiler development over the past 60 years has been the widespread use of programming languages today, with iterations of hardware architecture around software productivity, reliability, and simplicity. In the contemporary world, programming languages have become one of the cornerstones of the ubiquitous software infrastructure that supports global commerce.

A number of topics were discussed in the Core Java Week 2022, including how to use hardware and software more effectively in the post-Moore era, where the enhancement of hardware performance has slowed down, and how to fully exploit hardware performance, as well as to explore and innovate Java runtime systems in the cloud computing era. Explorations and innovations such as these are also helpful for other programming languages to make progress.


Q: Google announced last year that Kotlin is the preferred language for Android application developers. Does this mean that Java is no longer the dominant language in Android development?

A: Regarding the Java runtime, Kotlin is a language within the JVM field. Like Scala, there is no essential difference between Kotlin and Java. Google, in 2016, announced that Android had switched from Apache Harmony-based (Google's decade-long lawsuit against Oracle over Java copyright) to OpenJDK, which the class library used by Android is based on.



There is no silver bullet in programming languages

Q: What programming languages do you think will be more successful in the future, Java, Python, C, C++, Go, or Rust? At present, which programming language is most popular? How should a developer choose one?

A: It is difficult to determine which is the most popular (the context must be taken into account). You can refer to TIOBE Index, GitHub, and other sources if you are concerned with rankings. Languages are tools for solving business problems, so choose the correct one to meet your business needs. A silver bullet does not exist in programming languages—there is not a specific programming language that is inherently better or worse than any other ones.

The simplicity of Java lies in its object-oriented programming paradigm. In contrast, the complexity of C++ (bringing more flexibility for programming) lies in the fact that it combines procedural, object-oriented, and generic-oriented programming paradigms. C++ provides a more powerful abstraction while allowing developers to make more efficient use of hardware. Choosing the appropriate programming tool based on practical requirements is essential to solving business problems.

In 1986, Fred Brooks published a classic paper entitled "No Silver Bullet-Essence and Accident in Software Engineering," which divided software complexity into Essential Complexity and Accidental Complexity. The key point is that selecting an appropriate programming tool is used to address the problem of accidental complexity in software development. Introducing more accidental complexity to choose a language (for example, due to the interests of certain groups) is putting the cart before the horse.


Q: Could you please offer any advice on the career path and technical growth of Java professionals?

A: In his book, "Making It Big in Software," James Gosling advises aspiring software developers to "Be really stubborn. A lot of these things are really easy to give up on. Whether it's organizations that you give up, or APIs, or software, a lot of times, it's too easy to give up too early."

Be persistent in what you are doing and do not give up early.


Guest Introduction

Mr. Li Sanhong is the head of the programming language and compiler team at Alibaba Cloud, who has published and holds over 20 papers/patents in the field of virtual machines. In addition to being an active member of the Java community, he is the co-leader of the GreenTea JUG (Java User Group), a Java Champion, a member of the JCP-EC and the GraalVM Project Advisory Board, as well as an Eclipse Adoptium (AdoptOpenJDK) PMC.

相关文章

    用户评论

    发评论送积分,参与就有奖励!

    发表评论

    评论内容:发表评论不能请不要超过250字;发表评论请自觉遵守互联网相关政策法规。

    深圳市品慧电子有限公司