This function is already declared in `script/lang_of_filename.ml`.  Avoiding the duplication would be welcome.