A Haskell library that embeds GLSL for live-coding shaders with a companion live-coding environment.
Hylogen is a Haskell library that embeds GLSL shader code as a domain-specific language, allowing developers to write and generate GLSL shaders using Haskell's syntax and type system. It solves the problem of writing error-prone, low-level GLSL code by providing a higher-level, type-safe abstraction. The project includes Hylide, a live-coding environment that automatically recompiles shaders and updates a WebGL preview in real-time.
Haskell developers interested in graphics programming, shader artists looking for a safer and more expressive shader development workflow, and programmers exploring live-coding environments for real-time visuals.
Developers choose Hylogen because it combines Haskell's strong type system with GLSL, reducing runtime errors in shaders and enabling live coding. Its unique selling point is the seamless integration of functional programming with real-time graphics, offering a more robust and interactive shader development experience compared to writing raw GLSL.
GLSL embedded in Haskell
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Leverages Haskell's compile-time type checking to catch GLSL errors early, as shown by the automatic translation of typed Haskell expressions to valid GLSL code.
Hylide provides real-time shader updates via WebSockets, enabling immediate visual feedback and iterative design, ideal for creative coding and demos.
Allows shaders to be written with Haskell's functional constructs, such as pure functions and composition, making code more modular and reusable.
Uses data-reify for type-safe observable sharing, optimizing generated GLSL by reusing computed values, as evidenced in the example output with reduced redundancy.
Requires knowledge of Haskell and its toolchain (Stack or Cabal), adding significant learning curve and setup complexity for non-Haskell developers.
As a specialized library, it has fewer community resources, tutorials, and integrations compared to mainstream shader tools like ShaderToy or raw GLSL workflows.
Hylide is tied to WebGL for live updates, limiting its utility for projects targeting other graphics APIs without manual shader pipeline management.
The README provides basic examples but lacks comprehensive guides on advanced usage, error handling, or integration with other Haskell graphics libraries.