Peter Landin, who has died aged 78 of prostate cancer, was a complex character: a political radical, a gay-rights campaigner and an outstanding academic computer scientist. With a burst of creativity in the 1950s and 60s, he laid the foundations for the software that runs the laptops, desktops PCs and the internet of today.

In the early days of computing, software written for one make of machine would not run on any other. Computer scientists wanted to define "programming languages" that could be universally understood. That this is normal today – the software of the internet, for example, can run on every kind of computer – is a consequence of Peter's insight that the meaning of a computer program could be pinpointed in mathematical logic and liberated from the control of the manufacturer.

His impulses were always anarchic and subversive: his work started, literally, underground. He was the leading light in a discussion group – run by the late, eccentric Mervyn Pragnell – unofficially housed in the basement of Birkbeck College, London, where Pragnell knew a lab technician who would unlock the door. Pragnell prowled bookshops spotting people who were buying books on mathematical logic and would invite them to join his group. Many leading computer scientists started their careers there.

Peter's ideas were famously presented with humour. The first programming languages had robotic names like Fortran and Snobol: when he first showed a programming language with a logical definition, he called it ISWIM, for "If You See What I Mean". That joke was a genuine technical breakthrough and the root of many subsequent developments, down to the Java and Javascript applications that now run the pages of the world wide web.

An only child born in Sheffield, Peter was the son of an accountant father who had been disabled in the first world war. Peter went to King Edward VII school in the city. During national service he amused himself by trying to drill a squad to imitate addition in binary arithmetic. At Clare College, Cambridge, he completed the mathematics degree in two years, then attempted the very difficult master's-level part three, but came away with a third-class degree.

After marriage to Hanne in 1960, spells as a programmer in London, as a researcher in New York and as an academic at the Massachusetts Institute of Technology, he returned in 1967 to Britain, to a chair at Queen Mary College in London, where he remained for the rest of his academic career, latterly as emeritus professor of theoretical computation. He taught enthusiastically, to both students and the colleagues who worked, in effect, as his research assistants, and the influence of his ideas continued to spread, but increasingly he lost interest in the direction of computer science.

In any case, computing was never all of his life. He was a radical in politics, a regular protester, and was arrested while on a demonstration with the Committee of 100, the 1960s anti-war group founded by Bertrand Russell.

Peter was also an accomplished musician, and he would often end technical seminars by playing piano duets. But, characteristically, he was interested in understanding rather than performance: each new piece was a challenge to be surmounted then surpassed.

Always bisexual, he threw himself into the politics of the Gay Liberation Front in the early 1970s. He separated amicably from his wife in 1973, and was closely in touch with her and his children till his death. For the rest of his life he pursued gay politics, and his house in Rona Road, Camden, became a gay commune. Always more of a facilitator than an activist, he saw many plots hatched at his dinner parties. Aids: the Musical! was conceived there, as was the reinvigoration of Gay Pride marches in the mid-80s, just in time for the battle over Clause 28.

Towards the end of his life, Peter became convinced that computing had been a bad idea, giving support to profit-taking corporate interests and a surveillance state, and that he had wasted his energies in promoting it. But whether he liked it or not, his ideas underpin developments to this day.

He is survived by Hanne and his children, Daniel and Louise.

• Peter John Landin, computer scientist, academic and gay rights campaigner, born 5 June 1930; died 3 June 2009