diff options
author | Camil Staps | 2018-12-24 00:02:35 +0100 |
---|---|---|
committer | Camil Staps | 2018-12-24 00:05:35 +0100 |
commit | 60dc2fefdfe2e311c656a3a3e9c6260f06d889ff (patch) | |
tree | c02f839b0d86c682c7f90c72c81d241f241dff27 /sjit.icl | |
parent | Initial commit (diff) |
Nicer output, add CI
Diffstat (limited to 'sjit.icl')
-rw-r--r-- | sjit.icl | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -3,8 +3,10 @@ module sjit import StdEnv import StdGeneric import StdMaybe + from Data.Func import mapSt, $ from Data.Map import :: Map(..), get, put, newMap, fromList +import System.CommandLine import code from "sjit_c." @@ -169,7 +171,19 @@ where ccall jit "A:I" } -Start = (exec prog, jit prog) +import Text.GenPrint +derive gPrint Instr + +Start w +# (io,w) = stdio w +# io = io <<< "Program: " <<< printToString prog <<< "\n" +# io = io <<< "Interpreted result: " <<< interpreted_result <<< "\n" +# io = io <<< "JIT-compiled result: " <<< jit_compiled_result <<< "\n" +# (_,w) = fclose io w += setReturnCode (if (interpreted_result==jit_compiled_result) 0 1) w +where + interpreted_result = exec prog + jit_compiled_result = jit prog prog =: compile [ {fun_name="id", fun_expr=Abstr ["x"] (Var "x")} |