A reimplementation of the Bollingbroke & Peyton-Jones (2010) compiler for the F-liter language in an attempt to understand it better. Currently packaged as a library and as is.
$ ghci Supercompiler λ> ex_mapmap main = let x = Nil in sc x sc x = let y = inc in let z = map y x in map y z map x y = case y of Nil -> Nil Cons z p -> let q = x z r = map x p in Cons q r inc x = let y = 1 in x + y λ> sc_wrapper ex_mapmap ("sc", lam "xs" $ fun "sc" @: "xs") ...
It will supercompile the function
sc of program
ex_mapmap with an
Extra debug features
To aid debugging, the
Debug.RocketFuel library prematurely
terminates supercompilation when a predetermined "fuel" supply
is depleted. This a very unsafe implementation of the concept
introduced in Whalley's (1994) Automatic isolation of compiler
By default, the fuel tank is infinite (i.e.
fuelTankis a global variable.
disableTankcreates infinite fuel.
fillTank ncreates a finite pool of
nunits of fuel.
consumeFuel empty fullwill consume 1 unit of fuel. If the tank is depleted, it returns
readTankreturns the fuel tank value.