The whole world knows Roald Dahl as the creator of Charlie and the Chocolate Factory, Matilda and the unspeakably disgusting Twits. His characters are marked by a wickedly mocking view of the adult world (a sine qua non for any children’s writer of worth), an imagination that knows no rules and at times a distinct whiff of cruelly funny misanthropy.

In his letters home to his mother, argues Donald Sturrock in the introduction to this entertaining and eye-opening collection, we see Dahl’s talent being born. Her only son, Dahl began to write letters in 1925, at the age of nine, from prep school; they continued until two years before his mother’s death in 1967. He was a born entertainer, a writer without realising it, and he wrote with that jaunty cheerfulness, come what may, which often marked the generation who lived through the horrors of the Second World War.

His mother’s letters to him, sadly, have not survived. Sofie Magdalene Dahl was born in Oslo in 1884 to ‘solid middle-class parents’, says Sturrock: her father worked for the Norwegian Public Service Pension Fund. On her mother’s side, though, she was descended from William Wallace, so memorably depicted on screen by Mel Gibson as a Scottish football hooligan with hair extensions. She adored her Boy and was pragmatic, unsentimental and evidently completely unshockable. ‘Dauntless’ was how her son described her in his memoir Boy and ‘undoubtedly the primary influence on my own life’. He would pride himself on the swaggering, buccaneering, rule-breaking spirit that he inherited from her. He made sure his letters home were, above all, amusing.

‘We’ve got a new matron called Miss Farmer in place of Miss Turner,’ he writes at the age of eleven, ‘who left last term, one night in the washing room, having inspected a boy called Ford she KISSED HIM.’ ‘P.S. Please send my riding breeches as soon as possible. Also a pot of Marmite please.’

Unwholesome intimacies continued at Repton. An older boy and friend of Dahl who was caught fiddling with some younger ones was excused by Dahl as not a homosexual but rather someone finding ‘the natural outlet for a rather over sensuous mind often met hand in hand with great brain’. The housemaster, however, wrote in a confidential letter to Dahl’s mother that the boy had been ‘guilty of immorality’ and had ‘deliberately tried to start small boys off wrong’. No one was very outraged by it, though.

Dahl himself was far too individual to be a success at school, generally described by his masters as ‘lethargic’, ‘languid’ and ‘too pleased with himself’. He disdained school games and was always bunking off to smoke his pipe or write home describing teachers like Major Strickland, who taught them maths, ‘a short man with a face like a field elderberry, and a moustache which closely resembles the African jungle’. Such boys usually go far. Creeps, suckers and school prefects often end up as mediocre politicians, like my own head of house Chris Bryant, now shadow leader of the House of Commons.

Dahl avoided university and joined the Asiatic Petroleum Company (later to become a part of Royal Dutch Shell), soon finding himself out in Dar es Salaam, writing home, ‘The sun’s still shining and the natives are still black.’ He got himself banned from the largely German Dar es Salaam Club for throwing darts at a picture of Hitler. When war loomed he was twenty-three. He jumped in a jeep and drove nine hundred kilometres across Africa to enlist with the RAF in Nairobi. On the way he passed a gentle family of elephants. ‘They are better off than me, and a good deal wiser. I myself am at this moment on my way to kill Germans or be killed by them.’

He certainly did kill Germans, turning out to be a skilled fighter pilot with at least four hits, flying in Palestine and Greece. You couldn’t wander far from the training camp in Iraq, he explained to his mother, or you’d be captured by Bedouin, who ‘hand you over to their womenfolk, who take good care that you do not get away with your balls’. In another letter, ‘I had a grand shit in a petrol tin this morning.’ Sofie Magdalene was certainly broad-minded for her generation.

And then Dahl was very nearly killed himself. ‘Crashed in desert’, read his telegram. ‘Caught fire but only concussion broken nose. Absolutely okay soon.’ In fact he was very lucky to survive. His plane hit the ground, on fire, he bailed out, on fire himself, rolled the flames out, and then had to lie still, badly concussed, while over a thousand rounds of ammunition from his guns exploded all around him. Later he had reconstructive surgery, all jovially described. ‘My nose was bashed in, but they’ve got the most marvellous Harley Street specialists out here who’ve joined up for the war as Majors, and the ear, nose and throat man pulled my nose out of the back of my head, and shaped it and now it looks just as before except that it’s a little bent about.’

His head injuries, he believed, changed his personality and made him a writer. After the war he spent a rather luxurious time out in Washington, DC, as an assistant air attaché, while Britain shivered through rationing. He had ‘a half time negro servant’, wined and dined with the Roosevelts, Walt Disney, Charlie Chaplin and even Thomas Mann, to whom he gave a copy of his early work, The Gremlins. He became a writer almost by accident, finding he had a gift for short stories with strange, twisted endings – best known now as Tales of the Unexpected – and of course novels for children, his greatest works. Sturrock astutely notes that once he started writing, ‘The breathless energy that had once animated his letters home now found its natural outlet in his fiction.’

He married an actress, Patricia Neal, and had five children, but there was terrible personal tragedy, first when his four-month-old son Theo was badly injured in a road accident, and then when his daughter Olivia, aged seven, died of complications from measles. Only two years later – surely something of a consequence – his wife had a stroke, although she survived and recovered, thanks largely to intensive nursing from her husband. His mother died three years after that. But it is his younger self that is captured here – jaunty and anarchic, yet a recognisable forerunner of that more subtly anarchic, stooping, cardiganed figure who was the world-famous author, gazing out on the world from his garden shed with watery, mischievous eyes.