/ Special-K: A subset of K mapped to a subset of GLSL Fragment Shaders / see https://www.khronos.org/files/opengles_shading_language.pdf functions: {x;y;z} {[a;b]...} lifted into GLSL functions numbers: 1 -2.3 float lists: 1 2 (1;2;3) vec2() vec3() vec4() matrix: mat[1 2;3 4] mat2() mat3() mat4() cond: $[p;t;f...] (p?t:f...) calls: x y x . y x[y;z] (x(y,z)) no projection swizzles: x.x x.yx x.yxyz extract/reorder xyzw fields set: x:25 (float x=25.0) or (x=25.0) x.xyz:1 2 3 insert into xyzw fields x+:1 2 x+=vec2(1.0,2.0) k verbs: + - * %: % ! & | ^: ^ _: < > = ~: ~ #: glsl: + - * sqrt / mod min max abs pow floor < > equal ! == length builtins: radians degrees sin cos tan asin acos atan[y;x] exp log exp2 log2 inversesqrt sign ceil fract clamp[x;y;z] mix[x;y;z] step[x;y] smoothstep[x;y;z] distance[x;y] dot[x;y] cross[x;y] normalize faceforward[x;y;z] reflect[x;y] refract[x;y;z] macros: , forms vector spread initializers |/bvec any(bvec) &/bvec all(bvec) mat[N;x] diagonal matrix of x, size N x*'y given matrices is matrixCompMult(x;y) x|y&z or y&x|z clamp(z,x,y) #x-y distance(x,y) globals: col (vec4 gl_FragColor) pos (vec4 gl_FragCoord) frame (float frame counter in web IDE) size (vec2 screen dimensions in web IDE) mouse (vec2 mouse position in web IDE) Adverbs are extremely limited and unfold into static expressions or fixed-iteration loops: monad'(a;b;c) (monad(a);monad(b);monad(c)) monad'vec3 (monad(x.x);monad(x.y);monad(x.z)) vec2 dyad'vec2 (dyad(x.x,y.x);dyad(x.y,y.y)) dyad/(a;b;c) dyad(dyad(a,b),c) dyad/vec4 dyad(dyad(dyad(x.x,x.y),x.z),x.w) n monad/x t=x;for(int i=0;i