From 60dc2fefdfe2e311c656a3a3e9c6260f06d889ff Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 24 Dec 2018 00:02:35 +0100 Subject: Nicer output, add CI --- sjit.icl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'sjit.icl') diff --git a/sjit.icl b/sjit.icl index e0c1bef..8c86fc1 100644 --- a/sjit.icl +++ b/sjit.icl @@ -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")} -- cgit v1.2.3