I noticed that GHC (a widely-used Haskell compiler) has a test suite written in Python, not in Haskell (as I would naively expect). What is the history of this? Are there particular advantages to writing the test suite in a different language?

edit: Per a suggestion in the comments, I asked this in /r/haskell. It has now generated three answers, which I've quoted below:

tathougies said:

The test suite driver seems to be written in Python. Python is a good high-level scripting language. It's like asking 'why does GHC use Make instead of haskell'? Probably because make is better at running shell programs with external dependency resolution built-in. The tests themselves seem to be written in Haskell, verifying certain properties of the compiler and catching regressions. If they fail, it looks like the python driver is informed, and then would report the error to the user.

phadej added:

FWIW GHC's built system is being rewritten to use shake: the Haskell library.

eacameron said: