antonlogvinenko/javelin

JVM implementation in Haskell

Haskell

44

544 commits

updated Sep 15, 2024

See the code

README

Javelin

JVM SE8 implementation in Haskell

Usage:

  • Display class contents in relatively human readable form (no constant pool, only symlinks)

      stack exec javelin disasmSemantics acceptance/TreeMultimapNaturalTest.class
    
  • Disassemler

      stack exec javelin disasm acceptance/TreeMultimapNaturalTest.class
    

See result here

  • Disassembler with traced references to constant pool

      stack exec javelin disasmFull acceptance/TreeMultimapNaturalTest.class
    

See result here

  • Bytecode statistics

      stack exec javelin stats acceptance/ [output.textile]
    

Examples: Guava opcodes statistics, Java 8 standard library (rt.jar) statistics

  • Parsing classpath, traversing it and loading class bytes

      stack exec javelin classpath "./sample-classpath/" "com/google/common/collect/Lists"
    
  • Loading class with all dependencies

      stack exec javelin loadClass "./sample-classpath/" "com/google/common/collect/Lists"
    

Roadmap:

  • Phase I, Reconnaissance. Provide the most basic implementation of every level (loading, resolution, init, runtime structures, command execution, etc). These implementations may skip some essential functionality, but will make it possible to execute JVM bytecode. Implementations don't contradict spec, but do not reflect all spec requirements.

    • initialization
    • execution of commands
    • establish min integration testing
    • use case: sum of two numbers and println result
    • printing Runtime readable: most important in its contents
  • Phase II. Implement stuff that was left out in phase I, but still skip parts of spec that are not of any interest to the author (for now)

    • all instructions
    • exceptions, monitor locks
    • resolution: interface methods, etc
    • constraints in loading
    • access rights in linking
    • custom class loaders
  • Phase III, either implement skipped JVM features, or make some kind of product out of this codebase. I have some ideas.

Contributors

antonlogvinenko

544 commits

antonlogvinenko/javelin

JVM implementation in Haskell

Haskell

44

544 commits

updated Sep 15, 2024

See the code

README

Javelin

JVM SE8 implementation in Haskell

Usage:

  • Display class contents in relatively human readable form (no constant pool, only symlinks)

      stack exec javelin disasmSemantics acceptance/TreeMultimapNaturalTest.class
    
  • Disassemler

      stack exec javelin disasm acceptance/TreeMultimapNaturalTest.class
    

See result here

  • Disassembler with traced references to constant pool

      stack exec javelin disasmFull acceptance/TreeMultimapNaturalTest.class
    

See result here

  • Bytecode statistics

      stack exec javelin stats acceptance/ [output.textile]
    

Examples: Guava opcodes statistics, Java 8 standard library (rt.jar) statistics

  • Parsing classpath, traversing it and loading class bytes

      stack exec javelin classpath "./sample-classpath/" "com/google/common/collect/Lists"
    
  • Loading class with all dependencies

      stack exec javelin loadClass "./sample-classpath/" "com/google/common/collect/Lists"
    

Roadmap:

  • Phase I, Reconnaissance. Provide the most basic implementation of every level (loading, resolution, init, runtime structures, command execution, etc). These implementations may skip some essential functionality, but will make it possible to execute JVM bytecode. Implementations don't contradict spec, but do not reflect all spec requirements.

    • initialization
    • execution of commands
    • establish min integration testing
    • use case: sum of two numbers and println result
    • printing Runtime readable: most important in its contents
  • Phase II. Implement stuff that was left out in phase I, but still skip parts of spec that are not of any interest to the author (for now)

    • all instructions
    • exceptions, monitor locks
    • resolution: interface methods, etc
    • constraints in loading
    • access rights in linking
    • custom class loaders
  • Phase III, either implement skipped JVM features, or make some kind of product out of this codebase. I have some ideas.

Contributors

antonlogvinenko

544 commits

Languages

Haskell

68.1%

HTML

28.9%

Java

3.0%