H2JVM (Haskell to JVM) is a high level library for writing JVM bytecode in Haskell. It handles the messy details such as jump offsets, stack map frames, and more.
H2JVM does its processing in a pipeline:
- The user writes a class as a
JVM.Data.Abstract.ClassFile
, potentially using theJVM.Data.Abstract.Builder
monads - This class is analysed using code in the
JVM.Data.HLAnalyse
modules - calculating jump offsets, etc. This stage may also do some optimisations, such as removing dead code. - The class is converted to a low level format (
JVM.Data.Raw
) using theJVM.Data.Convert
module - The low level format is converted to a
ByteString
using theJVM.Data.Raw
modules, which can be written to a file. or used in a JVM.