regl-project / regl

👑 Functional WebGL
https://regl-project.github.io/
MIT License
5.22k stars 322 forks source link

compile function / debug package #665

Open fr-an-k opened 1 year ago

fr-an-k commented 1 year ago

Hi, I'm just starting regl and it's great; strange how this is not super popular. To take off it really needs a proper ecosystem of community REGL components, like how NPM packages work. There are quite some; awesome-regl should be updated and maybe I will.

My question: my code is not working and there is nothing to debug it. I would like to have a look at the generated draw call and maybe fiddle with it to find what it misses and understand how the REGL object is interpreted, because the documentation does not seem complete. At first I thought REGL is interpreted, which would make that a big ask, but to my surprise REGL does actually generate code for the draw call.

Why is this function is not documented/in the API?

Second use case is to use REGL in development to produce production code, eliminating the compilation step in the final application.

Seems obvious that this should be core functionality, or am I overlooking something?

Also, it would be nice if the regl package was fully optimized while a regl-dev package could be used for development (i.e. bundled with the --debug flag, but readymade through npm so not everyone has to do all the work themselves again and again).

fr-an-k commented 1 year ago

Ok, so the generated code is not particularly useful for either purpose; it's difficult to read and all the irrelevant conditionals are still there. It would be interesting to see a version of REGL that could output AssemblyScript/Rust/WASM or even any language with a simple plugin.