(comments)
原始链接: https://news.ycombinator.com/item?id=43943942
Laurentlb, the author of "15 Years of Shader Minification," created the article mainly for the demoscene and offers a web build for testing. The author is open to answering questions, and may write future articles on code minifiers, comparing them to formatters, and implementing transformations using F#.
Several users commented on the tool's utility, with one using it in a custom webpack plugin for GLSL code minification. Discussions ensued regarding modern programming in shaders, SPIR-V bytecode, modules, dynamic linking, and the potential successor to GLSL. The article also touches on the Shader Minifier's impact on runtime performance, how it handles named uniforms, and the optional renaming of uniforms for efficiency. One user appreciates the dedication of the author, who admits work happened sporadically, with a love for the F# codebase.
Some early shader minification techniques (like `#define R return`) aren't very effective, but the article focuses on more useful methods.
If anyone wants to try it, I've made a web build: https://ctrl-alt-test.fr/minifier/
I might write a more general article later on writing code minifiers, e.g. how it compares to writing a code formatter, how to implement the transformations, etc.
On the tech side, the code is written in F#. The web build uses Bolero (Blazor for F#). So maybe I'll write later about my experience writing an open source project with F# and evolving it.
reply