H2JVM – A Haskell Library for Writing JVM Bytecode
2 days ago
- #Haskell
- #JVM
- #bytecode-generation
- A new Haskell library for writing JVM bytecode in a high-level way, simplifying tasks like StackMapTable analysis and label/offset resolution.
- Designed for compilers targeting the JVM, allowing them to focus on code generation while handling low-level bytecode details automatically.
- Example shown generates a simple class 'Calculator' with a static method 'add' that adds two integers.
- Demonstrates label resolution with a real example implementing the 'greater than' operator, producing correct JVM bytecode offsets.
- The library is in early development, supporting a limited set of instructions and attributes, and feedback on design is sought.
- GitHub repository is available for further exploration and contributions.