[swift-evolution] Swift-based Metal Shading Language
panajev at gmail.com
Sun Jul 10 03:36:02 CDT 2016
Sent from my iPhone
On 10 Jul 2016, at 08:50, Georgios Moschovitis <george.moschovitis at icloud.com> wrote:
>> working on C++ compatibility/interaction is still quite key because of the mountains of legacy and new code still written everyday in it.
> Totally agree, but C++ interoperability is orthogonal to my original request. Would love to have both!
>> Also, I think that the right language for the right domain and being able to glue them together is quite key in the modern computing world and using a single language in every computing domain is a chimera that can bring more pain than good.
> I disagree. IMO, the ‘babel’ of programming languages is one of the most annoying problems in our industry. Besides, I don’t see how C++ is any more suitable than Swift for GPU/heterogenous stuff (without peculiar extensions like CUDA). Swift is starting from a clean-slate, and could definitely become a ‘right’ language for this domain.
C++ gives you rope to hang yourself with, but in capable hands it gives you all the knobs and levers you need to extract high performance with a very high degree of determinism.
Garbage collection, automatic reference counting, pass by copy value types with or without copy on write semantics, etc... there are several areas where other languages keep you abstracted from the hardware in a way that does not make performance predictable.
Memory fragmentation, control of allocations of stack and heap memory (preferably away from hot game loops), no extra performance hit when passing memory reference around or iterate on collections (yes people can destroy performance in not very obvious ways too).
More information about the swift-evolution