gibbon-0.3: A compiler for operating on serialized data
Safe HaskellSafe-Inferred
LanguageHaskell2010

Gibbon.Compiler

Description

The compiler pipeline, assembled from several passes.

Synopsis

Compiler entrypoints

compile :: Config -> FilePath -> IO () Source #

Compiler entrypoint, given a full configuration and a list of files to process, do the thing.

compileCmd :: [String] -> IO () Source #

Command line version of the compiler entrypoint. Parses command line arguments given as string inputs. This also allows us to run conveniently from within GHCI. For example:

 compileCmd $ words $ " -r -p -v5 examples/test11c_funrec.gib "

Configuration options and parsing

data Config Source #

Overall configuration of the compiler, as determined by command line arguments and possible environment variables.

Constructors

Config 

Fields

Instances

Instances details
Read Config Source # 
Instance details

Defined in Gibbon.Common

Show Config Source # 
Instance details

Defined in Gibbon.Common

Eq Config Source # 
Instance details

Defined in Gibbon.Common

Ord Config Source # 
Instance details

Defined in Gibbon.Common

MonadReader Config PassM Source # 
Instance details

Defined in Gibbon.Common

Methods

ask :: PassM Config Source #

local :: (Config -> Config) -> PassM a -> PassM a Source #

reader :: (Config -> a) -> PassM a Source #

data Mode Source #

How far to run the compiler/interpreter.

Constructors

ToParse

Parse and then stop

ToC

Compile to C

ToExe

Compile to C then build a binary.

RunExe

Compile to executable then run.

Interp2

Interp late in the compiler pipeline.

Interp1

Interp early.

ToMPL

Compile to SML (mlton dialect)

ToMPLExe

Compile to SML & compile with MPL

RunMPL

Compile to SML & compile with MPL & run

Bench Var

Benchmark a particular function applied to the packed data within an input file.

BenchInput FilePath

Hardcode the input file to the benchmark in the C code.

Instances

Instances details
Read Mode Source # 
Instance details

Defined in Gibbon.Common

Show Mode Source # 
Instance details

Defined in Gibbon.Common

Eq Mode Source # 
Instance details

Defined in Gibbon.Common

Methods

(==) :: Mode -> Mode -> Bool Source #

(/=) :: Mode -> Mode -> Bool Source #

Ord Mode Source # 
Instance details

Defined in Gibbon.Common

data Input Source #

What input format to expect on disk.

Constructors

Haskell 
SExpr 
Unspecified 

Instances

Instances details
Bounded Input Source # 
Instance details

Defined in Gibbon.Common

Enum Input Source # 
Instance details

Defined in Gibbon.Common

Read Input Source # 
Instance details

Defined in Gibbon.Common

Show Input Source # 
Instance details

Defined in Gibbon.Common

Eq Input Source # 
Instance details

Defined in Gibbon.Common

Methods

(==) :: Input -> Input -> Bool Source #

(/=) :: Input -> Input -> Bool Source #

Ord Input Source # 
Instance details

Defined in Gibbon.Common

configWithArgs :: Parser (Config, [FilePath]) Source #

Parse configuration as well as file arguments.

Some other helper fns

compileAndRunExe :: Config -> FilePath -> IO String Source #

Compile and run the generated code if appropriate