Have another look at the first example I shared. One major limitation of glsl is a lack of functional programming. In that example, we pass functions to other functions, and iterate over arrays of functions, neither of which are possible in glsl. This is used to implement generic transformations of SDFs. If you did the same with just glsl it would be much longer, harder to read, and there would be duplicated code.
You can even use recursion (with limitations of course)!
At the same time, many more people know javascript than shader languages, so this makes it easier for beginners to get their hands dirty and can be a gateway to gpu programming.
So there are benefits for both novices and advanced users! There are pitfalls to this approach too of course and it certainly isn't a replacement for glsl, but the purpose is simply to explore new possibilities :)
You can even use recursion (with limitations of course)!
https://shaderpark.com/sculpture/-N8ntgGcPiXK5igOagRW
At the same time, many more people know javascript than shader languages, so this makes it easier for beginners to get their hands dirty and can be a gateway to gpu programming. So there are benefits for both novices and advanced users! There are pitfalls to this approach too of course and it certainly isn't a replacement for glsl, but the purpose is simply to explore new possibilities :)