Coder Social home page Coder Social logo

jvm-binary's Introduction

jvm-binary

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

Stages

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.

Todo's

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

Developing

Use stack to build, test, and benchmark.

jvm-binary's People

Contributors

airtnp avatar kalhauge avatar nbawzl2004 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

airtnp

jvm-binary's Issues

Merge New, NewArray, and MultiNewArray into one instruction

The idea is that they all talk about the same thing creating an new reference, and they all
have the same structure. Ei. read X integers of the stack related to how deep the array is.

...
  | New (Ref ClassName r)
  | NewArray (ExactArrayType r)
  | MultiNewArray (Ref ClassName r) Word8

Suggestion Create a new, New instruction:

...
  | New (RefType r)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.