Hostname: page-component-77f85d65b8-g98kq Total loading time: 0 Render date: 2026-04-18T19:29:52.888Z Has data issue: false hasContentIssue false

OCaml-Java: The Java Virtual Machine as the target of an OCaml compiler*

Published online by Cambridge University Press:  17 May 2016

XAVIER CLERC*
Affiliation:
(e-mail: xclerc@ocamljava.org)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

This article presents how the compiler from the OCaml-Java project generates Java bytecode from OCaml sources. Targeting the Java Virtual Machine (JVM) is a technological challenge, but gives access to a platform where OCaml can leverage multiple cores and access numerous libraries. We present the main design choices regarding the runtime and the various optimizations performed by the compiler that are crucial to get decent performance on a JVM. The challenge is indeed not only to generate bytecode but to generate efficient bytecode, and to provide a runtime library whose memory footprint does not impede the efficiency of the garbage collector. We focus on the strategies that differ from the original OCaml compiler, as the constraints are quite different on the JVM when compared to native code. The level of performance reached by the OCaml-Java compiler is assessed through benchmarks, comparing with both the original OCaml implementation and the Scala language.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 2016 
Submit a response

Discussions

No Discussions have been published for this article.