WATERLOO — The story of Alan Turing, the British mathematician posthumously acknowledged as the father of both computer science and artificial intelligence, is the stuff of Hollywood melodrama.

Here was an eccentric genius many rank with Einstein and Sir Isaac Newton as a scientific giant, who cracked German military codes during the Second World War and helped turn the tide against the Nazis, and who predicted, through complex mathematical models, the smartphone universe of today.

And yet, 58 years after his death, few people outside the scientific community know he even existed.

There are two reasons for this, says Patrick Sammon, the filmmaker who documents Turing’s life in Codebreaker, an acclaimed docudrama that combines interviews with former Turing associates with archival footage and fictionalized re-enactments:

(1) His research was branded top secret by the British government, which denied him any recognition during his lifetime.

(2) Turing was gay in an era when being gay was a criminal offence.

In what sounds like the plot description of an episode of TV’s ‘60s-set Mad Men, it was this latter fact that derailed his career after a brief homosexual affair became public and Turing found himself faced with two options: go to jail or submit to a then progressive, today barbaric procedure known as chemical castration.

Turing chose the latter, a process that pumped him full of female hormones and, it has been argued, hijacked his future.

When he was found dead a few years later in 1954, a presumed suicide at 41, it was a tragic end to a life that should have been celebrated in the highest echelons of science and pop culture alike.

“It’s really one of the great tragedies of the 20th century,” insisted filmmaker Sammon, who uncovered specific details about Turing’s downfall in the course of making his film.

“We were able to identify the hormone treatment he was given — a synthetic form of estrogen. It would have caused the loss of his libido, made him impotent, grow breasts and would have affected his brain function. So here’s this genius whose mind isn’t clicking along as it had.”

One hundred years after his birth and less than three after a formal apology from the British government for its shoddy treatment, the reputation of the man named by Time Magazine as One of the 100 Most Important People of the 20th Century is ripe for a rebound.

“When I started this process two-and-a-half years ago, most people had never heard of Turing,” said Sammon. “Even those in computer science who knew of his contributions didn’t know the tragedy of his life.

“But in the last decade or so, there’s more momentum for getting the word out about him.”

Why? “Because a lot of what he predicted about computers and artificial intelligence is actually starting to happen. He envisioned machines that could think and the way that computers would be such an integral part of our lives.”

While there is debate about his exact status — is he closer to an Einstein or does he belong one tier below? — most scientists agree that without him, the computer age we enjoy today would likely not exist.

“He wrote a paper in 1936 that laid down the foundation for modern computers,” noted Sammon. “He understood that by moving around ones and zeroes, you could calculate anything.

“When you turn on your computer, pick up your smartphone or send an email, you should think about Alan Turing. He laid the intellectual foundation for our modern world.”