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.Buildermonads - This class is analysed using code in the
JVM.Data.HLAnalysemodules - 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.Convertmodule - The low level format is converted to a
ByteStringusing theJVM.Data.Rawmodules, which can be written to a file. or used in a JVM.