Copyright | Justin Ethier |
---|---|
License | MIT (see LICENSE in the distribution) |
Maintainer | github.com/justinethier |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
This module contains an experimental Scheme to Haskell compiler.
The compiler performs the following transformations:
Scheme AST (LispVal) => Haskell AST (HaskAST) => Compiled Code (String)
The GHC compiler is then used to create a native executable.
At present, the focus has just been on creating a compiler that will generate correct, working code. Many optimizations could and need to be made for time and space...
- data CompOpts = CompileOptions {}
- defaultCompileOptions :: String -> CompOpts
- createAstFunc :: CompOpts -> [HaskAST] -> HaskAST
- createAstCont :: CompOpts -> String -> String -> HaskAST
- data HaskAST
- showValAST :: HaskAST -> String
- joinL :: forall a. [[a]] -> [a] -> [a]
- astToHaskellStr :: LispVal -> String
- header :: [String]
- headerImports :: [String]
- headerModule :: [String]
- initializeCompiler :: Env -> IOThrowsError [HaskAST]
- compileLisp :: Env -> String -> String -> Maybe String -> IOThrowsError [HaskAST]
- compileBlock :: String -> Maybe String -> Env -> [HaskAST] -> [LispVal] -> IOThrowsError [HaskAST]
- compileScalar :: String -> CompOpts -> IOThrowsError [HaskAST]
- compileLambdaList :: [LispVal] -> IOThrowsError String
- compile :: Env -> LispVal -> CompOpts -> IOThrowsError [HaskAST]
- mcompile :: Env -> LispVal -> CompOpts -> IOThrowsError [HaskAST]
- mfunc :: Env -> LispVal -> (Env -> LispVal -> CompOpts -> IOThrowsError [HaskAST]) -> CompOpts -> IOThrowsError [HaskAST]
- compileSpecialFormEntryPoint :: String -> String -> CompOpts -> IOThrowsError HaskAST
- compileSpecialForm :: String -> String -> CompOpts -> IOThrowsError HaskAST
- compileExpr :: Env -> LispVal -> String -> Maybe String -> IOThrowsError [HaskAST]
- compileApply :: Env -> LispVal -> CompOpts -> IOThrowsError [HaskAST]
Documentation
createAstFunc :: CompOpts -> [HaskAST] -> HaskAST Source
showValAST :: HaskAST -> String Source
astToHaskellStr :: LispVal -> String Source
headerImports :: [String] Source
headerModule :: [String] Source
initializeCompiler :: Env -> IOThrowsError [HaskAST] Source
compileLisp :: Env -> String -> String -> Maybe String -> IOThrowsError [HaskAST] Source
compileBlock :: String -> Maybe String -> Env -> [HaskAST] -> [LispVal] -> IOThrowsError [HaskAST] Source
compileScalar :: String -> CompOpts -> IOThrowsError [HaskAST] Source
mfunc :: Env -> LispVal -> (Env -> LispVal -> CompOpts -> IOThrowsError [HaskAST]) -> CompOpts -> IOThrowsError [HaskAST] Source
compileSpecialForm :: String -> String -> CompOpts -> IOThrowsError HaskAST Source
compileExpr :: Env -> LispVal -> String -> Maybe String -> IOThrowsError [HaskAST] Source
compileApply :: Env -> LispVal -> CompOpts -> IOThrowsError [HaskAST] Source
Compiles each argument to a function call, and then uses apply to call the function