It's C++11 with attribute brackets — and one architectural twist
Metal Shading Language (MSL) is what you write inside .metal files. To a CUDA developer it looks immediately familiar: function qualifiers mark GPU entry points, attribute brackets expose SIMT indices, and address-space keywords name memory regions. To a graphics developer it looks like a leaner, more typed cousin of GLSL.
Three extensions matter most:
kernelfunction qualifier — the GPU entry point launched by CPU. CUDA's__global__twin.- Attribute brackets —
[[thread_position_in_grid]],[[threadgroup_position_in_grid]],[[thread_index_in_threadgroup]]. Metal's answer tothreadIdx+blockIdx. - Address-space keywords —
device,threadgroup,constant,thread— explicitly mark which memory region a pointer lives in. CUDA infers this from__shared__/__constant__; Metal makes it part of the type.
Beyond that, you get standard C++11 + Apple extensions: packed vectors (float4, half3), threadgroup barriers, math built-ins. The whole MSL spec is one PDF — readable in an afternoon.
The architectural twist that hides in plain sight: on Apple Silicon, device memory and CPU-visible memory are the same physical RAM. We'll dedicate a whole lesson to that next.