Change request: Replace the GLSL parser
- Dominant language
- JavaScript
- Stars
- 6.5k
- Forks
- 772
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
AstExplorer.net [currently uses](https://github.com/fkling/astexplorer/blob/f00e3bb2fe6ef816701a46e7801cc6b500400923/website/src/parsers/glsl/glsl-parser.js#L21) the [stackgl glsl-parser](https://www.npmjs.com/package/@maptalks/glsl-parser) as the GLSL parser. At the time, this was really the only Javascript parser available, and the best choice.
Today, we know this parser is buggy, incomplete, and doesn't process valid GLSL input. It's also likely abandonware at this point as bug reports aren't responded to.
The StackGL GLSL parser can only handle (a limited subset of) the older version of the GLSL language, "GLSL ES 1.00", which came with WebGL 1. The parser cannot handle the current version of GLSL, "GLSL ES 3.00", supported by WebGL 2. Any new library created today that needs a GLSL parser needs ES 3.00 support.
I have written a new GLSL parser/compiler, [@shaderfrog/glsl-parser](https://github.com/ShaderFrog/glsl-parser), that handles all of the above. It's relatively new, but due to its full support of both versions of the language, it's already in use by [28 other projects](https://github.com/ShaderFrog/glsl-parser/network/dependents) (that I'm aware of).
I propose replacing the StackGL parser with the Shaderfrog GLSL parser. Other than being the author, my other disclosure is my own personal interest in this is having a nice UI to debug my ASTs 😃
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.