Hacker News new | ask | show | jobs
by eridius 2498 days ago
I don't know what point you're trying to make. MSL doesn't link with the rest of your program. No matter what language you use for your program, the shaders are written in MSL. For my program if I use Rust or C++ or Obj-C or Swift or a microscopic magnet and a very careful hand, I write my Metal shaders in MSL.
1 comments

1 - MSL is a set of extensions on top of C++14

2 - Metal requires MSL

3 - IO Kit is a C++ framework for macOS, iOS, iPadOS and watchOS drivers

4 - Metal GPGPU drivers are written in IO Kit

5 - Metal is useless without MSL and GPGPU drivers

6 - Ergo, Metal requires C++

The fact that Metal itself requires the existence of C++ really has nothing to do with this topic though, which is whether there's any downside to writing your app in a language that Apple doesn't ship a compiler for. The fact that Metal shaders are written in a language based on C++ is irrelevant to this question, because it doesn't matter what language you pick for the rest of your app as Metal shaders don't link with your app. Swift has zero integration with C++ and yet I can write a Metal app using Swift, because the fact that the shaders are written in MSL has no impact on the fact that the app uses Swift.

And the language for writing drivers in is even more irrelevant because we're not talking about writing drivers. You can't write drivers in Swift either.