Harpy
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Description
Harpy is a library for run-time x86 code generation in Haskell programs. Harpy requires several Haskell extensions and GHC-specific features (Template Haskell, multi-parameter type classes and monad transformers). It is available from Hackage
Limitations
- 64-bit mode is not supported
- MMX, SSE, SSE2 and SSE3 instructions and registers are not supported.
- The disassembler supports (in principle) 64-bit mode and SSE instructions, but this has not been tested.
- Buffer overflow checks have to be done manually with checkBufferSize or ensureBufferSize
Tutorials
- Writing x86 code generators with Harpy:
- Harpy: Run-time Code Generation in Haskell (PDF), describing a fast factorial function
- A fast factorial function (literate Haskell source code)
- Run-time compiler for call-by-value lambda calculus (literate Haskell source code)
- Generating x86 assembly
- Compiling a DSL to x86 assembly
- Disassembling x86
- Generating more code with Harpy