[Haskell-cafe] Idiomatic way to parse bytecodes
will.yager at gmail.com
Sun Aug 30 00:22:01 UTC 2015
Based on what you've said, I would define a Serial or Binary instance for
single bytecodes, and then use this to write a function :: ByteString ->
Then, you can convert raw JVM bytecode into some convenient Haskell data,
and then do whatever processing you want to this.
On Sat, Aug 29, 2015 at 6:12 PM, Gautier DI FOLCO <gautier.difolco at gmail.com
> Hello all,
> I have some bytecodes to parse and I look for the most idiomatic way to do
> It's mostly JVM Bytecode, long story short, I have some embedded JVM
> * one part is specification-defined, from 0x00 to 0xB8, differ from the
> regular JVM Bytecode
> * and the other part is proprietary and changes often
> I have two main goals:
> * print the signification of each bytecodes (a more explicit one than the
> hexadecimal value of the bytecode)
> * Do some analysis on it, spot patterns, apply markov model on it and so
> The issue with JVM Bytecode in general is that each bytecode hasn't been
> made equal. Some of them requires parameters, some of them modify the
> length of the next bytecode, etc.
> I'm not looking for a way to parse bytecode quickly, or for a library
> doing it for me.
> I look for a simple/composable/idiomatic way to do it.
> So if you have any thoughts, papers, articles or even code snippets (part
> of a library of not) that is done in the Haskell-way, please, share it :)
> Thanks in advance for your help.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe