MSL is familiar, not identical
Metal Shading Language uses familiar C++ syntax but adds GPU execution semantics and address spaces. A device pointer addresses device-buffer data, constant denotes read-only constant data, thread is per-thread storage, and threadgroup is shared within a threadgroup. These are not decorative keywords. A C++ function using arbitrary heap allocation, operating-system services, or host containers cannot simply be pasted into a GPU shader.
A vertex function produces a position and interpolated outputs; a fragment function consumes the rasterized inputs and returns attachment values. Attributes such as [[position]], [[stage_in]], and [[buffer(0)]] connect the stages and resource bindings. Treat the numeric binding as part of a documented interface. Keep a tiny original shader for the first fruit: a stable transform and a warm gradient, then change one parameter deliberately.
Compile the library and resolve named functions before building a pipeline. Preserve compiler diagnostics and use a last-known-good pipeline during experimentation. For a reproducible release, record how the shader library was built for the target. Runtime compilation is useful for the teaching probe and development experiments; do not silently make every frame recompile the library.
