jvm-binary: A library for reading Java class-files

[ java, jvm, language, library, mit ] [ Propose Tags ]

A library for reading Java class-files.

[Skip to Readme]
Versions 0.0.1, 0.0.2, 0.1.0
Change log CHANGELOG.md
Dependencies attoparsec, base (>=4.9 && <4.11), binary, bytestring, containers, data-binary-ieee754, deepseq (>=, deriving-compat, mtl, template-haskell, text, vector [details]
License MIT
Author Christian Gram Kalhauge
Maintainer Christian Gram Kalhauge <kalhauge@cs.ucla.edu>
Category Language, Java, JVM
Home page https://github.com/ucla-pls/jvm-binary#readme
Bug tracker https://github.com/ucla-pls/jvm-binary/issues
Source repo head: git clone https://github.com/ucla-pls/jvm-binary
Uploaded by kalhauge at Mon Jun 18 10:05:07 UTC 2018
Distributions NixOS:0.1.0
Downloads 481 total (12 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-06-18 [all 1 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for jvm-binary-0.1.0

[back to package description]


A library for reading and writing Java class-files. To get started importing the Language.JVM file should be sufficient for most uses.

If you want to access Code elements of methods it is recommended to import Language.JVM.Attribute.Code qualified, like this:

import           Language.JVM
import qualified Language.JVM.Attribute.Code as Code

import qualified Data.ByteString.Lazy as BL

main :: IO ()
main = 
  ecfl <- readClassFile <$> BL.readFile "test/data/project/Main.class" 
  case ecfl of 
    Right clf -> do
      print (cThisClass clf)
      print (cSuperClass clf)
    Left msg -> 
      print msg


There are two stages in the current state of the repository. Low is closer to the class-file, while the High stage is easier to work with. The reason that we have the two stages is that the class-file representation has indices into the Constant Pool. The High stage eliminates all these problems.


  • Add more Attributes as to the docs.
  • Add documentation for Code
  • Setup regular benchmarks


Use stack to build, test, and benchmark.