Hacker News new | ask | show | jobs
by greggman 3352 days ago
it most definitely is still that case. plenty of GPUs can not run plain C.

looking at the metal language I'm not sure I'd personally call that C++ given all the restrictions

https://developer.apple.com/metal/metal-shading-language-spe...

I'd be curious if you can create static arrays, strings or static strings, do string compares etc. not that I'd want to do any of that on a GPU but rather if you tell me the language is C++ there are a ton of things I'd expect to be able to do that I'm pretty sure don't translate to GPUs

maybe I want to declare a local static array and modify it. maybe I want to create static arrays of colors and search for the closest match. I feel like having a more common language would just lead people to bang their heads against the impossible or implement horribly inefficient algos not really understanding what's going on under the hood

2 comments

"I feel like having a more common language would just lead people to bang their heads against the impossible or implement horribly inefficient algos not really understanding what's going on under the hood"

I completely disagree. The author is not really arguing for a "more common language" anyhow - he's arguing for a GPU language that avoids many of the inefficiencies and semantic problems with the current approach. To boot, he's arguing for an approach that allows better static error checking, which it's hard to argue against.

I have to say it's sad that Apple went with Metal rather than working to evolve Vulkan as an excellent standard. We'll see how that works out in the long run...

> I feel like having a more common language would just lead people to bang their heads against the impossible or implement horribly inefficient algos not really understanding what's going on under the hood

Good point.