New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenGL / WebGL in IHaskell? #619
Comments
Great. That would be awesome. IHaskell provides a mechanism to display custom data types through its I'll discuss this with the jupyter/IPython folks at https://gitter.im/ipython/ipython. It's possible that some work has been done to this end, and we might be able to use the frontend bits. I've just begun learning about computer graphics, so your suggestion comes at a very good time for me 😄 |
I'm glad for the interest. My embedded compiler generates insanely fast shader code (assuming a GPU) as well as GUIs for interacting with them. It's essentially a modernized version of Pan and Vertigo. I implemented this newer compiler a few years back, but the sad state of basic GUI & graphics support in Haskell (cross-platform, ghci-friendly, and OpenGL-compatible) has prevented me from using it myself. Meanwhile, something in the low-level OpenGL code has bit rotted. I'd love to get help with setting up up-to-date OpenGL/WebGL mechanics for running shaders with GUIs. Then I can refactor my project to generate the GUIs and shaders from very high-level denotative/functional specifications (as in Pan & Vertigo) to use the updated OpenGL/WebGL layer. I expect the storage requirements for the rendered form to be quite small, while the visual quality will be have very high resolution spatially and temporally (since the representation intrinsically has infinite resolution in space and time). The Haskell representation would get "rendered" (via |
It should be pretty straightforward to do this, if the GLSL code can run with WebGL. Generating JS and having it displayed is pretty easy. Is that the goal? If so, I can give you a code snippet that will display a WebGL display as an output of a cell. |
Yes, that's the goal, and the generated shaders do run with WebGL. With the basic WebGL mechanisms in place, I can then generate the shaders and GUI descriptions. The shaders are animated (via time and widgets), with updates communicated through GLSL uniform parameters. If you (or someone else) cooked up a simple example with hand-generated GUI and shader (connected via uniform parameters), I could probably take it from there. |
Yes, I'd like to try it out. |
Has anyone made progress on using WebGL with IHaskell? |
@gibiansky a code snippet that displays a WebGL display as an output of a cell would be swell... |
I would be very interested to see progress in this. Is your embedded compiler published anywhere @conal ? https://www.google.co.jp/search?q=conal+elliott+haskell+glsl+compiler |
More recently, I reworked my Haskell-to-GLSL compiler as an instance of compiling-to-categories, with a few benefits:
|
Has anyone hooked up OpenGL or WebGL with programmable shaders to work in IHaskell notebooks? I have an embedded compiler (i.e., for a "deep DSL embedding") from Haskell to GLSL, which I'd love to dust off and share.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: