From the language design would having type check loops be efficient i.e
libraries.filterIsInstance<StaticInteropLibrary>().joinToString { it.paths.joinToString { "-L$it" } }
libraries.joinInstanceToString<InteropLibrary,StaticInteropLibrary>().joinToString{ it.paths.joinToString { "-L$it" }}