hn.today

OpenLDK: Bringing the Java World into Common Lisp

atgreen.github.io6 points0 comments
Screenshot of OpenLDK: Bringing the Java World into Common Lisp

OpenLDK is a Common Lisp JIT compiler and runtime that lets Java bytecode execute inside SBCL, motivated by the need to use Java libraries directly from Lisp. Targeting JDK 25 and using OpenJDK’s runtime libraries, it turns loaded Java classes into CLOS classes, then compiles methods lazily: bytecode becomes an intermediate form and Lisp code, which SBCL compiles to native machine code on first use. This approach reuses SBCL’s compiler while preserving Java behavior such as 32-bit integer overflow. HotSpot remains the better choice for general Java performance; OpenLDK’s aim is close integration with Lisp.

That integration allows Lisp to add CLOS methods around Java methods, define classes visible to Java, and exchange collections, callbacks, and exceptions across the boundary. Syntax blocks also let Lisp expressions invoke Kotlin, Scala, Groovy, Clojure, Kawa, JScheme, and ABCL, even nesting all seven language implementations in one expression. The runtime supports substantial software, including javac, language compilers and REPLs, and Spring Boot and Quarkus applications. Its striking startup figure - about 84 milliseconds for an initialized Spring Boot application - comes from saving the running application in a Lisp image and launching that image again, not from a claim that ordinary Java startup is that fast.

Read on atgreen.github.io0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Four Months of Zig

Four Months of Zig

After four months back with Zig, Anna Liberty built a small-network client library, a typing game, and an N-body simulator, while enjoying Zig’s straightforward development experience. The experience also exposed unfinished tooling, including a built-in fuzzer that did not work, and highlighted the value of local Zig meetups. (gracefulliberty.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.