Since it is the second time this construction is used (it is also in `script/lang_of_filename.ml`), maybe one should factor it in `script/utils.ml`?