Skip to content

Instantly share code, notes, and snippets.

@joshcough
Created May 25, 2015 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshcough/12893c23f437901cce4a to your computer and use it in GitHub Desktop.
Save joshcough/12893c23f437901cce4a to your computer and use it in GitHub Desktop.
OLD:
-- native execution
compileAndRunNative ::
Language i o ->
CompilationOptions ->
FilePath -> --the original input file, also serves as the program name
i ->
IO (Val Output)
compileAndRunNative l@(Language _ _ _ _ subLang) opts inputFile input = do
code <- compileAndWriteResult l opts inputFile input
munge (recur subLang) code where
recur Nothing _ = return <$> runSFileNative sFile (sFile^.directory) where
sFile = inputFile & extension .~ (outputExtension l) & directory .~ (getOutputDirOrElse opts inputFile)
recur (Just sub) code = compileAndRunNative sub opts inputFile code
NEW:
compileAndRunNativeT ::
Compiler i X86 ->
CompilationOptions ->
FilePath -> --the original input file, also serves as the program name
i ->
IO (Val Output)
compileAndRunNativeT c opts inputFile input = do
x86 <- compileAndWriteResultT c opts inputFile input
return <$> runSFileNative sFile (sFile^.directory) where
sFile = inputFile & extension .~ (extT c) & directory .~ (getOutputDirOrElse opts inputFile)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment