Tuesday, August 09, 2022

Jacobin JVM At The 1-year Mark

 After 12 months, Jacobin, the more than minimalist JVM written in Go, has come quite far. Presently, it can execute simple Java classes and JARs and can do several interesting things, described shortly. The source code, which is available under the Mozilla open source licence and housed on GitHub, contains several sample Java classes that demonstrate the kinds of classes Jacobin can execute accurately and quickly.

Jacobin responds to most of the options listed in java -help, including supporting a range of verbosity options that can log considerable data to the console as the program is running. For a huge amount of output, use -verbose:finest switch. You can even do instruction-level tracing with the -trace:inst command-line switch.

Jacobin is a single executable with no dependencies. It requires only a JDK distribution on the local machine. Any JDK through Java 17 will work.

Under the covers, Jacobin—like OpenJDK-based JVMs—loads some 1,400 classes in the background. These comprise all the basic classes of the Java distribution. The class loaders in Jacobin perform a detailed parse and format-check of the app classes, with linking and preparation done on-the-fly at execution time.

What’s Next?

The team of Spencer Uresk (@suresk) and Andrew Binstock (@platypusguy) are working primarily in the following areas: completion of the bytecode interpreter (mostly to be completed by Andrew) and designing and developing an observability client, mostly by Spencer. (Observability is the ability to see what’s happening inside the JVM.) The README page on GitHub gives the current status of the various subsystems under development.

By the Numbers

After one year, the Jacobin codebase consists of 21,051 lines (including comments and blank lines). Of those, 14,499 lines make up 291 tests, meaning that the testing code is presently 2.21x the size of the production code. We strive to increase that multiple. The unit tests cover 72% of the production code, while the integration tests cover even more.

This deep commitment to testing is crucial to advancing the project. To move beyond running just the simplest of classes, Jacobin must adopt a lot of the inner complexity of the JVM. Debugging the interactions of many interlocking parts is nobody’s idea of fun. So, for our own peace of mind, we invest heavily in making sure that the code we write works exactly as we expect. And, of course, this also leads to a good user experience.

Easy Things You Can Do to Help

While Jacobin is still in pre-alpha mode, if you choose to build it or run one of the posted executables on GitHub, we’d love your feedback. We respond quickly to any and all feedback and questions. If, instead, you’d just like to show your support for the project, we'd love a star on GitHub. Knowing people are interested in Jacobin really helps keep our motivation and spirits high. If you're on Twitter, please follow our handle (@jacobin_jvm) to keep abreast of what we’re doing.

Thank you for your interest. Onward to year 2!