New open-source library gpu-lexer brings AI-based syntax highlighting to WebGPU
A developer released gpu-lexer, a 27.5KB JavaScript package that uses a small WebGPU-run neural model to perform syntax highlighting without relying on language-specific grammars. It tokenizes code into words, whitespace and symbols, then predicts each token's category—such as keyword, string or function—based on surrounding context, aiming to work even on languages it has never seen before.