[Haskell-cafe] Idiomatic way to parse bytecodes

Gautier DI FOLCO gautier.difolco at gmail.com
Sat Aug 29 23:12:03 UTC 2015


Hello all,

I have some bytecodes to parse and I look for the most idiomatic way to do
it.
It's mostly JVM Bytecode, long story short, I have some embedded JVM
Bytecodes:
 * 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
on.

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150830/dda0b88a/attachment.html>


More information about the Haskell-Cafe mailing list