reorderDependencies = (languages) => {
  const resolver = new DependencyResolver();
  for (const lang of languages) {
    resolver.add(lang.name);
    for (const required of lang.requires) {
      resolver.setDependency(lang.name, required);
    }
  }
  return resolver.sort().map((name) =>
    languages.find((l) => l.name === name)
  );
}
Reorders languages, moving dependencies above the languages
that depend on them.

@param {array<Language>} languages list of languages to be reordered
@returns {array<Language>} ordered list of languages