Home >Technology peripherals >It Industry >JVMLS 2016: A Recap of Java Virtual Machine Language Summit

JVMLS 2016: A Recap of Java Virtual Machine Language Summit

William Shakespeare
William ShakespeareOriginal
2025-02-18 10:26:10522browse

JVMLS 2016: A Recap of Java Virtual Machine Language Summit

2016 Java Virtual Machine Language Summit: Looking to the Future of JVM

The 2016 Java Virtual Machine Language Summit (JVMLS) brings together language designers and JVM engineers to discuss the future development of JVM and its impact on the Java language. The summit focused on key issues such as Project Jigsaw, Project Valhalla and the future of virtual machines.

Modular: Project Jigsaw

Project Jigsaw is a core feature of Java 9, which introduces a modular mechanism for the Java language. Developers can create modules that enable reliable configuration, powerful packaging, and improved scalability, security and performance. Java 9 will allow the creation of modules (essentially a JAR package containing the new structure - module descriptor). The module descriptor describes a module by specifying the module name, listing the required modules, and exporting packages. At runtime, a module mainly sees only the module it depends on (readability), and can only access the types (accessibility) in other modules when the module is read and the module exports a package containing that type. This means that the compiler and JVM eventually abandoned the big mud ball pattern that incorporated all code and dependencies together, and replaced it with a real map closer to our understanding of software structure. Both the compiler and the JVM understand this graph, so that missing modules, multiple versions of the same module, or multiple modules export the same packages during compilation or startup, avoiding runtime errors or subtle errors that are difficult to detect.

Value type: Project Valhalla

Project Valhalla is designed to introduce value types that can be summarized as user-defined primitive types. Value types are the same as primitive types and do not incur memory overhead or indirect addressing. A custom point containing two int fields x and y will be inlined to its usage location, requiring only the memory required for two ints, and the array of points is essentially an array of x/y pairs. Like the original type, such points are not identified - although there can be two different Integer objects with a value of 5, there cannot be two different int values ​​of 5. Like a class, a value type can have methods and fields and implement an interface. Therefore, its slogan is: "Coding like a class, working like an int". This will prevent us from having to trade off between preferred abstraction and required performance.

However, the project quickly deviated from the track. As we all know, generics do not work with primitive types - ArrayList cannot be created. This is already painful for eight primitive types (see Primitive Type Specialization for libraries like Stream or Trove), but it becomes unbearable when developers can define more types. If value types must be boxed to interact with generics (like today's primitive types), their use will be very limited and will not be started.

Therefore, we need to be able to use generics with value types—primitive types can also be used together. Ultimately, we want not only to instantiate ArrayList or ArrayList, but also to be supported by int[] or point[], respectively. This is called specialization, and it opens up a whole new puzzle.

If you are lucky, some or even all of them will be included in Java 10.

JVMLS 2016: A Recap of Java Virtual Machine Language Summit

Virtual Machine Future

John Rose talked about several directions that attract virtual machines to the future:

  • Unified model of objects, values, arrays, methods, etc.
  • Continuously improve performance, such as improving memory efficiency through increased density and sharing, and continuous optimization of hotspot paths
  • Fine-grained concurrency using fibers that transcend threads as core abstraction
  • Become more useful, compatible and interoperable – for languages ​​running on it and native languages, thus bridging the gap between them
  • Stack is concreted, where the stack holds classes and methods as real objects, not just as strings, and the full context of each frame (local variables, monitors, etc.) is visible and run The program can edit the stack

A lot of content is beyond my understanding, but listening to his speeches still benefited a lot, even if it was just to feel his passion.

Consistent with Rose's outlook spirit is Project Panama (discussed by Mikel Vidstedt and Tobi Ajila in "Going Native"), which Ian Graves supplements with "Java Vector API". Christian Wimmer's demonstration of "One Compiler" is also intended to bridge the gap.

Summary

JVM is a powerful tool that many smart people are working to make it stronger while controlling its complexity.

FAQs about the 2016 JVM Language Summit (This part is the same as the original text, omitted)

The above is the detailed content of JVMLS 2016: A Recap of Java Virtual Machine Language Summit. 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