Yhc/API/Bytecode

From HaskellWiki
< Yhc‎ | API
Revision as of 02:40, 15 January 2006 by NeilMitchell (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

On the step towards a full API for the whole compiler, an API for just the bytecode first will probably be desirable.

There are two entirely separate lumps in this, the raw bytecode, and the wrappers that make a module file.

Module

Constructor Arity TagNo

type ConstTable = [Const]

type HufByteCode = [HufBC]


Bytecode

There are tree types of bytecode representation:

{{{

  1. !syntax haskell

data GraphNode = ... data LabeledJumps = ... }}}

Then there are the api's {{{

  1. !syntax haskell

instance Show GraphNode instance Show ByteCode instance Show ByteCodeHuf instance Show ...

graphToByteCode :: GraphNode -> ByteCode byteCodeToGraph :: ByteCode -> GraphNode byteCodeCompress :: ByteCode -> ByteCodeHuf byteCodeInflate :: ByteCodeHuf -> ByteCode

writeModule :: Module -> FilePath -> IO () readModule :: FilePath -> IO Module

-- do memory and zapping analysis memAnalysis :: a -> a

-- peep hole optimisations peephole :: a -> a }}}