The Shining is a 1980 psychological horror film produced and directed by Stanley Kubrick , co-written with novelist Diane Johnson , and starring Jack Nicholson , Shelley Duvall , Scatman Crothers , and Danny Lloyd .