Joey Hess: a bitter pill for Microsoft Copilot

Joey Hess — one very proficient Haskell hacker (he wrote git-annex and scroll) — deployed a trick to confuse Copilot. The trick takes advantage of Haskell extensions.

Link to the full article.

I know zero about Copilot, but I found it amusing that extensions could be (ab)used in such a way.


Pick an extension and add code that loops when it’s not enabled. Or when it is enabled. Or when the wrong combination of extensions are enabled.

Besides being a dig at Copilot, this is also (justified) dig at GHC Haskell.

Language extensions are not inherently bad, but having existing code in a module cease to compile (or *shudder* change runtime behavior) when an extension is switched on is bad. Not all extensions have this problem, but some very popular ones (like OverloadedStrings) do.

Sometimes Haskell is criticized for being 2^number_of_extensions different languages. This is generally overblown, but weird interactions between extensions make it a bit more true.


[…] this is also a (justified) dig at GHC Haskell.

Sarcasm mode: Active

…but haven’t you heard: Glasgol GHC 2021 has been “released” - the “most common” extensions will be enabled by default! Why bother with language standards when there’s only one mainstream implementation?

Sarcasm mode: Offline

  • There used to be one mainstream F/OSS C compiler - gcc;
    then clang arrived…

  • …now there’s an organised effort underway to add Rust to the pantheon of languages supported by GCC (the compiler collection) - traits and all!

  • After they’ve sharpened their claws on Rust, could another single-implementation language (with certain similarities to Rust) draw the attention of this or another group of GCC developers?

Only time will tell…

1 Like

The full extent of GHC Haskell abuse:

1 Like