“I got disillusioned with my early Trotskyism and joined the Communist Party at exactly the wrong time in the mid-1980s.” You join us as Ken MacLeod, a man once described as “the greatest living Trotskyist libertarian cyberpunk science-fiction humourist,” is recalling his political history. “I think I left in 90 or 91,” he continues, “a few months before it dissolved itself.

“The CP at that time was certainly a very interesting place to be because they were having their terminal crisis as it were. So it was certainly intellectually stimulating.”

He stops and sips his coffee, looks out through the window of the South Queensferry café where we are sitting at the looming Forth rail bridge. For a moment Scotland’s industrial past and service sector present are invisibly united in the eyesight of one of the country’s most entertaining, politically engaged futurists.

Whatever he is now – and he says he has less strong opinions these days about socialism and libertarianism than in the past – MacLeod is, with the passing of his friend Iain Banks and with apologies to the likes of Charlie Stross and Gary Gibson – Scotland’s leading science fiction writer. He has published 14 novels and his fifteenth Dissidence, the first in a sequence under the series title The Corporation Wars, is just out.

It is set in the 32nd century, contains sentient robots in revolt against their human masters and reincarnated dead soldiers fighting corporate-funded wars. Basically It’s a tasty big broth of ideas taking in virtual reality, artificial intelligence, the philosophy of law and disquisitions on military ethics. All that and a back story that riffs on a political and philosophical divide that he describes as “a kind of intensification of left and right but in a different way than we’ve had in the 20th century.”

And did I mention the Philip Larkin AI joke? Intellectually stimulating is one way of putting it.

Spend any time in MacLeod’s company and you will end up talking about big ideas. About market socialism or advances in molecular biology, or artificial intelligence and its risks. (“The motivation of such an entity would either have to be hardwired in or they would somehow be self-generated and their self-generated motivations might well have nothing to do with anything we would find attractive or interesting.”) Or maybe even the moderateness of Jeremy Corbyn’s political programme, which, MacLeod suggests, fall short of even the radicalism of 1970s Labour party policy.

There’s a playful provocation about his ideas and his fiction. In previous novels he has imagined communist mercenaries and even Presbyterian terrorists. Is he just trying to rouse a reaction? “Yes, but I do it to provoke myself more than anybody else.”

He writes science fiction, he says, because it allows him to “indulge my tendency to look at things and imagine consequences. It allows speculation, playing with ideas, exploring different possible futures for society and generally having fun.

“I’ve often wished I could write a mainstream novel. I know I’m technically perfectly capable of doing so. I’ve written novels that are set in the present for many chapters but are embedded in some sort of science fictional world. If I could only think of an idea that is interesting enough to myself to set in the present everyday world I would write it for sure.”

He came close with his last novel Descent, set in a not-so-far-into-the-future Scotland. It’s just that he couldn’t avoid putting UFOs appearing over Greenock.

“I have seen one online reviewer who said that it’s a bit of a shame that everyone will think this is another UFO conspiracy novel because it’s actually better than that. And other people who have said ‘damn, I wanted to read a UFO conspiracy book.’”

The temptation is to suggest his fascination with big-picture political and philosophical ideas can be traced back to childhood. He grew up a son of the manse on Lewis. Or one of them anyway. He was from a family of seven siblings, whose father was the Free Presbyterian minister in the parish of Uig.

Can we trace his interest in utopian thinking to that religious upbringing? “Yes, I think there’s some truth in that. You get this intense emphasis on ideas and getting your ideas right, as it were. In that sense it does something to encourage one to think about the big picture.

“It also has downsides. It’s very dogmatic, quite narrow and there’s a lot of fear of dangerous ideas corrupting you, which is not a good mental habit to take into adulthood.”

MacLeod lived on Lewis until he was around 10, when his father took his large family (MacLeod and his five brothers and sisters at the time) to a new congregation in Greenock.

This was in the mid-1960s (MacLeod was born in 1954) and it turned out to be something of a culture shock. “I was astounded to find myself in a place where nobody cared what sect you were,” he admits.

“I’d never encountered real poverty before. In Lewis at the time the least you could say was everybody was well fed. In Greenock I was shocked at the physical condition of some of the people, particularly older people. At that time you could still meet lots and lots of old people who were bow-legged because they’d had rickets in childhood. And there were children, even in quite a respectable state primary school, who were clearly not well nourished at all.”

He met Banks at school in Greenock and they bonded over science fiction. “I’m pretty sure I didn’t voluntarily read fiction other than science fiction between the ages of 13 and 22. Every science fiction writer will have heard from a taxi driver: ‘Oh, I used to read a lot of that when I was younger.’ Most people grow out of it.”

Unsurprisingly perhaps, his parents didn’t approve. “My parents were pretty disapproving of fiction in general.” And given his burgeoning interest in left-wing politics perhaps a clash was inevitable. It came during his first year at university. “My parents found out that my ideas had changed and I had not quite screwed up the courage to tell them. It was a very painful conversation, shall we say.”

Growing up in the 1960s it’s hard to imagine you could avoid the ferment of ideas of the time, though as MacLeod points out, that upheaval was going on in religious circles too, with new translations of the Bible and “what seemed the completely insane God is Dead theology. It was an exciting time.”

Still, his own thinking was taking him away from his parent’s outlook. Was his radicalism a reaction to his church upbringing? He’s not sure he’d go that far. He points out that his parents were very keen on education. But inevitably that led to disagreements. “We had arguments about evolution. Not my doing I have to say. I got young Earth creationism before it was cool.”

MacLeod studied at Glasgow University with the idea of becoming a scientist. Unfortunately he wasn’t very good at maths so he opted for biology and then zoology. He moved to London, got married, had two kids and climbed onboard a revolving carousel of clerical and temp jobs, before retraining in information technology just as the computer was becoming properly integrated into the office.

This coincided with his period in the Communist Party. By the time he left the party he was on his way back north to settle in South Queensferry. By then the idea of being a writer was front and centre.

“I didn’t take writing terribly seriously. Some time in the 1980s at some party a mutual friend of mine and Iain Banks told me Iain was getting a bit tired of hearing about all these books I was going to write some day and I thought I’d better actually write one. Iain gave me a cast-off Amstrad and the rest is history.”

Banks’s death in 2013 has, he admits, left a big absence in his life. “Certainly. And because he lived in North Queensferry and we almost coincidentally settled in South Queensferry we saw each other quite often.”

Time is a thief. It always has been. Still, it has yet to rob MacLeod of his intrinsic sanguinity. Or his mordant humour. Let’s conclude with more big picture thinking. In a world, Ken, where the dialectic is between a grasping, greedy neoliberalism and a medieval religious fascism can even science fiction writers be optimists?

“Yes,” he says before adding, “in the sense that it’s pretty futile being anything else.”

The Corporation Wars: Dissidence by Ken MacLeod is published by Orbit Books, priced £12.99