I am Charlie in the Chocolate Factory. Long John Silver on Treasure Island. At present I have the pleasure of being the Dr Gavin Wallace Writing Fellow hosted by the National Library of Scotland, and even if I were to live for the next 1,000 years I doubt I’d get one-tenth of the way through exploring the maps, books, manuscripts, and sound and film archives held by this great institution.

They tell me the library holds something like 25 million items, some 15 million of these being books in 490 different languages. Everything from Mills and Boon to James Joyce, from Muriel Spark manuscripts to the monthly journal of Sanitary Engineers. Not that anyone would fancy doing this, but if you laid the books side by side they would reach all the way from Edinburgh to Inverness. And with 5,000 or so new items added each week we’ll soon be in Thurso or Tromso …

The truth is that, thanks to the magic of the internet, the National Library is already there: thousands of items have been digitised, so that you can sit at home in Linlithgow and read the last letter of Mary Queen of Scots, in English and French, or sit at home in Benbecula and admire the beautiful Bartholomew Maps Archive.

I’ve only been in situ for a couple of weeks but already I’ve seen fascinating stuff: Iain Òg Ìle’s wonderful Gaelic material; the Bleau Atlas of Scotland from 1654, with its 49 engraved maps; and the gorgeous hand-drawn fishing maps by Maude Parker from the 1930s of the rivers Dee and Spey and Tweed; these are truly things of beauty.

I spent a day at Hillington where the Moving Image Archive (previously the Scottish Screen Archive) has been located for the past few years. This great resource has its own interesting history: it started in 1976 as part of the hugely-useful Job Creation Scheme and Scotland owes a great debt to Janet McBain who curated the film archive for 35 years between 1976 and 2011. Everything from the Galashiels Midsummer Gala in 1917 to Da Makkin O’ A Keshie in Shetland in 1932, where a local crofter demonstrates how to make a "keshie" to carry home his peat. The Moving Image Archive is a unique visual tapestry of the Scotland that formed us.

Old books and films and manuscripts and photographs are only as relevant as we make them. The danger with any archive is that we separate it from the future it shaped. Even though nostalgia is not what it used to be, there’s always a temptation to confine history to the past, when it really belongs to the present. Those black-and-white images of St Kilda show how things were on the island in 1929, but they also cast a light on what remoteness means and the social, political, cultural and existential decisions that define or marginalise individuals and communities.

The National Library of Scotland holds a wonderful newspaper archive: everything from the Mercuries Caledonius, which first appeared in 1660, to the first edition of the Inverness Courier, which was founded in December 1817 under the snappy title of The Inverness Courier and General Advertiser for the Counties of Inverness, Ross, Moray, Nairn, Cromarty, Sutherland and Caithness. Unfortunately they didn’t also give it a Gaelic title, which would have filled the whole front page, if not the whole paper.

The best thing about these old newspapers are the adverts. Yesterday I had the delight of looking through the November 7, 1889 edition of The Scottish Highlander, price one penny, whose entire front page was taken by adverts. The lead story was from an Invernessian cobbler declaring "Old Boots to Mend! Old Shoes to Mend!! Old Slippers to Mend!!" with the tremendous promise "None Too Bad To Repair By Us". You realise how everything, and nothing, has changed.

My favourite adverts came from the Strathspey and Badenoch Herald of April 1964 which almost persuaded me to go back to the future to Morayshire to see the "Wise man with the Wise Plan" from Elgin TV Services who would rent me the latest 19ins model TV for only 8/9d weekly.

Alongside was a splendid ad for milk, showing a bunneted labourer drinking a pinta at the Loch Awe Hydro works. "Who cares about power?" the advert asked, and gave its clear answer: ‘Scotland does and he’s a Scotsman, building the Loch Awe Hydro works and drinking a daily pinta." A masculine industrial Scotland exploiting its natural resources and living off its produce: a past we are still discarding and a future we are still inventing.