TypeGPU 'use gpu' Directive Compiling JS to WebGPU Shocks Developer Community
Description
A Twitter/X screenshot showing a post from IroncladDev (@IroncladDev) saying '"use gpu" -- this has got to be a joke, there is no way'. The post quotes a tweet from Guillermo Rauch (@rauchg, Vercel CEO) posted 1 day earlier: 'This marvel is built in TypeGPU, a TypeScript WebGPU library [1/2]. Among other coolness, it features a "use gpu" directive that compiles JS to WSGL, to run on the GPU:' followed by a code example: `const add = (a, b) => { "use gpu"; return a + b; }`. Below the tweet is an image showing what appears to be a 3D rendered slider/toggle UI element at 38% with a melting gold/amber aesthetic. The meme captures the developer community's disbelief at yet another JavaScript directive (following 'use strict', 'use client', 'use server') -- this time for GPU computing via WebGPU shaders
Comments
10Comment deleted
JavaScript directives timeline: 'use strict' (2009), 'use client' (2023), 'use server' (2023), 'use gpu' (2025). At this rate, 'use quantum' drops by 2027 and 'use feelings' by 2030
What's the problem? Comment deleted
A cpu is a thinking stone. And a gpu is a magic thingy that makes the 3D models go boom. No way it can think of a+b Comment deleted
I think it worked like a thinking stone for graphics. So.. there probably are ways to make it think Comment deleted
Gpu is a matrix calculator Comment deleted
const add = (a, b) => { "Sum these two numbers. And please don't touch other functions!" } Comment deleted
not a joke ?? !! 😱 https://github.com/software-mansion/TypeGPU Comment deleted
I mean, this is useful. it's also extremely basic. it's like saying pyglet is somehow a revolutionary technology. like, no… it's neat, but it is just graphics processing. Comment deleted
The god damn JS??? On MYYYY GPU????? Comment deleted
"this (thing that was possible 10 years ago) was brought to you by (the concept of graphics computing)" Comment deleted