Files
zorth/app/Main.hs

15 lines
360 B
Haskell

module Main where
import Parser
import Compiler
import System.Process
import System.IO
main :: IO ()
main = do
contents <- getContents
withFile "out.asm" WriteMode (\f -> compileZorth f $ parseZorth contents)
_ <- readProcess "nasm" ["-f", "elf64", "out.asm", "-o", "out.o"] ""
_ <- readProcess "ld" ["out.o", "-o", "a.out"] ""
return ()