One part of the reason for this, is that using Swift is ironically slow and inefficient compared to C, and not appropriate if your real goal is performance and maximizing the capability of the hardware.
In most all serious scientific applications, games, art tools, etc. where the Metal is to be used, there is a large amount of memory and data that is to be managed, transformed, and passed around to and from the cpu and gpu.
Using Metal itself might imply the developer is trying to get the full performance or stability possible at the sacrifice of ease of use or any other benefit the Swift coder might believe they are gaining.
So to combine something inefficient like Swift with Metal is a bit of strange practice for a use case where we sincerely are maximizing the potential of the hardware. What exactly is the developer trying to achieve by going only part way? Perhaps they are just following the cultural fads or caught up in novelty, and not measuring, or perhaps they are doing something where they just do not care about the performance consequences. Most of the Swift architecture and syntax choices over the years have reflected strange preferences of the community, that don't align with clear rationality, so I don't think it's something the community can readily engage a logical dialog about, without also confronting the irrationality of many ideas that were already adopted.
In any case, the typical lesson here, is to avoid the tendency to try to learn by example - not to learn by reading other people's code, but to come to understand the fundamentals. Then you will understand how to build anything, and clearly see the limits, problems, and incorrect practices of publicly published examples.
Topic:
Graphics & Games
SubTopic:
Metal
Tags: