{"id":16717981,"url":"https://github.com/dsheets/gloc","last_synced_at":"2025-04-10T07:50:01.893Z","repository":{"id":1474375,"uuid":"1716683","full_name":"dsheets/gloc","owner":"dsheets","description":"Shader Toolchain targeting WebGL/ESSL 1.0","archived":false,"fork":false,"pushed_at":"2012-05-31T23:53:11.000Z","size":746,"stargazers_count":18,"open_issues_count":13,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T08:02:05.518Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsheets.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-05-07T20:44:48.000Z","updated_at":"2023-06-02T13:51:32.000Z","dependencies_parsed_at":"2022-07-14T19:01:02.439Z","dependency_job_id":null,"html_url":"https://github.com/dsheets/gloc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsheets%2Fgloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsheets%2Fgloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsheets%2Fgloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsheets%2Fgloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsheets","download_url":"https://codeload.github.com/dsheets/gloc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248182010,"owners_count":21060891,"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-10-12T21:34:35.555Z","updated_at":"2025-04-10T07:50:01.868Z","avatar_url":"https://github.com/dsheets.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# *gloc*: (WebGL|ESSL) gl(sl) o(bject) c(ompiler)\n\n*gloc* provides modularity and dynamic linking to WebGL and OpenGL ES 2.0 GLSL\nshader systems. *gloc 1.0* features:\n\n - an ESSL preprocessor to expand SL source for analysis\n - preprocessor conditional expression partial evaluation\n - a semantic JSON shader object format *glo* with well-ordered symbolic dependencies\n - a client-side linker to assemble *glo* for rendering\n - compile-time macro definition\n - link-time macro definition\n - source-to-source translation with accurate source locations and comment annotations\n - a JavaScript implementation of the linking algorithm *glol*\n - runs as a native binary and in-the-browser via js_of_ocaml\n\n*gloc* is distributed as source code via this repository as well as a\n [compiled JavaScript tool](http://ashimaarts.com/gloc/glocode/). *glol*, the\n *glo* linking algorithm, is [also\n available](http://ashimaarts.com/gloc/glol.js) for your development convenience.\n\n*gloc* is licensed under a\n [BSD-3-Clause](https://github.com/ashima/gloc/blob/master/LICENSE)\n license and distributed by Ashima Arts as a member of the greater WebGL community.\n\n## Interfaces\n\n### [gloc](https://github.com/dsheets/gloc/blob/master/src/gloc.ml#L45)\n\n```\ngloc version 1.0.0 (Ashima Arts)\n  -c produce glo and halt; do not link\n  --xml produce glo XML document\n  -E preprocess and halt; do not parse SL\n  -e parse preprocessor and halt; do not preprocess\n  --source strip the glo format and return the contained source\n  -u required symbol (default ['main'])\n  --define define a macro unit\n  -D define a global macro\n  -o output file\n  --accuracy {best|preprocess}output accuracy\n  --line disregard incoming line directives\n  -x {webgl}source language\n  -t {webgl}target language\n  --dissolve dissolve declarations\n  -v verbose\n  --meta prototypical glo file to use for metadata\n  -help  Display this list of options\n  --help  Display this list of options\n```\n\n### [glo](https://github.com/ashima/gloc/blob/master/src/glo.atd)\n\n```ocaml\ntype 'a glo = {\n  glo:version;\n  target:(string * version);\n  ?meta:meta option;\n  ~units: 'a u list \u003cocaml repr=\"array\"\u003e;\n  ~linkmap: (string * string) list \u003cjson repr=\"object\"\u003e\n}\n\ntype meta = {\n  copyright:(year * href);\n  ~author:href list;\n  ?license:href option;\n  ?library:href option;\n  ?version:(version * url) option;\n  ?build:href option;\n}\n\ntype 'a u = {\n  ~pdir: string list;\n  ~edir: (string * string) list;\n  ?vdir: int option;\n  ~inu:string list;\n  ~outu:string list;\n  ~ina:string list;\n  ~outa:string list;\n  ~vary:string list;\n  ~insym:string list;\n  ~outsym:string list;\n  ~inmac:string list;\n  ~opmac:string list;\n  ~outmac:string list;\n  ~bmac:string list;\n  source:'a;\n}\n\ntype url = string\ntype href = (string * url)\ntype year = int\ntype version = (int * int * int)\ntype glom \u003cocaml_json module=\"Yojson.Safe\" t=\"json\"\u003e = abstract\n```\n\n### [glol](https://github.com/ashima/gloc/blob/master/src/glol.ml)\n\nA [JavaScript implementation of\nglol](https://github.com/ashima/gloc/blob/master/src/glol.js) is also\navailable. The source code is conversationally commented. If you have questions or\nconcerns, just ask! :-)\n\n## Requirements\n\n### WebGL Application Developers\n\nWebGL application developers need only to use the [JavaScript *glol*\nlink algorithm](http://ashimaarts.com/gloc/glol.js) and the\n[glocode](http://ashimaarts.com/gloc/glocode/) development\nenvironment. No local software installation is required.\n\n### Shader Developers\n\nShader library developers and those developers with native build systems\nwill need the following local software packages to build *gloc*:\n\n - [GNU Make](http://www.gnu.org/software/make/)\n - [OCaml 3.12.0+](http://caml.inria.fr/)\n - [ulex](http://cduce.org/download.html)\n - [menhir](http://gallium.inria.fr/~fpottier/menhir/)\n - [ocaml-re](https://github.com/avsm/ocaml-re)\n\nYou will also need recent versions of Martin Jambon's atdgen and friends\nin approximately this order:\n\n - [yojson 1.1+](https://github.com/mjambon/yojson)\n - [atd](https://github.com/MyLifeLabs/atd)\n - [atdgen](https://github.com/MyLifeLabs/atdgen)\n\nThese software packages may be available in your operating system's\npackage repository. See [the gloc GitHub wiki\npage](https://github.com/ashima/gloc/wiki) for more detailed\ninstallation information.\n\n### gloc Developers\n\nDevelopers of the *gloc* tool itself will need all of the packages\nrequired by shader developers for a local *gloc* build as well as the\nlatest development version of\n[js_of_ocaml](http://ocsigen.org/js_of_ocaml/install) to build the\nJavaScript port of the compiler and linker.\n\n## Users\n\nCommercial users of *gloc* include:\n\n - Ashima Arts' [Ooman](http://ashimagames.com/)\n\n*glo* shader libraries include:\n\n - Ashima Arts' [webgl-noise](https://github.com/ashima/webgl-noise)\n\n## Contributors\nSpecial thanks to the WebGL working group for making this possible by\nallowing UTF8 in shader comments.\n\n## Fine Print\nSuggestions? Bugs? Feature wishes? Comments? Language translations?\nPlease use the GitHub project management features in the top bar to help\nout the project!\n\nDo you use gloc in production? Have you published open source shader\nlibraries that use gloc? Let us know and we'll add you to this file.\n\nGloc Links Our Creativity! Carpe Ignem!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsheets%2Fgloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsheets%2Fgloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsheets%2Fgloc/lists"}