27.5KB language-agnostic WebGPU syntax highlighter
gpu-lexer.vercel.app
27.5KB language-agnostic WebGPU syntax highlighter
1–10 of 39 posts
Re: 27.5KB language-agnostic WebGPU syntax highlighter
#2Re: 27.5KB language-agnostic WebGPU syntax highlighter
#3Re: 27.5KB language-agnostic WebGPU syntax highlighter
#4Re: 27.5KB language-agnostic WebGPU syntax highlighter
#5Seems don't work on firefox mobile on Android
Re: 27.5KB language-agnostic WebGPU syntax highlighter
#6I don't think it's meant as something that's useful per se because highlighting 5m lines of code at once is unusual, and doing it in a non-deterministic way probably isn't especially helpful, but to show what a browser is capable of it's awesome.
You generally never need to highlight a whole file, only the part you're looking at. Which by definition must be fuzzy since you don't have the full source, the part you see will not parse as a complete program so you need to guess. This is actually one of the nastier parts of writing a highlighter, and it must be done for every language.
The lesson is that if you're going to be fuzzy you might as well be learned too and the results are pretty good.
This is more useful than it appears at first glance. It would be just as useful running on the CPU, which I'm sure it can.
Re: 27.5KB language-agnostic WebGPU syntax highlighter
#7Great news for a language whose last stable release was 20 years ago
Re: 27.5KB language-agnostic WebGPU syntax highlighter
#8I don't think it's meant as something that's useful per se because highlighting 5m lines of code at once is unusual, and doing it in a non-deterministic way probably isn't especially helpful, but to show what a browser is capable of it's awesome.
The use case isn't highlighting a huge amount of code, but local re-entrant highlighting. You generally never need to highlight a whole file, only the part you're looking at. Which by definition must be fuzzy since you don't have the full source, the part you see will not parse as a complete program so you need to guess. This is actually one of the nastier parts of writing a highlighter, and it must be done for every…
Presumably this could also be a useful trait when live highlighting of files when editing, as in-progress typing is likely to be unparseable sometimes.
Re: 27.5KB language-agnostic WebGPU syntax highlighter
#9Re: 27.5KB language-agnostic WebGPU syntax highlighter
#10I don't think it's meant as something that's useful per se because highlighting 5m lines of code at once is unusual, and doing it in a non-deterministic way probably isn't especially helpful, but to show what a browser is capable of it's awesome.
The use case isn't highlighting a huge amount of code, but local re-entrant highlighting. You generally never need to highlight a whole file, only the part you're looking at. Which by definition must be fuzzy since you don't have the full source, the part you see will not parse as a complete program so you need to guess. This is actually one of the nastier parts of writing a highlighter, and it must be done for every…