# Min-Max GHC command line error bytes to bytes of source code

GHC command line errors can be horrible, lets make them as bad as possible. To disincentivize very long programs use the following formula to calculate your "score".

(# of bytes of GHC output) / 2^(8 + # of bytes of code)


Template Haskell is banned as there is probably a TH configuration where you can replicate an error f(n) times where f is an arbitrary fast growing computable function. CPP and GHC options are banned for similar reasons.

GHC output should be computed using this release of GHC 8.6.3.

To calculate the bytes of GHC output run:

ghc -hide-all-packages -package base Main.hs |& wc -c


The following is an example submission:

main = print (1 + True)


Error:

[1 of 1] Compiling Main             ( Main.hs, Main.o )

Main.hs:1:15: error:
• No instance for (Num Bool) arising from a use of ‘+’
• In the first argument of ‘print’, namely ‘(1 + True)’
In the expression: print (1 + True)
In an equation for ‘main’: main = print (1 + True)
|
1 | main = print (1 + True)
|               ^^^^^^^^


Score:

375 / 2^(8 + 24) = 0.0000000873114914


Submissions must contain the code and the score. Highest score wins.

• Related. I suspect an answer inspired from there could be quite competitive. And probably (I'm pretty confident) could have an unbounded score – H.PWiz Jan 3 '19 at 1:24
• yep – ASCII-only Jan 3 '19 at 1:38
• 2.9MB already – ASCII-only Jan 3 '19 at 1:40
• I recommend looking into busy-beaver challenges. In particular, for these kinds of challenges, I often recommend a maximum length, and a requirement that the program must eventually halt. – Nathan Merrill Jan 3 '19 at 2:33
• The plus 8 doesn’t do anything except uniformly divide all scores by 256. I think it’s going to be hard to find something that isn’t totally arbitrary and doesn’t strongly favor either the empty program or programs compiling with too many errors to fit in the visible universe. Maybe the challenge should be to find the shortest program that produces at least (say) 1000000 bytes of errors? – Anders Kaseorg Jan 3 '19 at 9:40