The harpy package

[Tags: bsd3, library]

The package contains the following components:


[Skip to ReadMe]

Properties

Versions0.2, 0.4, 0.4.1, 0.4.2, 0.4.3.0, 0.5.0.0, 0.6.0.0, 0.6.0.1, 0.6.0.2
Change logChangeLog.md
Dependenciesarray (>=0.3 && <1), base (==4.*), containers (>=0.3 && <1), disassembler (>=0.2.0.0), mtl (>=1 && <3), parsec (>=1 && <4), pretty (==1.*), template-haskell (==2.*) [details]
LicenseBSD3
AuthorDirk Kleeblatt <dirk.kleeblatt@gmx.de> Martin Grabmueller <martin@grabmueller.de>
Maintainermartin@grabmueller.de
StabilityExperimental
CategoryCode Generation
Home pagehttps://github.com/mgrabmueller/harpy
Bug trackerhttps://github.com/mgrabmueller/harpy/issues
Source repositoryhead: git clone https://github.com/mgrabmueller/harpy
UploadedTue May 26 15:44:52 UTC 2015 by MartinGrabmueller
DistributionsNixOS:0.6.0.2
Downloads1177 total (77 in last 30 days)
Votes
0 []
StatusDocs available [build log]
Last success reported on 2015-05-27 [all 1 reports]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for harpy-0.6.0.2

harpy - Runtime code generation for x86 machine code

Codename: Harpy - Haskell Assembler at Run-time produces Y...
  Harpy [myth.] f: die Harpyie
  http://en.wikipedia.org/wiki/Harpy

Introduction

Harpy is a library for run-time code generation in Haskell programs.

Harpy requires several Haskell extensions and GHC-specific features (the Haskell FFI, Template Haskell, multi-parameter type classes and monad transformers).

Features

The following modules are included in this package:

Harpy.CodeGenMonad: This module defines the code generator monad, which is a combined state/reader/exception monad. It contains all the necessary details for allocating and managing code buffers.

Harpy.X86CodeGen: This module contains all the functions for generating native x86 machine code. The functions are very simple, and it is necessary to specify all addressing modes etc. when emitting an instruction.

Harpy.X86Assembler: A type class based layer on top of X86CodeGen which determines the addressing modes from the types of the operands.

Harpy.X86CGCombinators: Code generation combinators for conditionals, loops, function entry/exit code etc.

Harpy.X86Disassembler: A disassembler for x86 machine code.

Harpy.Call: Exports functions for invoking the generated code.

Notes about the implementation

X86CodeGen.lhs

The file X86CodeGen.lhs is based on a header file called x86-codegen.h from the Mono distribution, which defines macros for emitting x86 machine code directly into a memory buffer. The Haskell module is a nearly one-to-one mapping from the original macros to Haskell functions. The main differences are:

Several things should be kept in mind when using this file: