{"id":18465319,"url":"https://github.com/sleexyz/hylogen","last_synced_at":"2025-05-16T06:00:24.505Z","repository":{"id":56844517,"uuid":"54949999","full_name":"sleexyz/hylogen","owner":"sleexyz","description":"GLSL embedded in Haskell","archived":false,"fork":false,"pushed_at":"2024-01-15T11:30:54.000Z","size":11199,"stargazers_count":478,"open_issues_count":20,"forks_count":26,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-04-14T01:01:55.165Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hylogen.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sleexyz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-03-29T06:01:11.000Z","updated_at":"2024-03-24T12:30:38.000Z","dependencies_parsed_at":"2024-02-26T01:18:50.443Z","dependency_job_id":null,"html_url":"https://github.com/sleexyz/hylogen","commit_stats":{"total_commits":239,"total_committers":5,"mean_commits":47.8,"dds":0.05439330543933052,"last_synced_commit":"0e5eb3f117e0dd960ec0aef1da581402efee1148"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleexyz%2Fhylogen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleexyz%2Fhylogen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleexyz%2Fhylogen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleexyz%2Fhylogen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sleexyz","download_url":"https://codeload.github.com/sleexyz/hylogen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478160,"owners_count":22077675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T09:12:42.942Z","updated_at":"2025-05-16T06:00:24.471Z","avatar_url":"https://github.com/sleexyz.png","language":"JavaScript","funding_links":[],"categories":["Libraries Visualization","Libraries and tools"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./docs/demo.gif\"\u003e\u003c/img\u003e\n\u003c/p\u003e\n\n![](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)\n\u003ch1 align=\"center\"\u003e\u003ci\u003eH Y L O G E N\u003c/i\u003e\u003c/h1\u003e\n\u003cp align=\"center\"\u003eAn embedding of GLSL in Haskell.\u003c/p\u003e\n\n![](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)\n\n\u003ch1 align=\"center\"\u003e\u003ci\u003eH Y L I D E\u003c/i\u003e\u003c/h1\u003e\n\u003cp align=\"center\"\u003eA live coding environment for writing shaders with Hylogen.\u003c/p\u003e\n\n![](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)\n\n---\n\n![](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)\n\n* **Demo Reel:** [hylogen.com](https://hylogen.com)\n* **Hylogen** -  [![Hackage Status](https://img.shields.io/hackage/v/hylogen.svg)](https://hackage.haskell.org/package/hylogen)\n* **Hylide** -  [![Hackage Status](https://img.shields.io/hackage/v/hylide.svg)](https://hackage.haskell.org/package/hylide)\n\n\n![](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)\n\n---\n\n![](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)\n\n\n\n## Install\n\nBuild from source, using [Stack](https://docs.haskellstack.org/en/stable/README/):\n\n1. Install [stack](https://docs.haskellstack.org/en/stable/README/)\n2. `git clone https://github.com/sleexyz/hylogen.git`\n3. `cd hylogen`\n4. `stack build`\n\n\nThis is the recommended method of using Hylogen, because using Stack you can share your projects and be confident that others will be using the same version of Hylogen as you. To install it to your system so it can be used anywhere, not just inside the `hylogen` folder, use `stack install` instead of `stack build`.\n\nHylogen can also be installed to your system using the [Haskell Platform](https://www.haskell.org/platform/):\n\n1. Install the [Haskell Platform](https://www.haskell.org/platform/)\n2. `cabal update \u0026\u0026 cabal install hylogen hylide`\n\n\n![](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)\n\n## Example\n\nHere's a simple Hylogen shader to be used with Hylide, saved as `Example.hs`\n(available in the `examples/` directory):\n\n```haskell\n\nmodule Example where\nimport Hylogen.WithHylide\n\noutput :: Program\noutput = toProgram color\n\ncolor :: Vec4\ncolor = vec4 (a, a, a, 1)\n  where\n    k = 20\n    f = (*k) . sin . (/k)\n    a = sum [ cos (x_ uvN * f time + x_ mouse )\n            , sin (y_ uvN * f time + y_ mouse )\n            ]\n```\n\nRun Hylide:\n\n```\n$ stack exec hylide Example.hs\n```\n\nIf Hylide was installed using the haskell platform, you can omit `stack exec`:\n\n```\n$ hylide Example.hs\n```\n\n\n\n\n\nNow go to [localhost:5678](http://localhost:5678) in your browser. You'll see a live rendering of the corresponding generated GLSL:\n\n```GLSL\nvoid main() {\n    float _7 = uvN.x;\n    float _10 = (time / 20.0);\n    float _9 = sin(_10);\n    float _8 = (_9 * 20.0);\n    float _6 = (_7 * _8);\n    float _11 = mouse.x;\n    float _5 = (_6 + _11);\n    float _4 = cos(_5);\n    float _3 = (0.0 + _4);\n    float _15 = uvN.y;\n    float _18 = (time / 20.0);\n    float _17 = sin(_18);\n    float _16 = (_17 * 20.0);\n    float _14 = (_15 * _16);\n    float _19 = mouse.y;\n    float _13 = (_14 + _19);\n    float _12 = sin(_13);\n    float _2 = (_3 + _12);\n    vec4 _1 = vec4(_2, _2, _2, 1.0);\n\n    gl_FragColor = _1;\n}\n```\n\nHylide will recompile on changes to the Haskell source, sending generated GLSL to the WebGL client over websockets.\n\n\n\n\n![](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)\n\n## References\n- [The_Force](https://github.com/shawnlawson/The_Force) by Shawn Lawson. This was the initial inspiration for Hylide.\n- [data-reify](https://hackage.haskell.org/package/data-reify) for type-safe observable sharing.\n\n![](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)\n\n\nConceived of at the [Recurse Center](https://www.recurse.com/) :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsleexyz%2Fhylogen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsleexyz%2Fhylogen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsleexyz%2Fhylogen/lists"}