{"id":13442859,"url":"https://github.com/cbaggers/varjo","last_synced_at":"2026-01-25T08:31:35.554Z","repository":{"id":6175005,"uuid":"7404991","full_name":"cbaggers/varjo","owner":"cbaggers","description":"Lisp to GLSL Language Translator","archived":false,"fork":false,"pushed_at":"2022-10-04T21:56:49.000Z","size":3347,"stargazers_count":226,"open_issues_count":64,"forks_count":22,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-05T20:11:33.161Z","etag":null,"topics":["common-lisp","compiler","glsl","lisp"],"latest_commit_sha":null,"homepage":null,"language":"Common Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cbaggers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-02T10:12:56.000Z","updated_at":"2025-03-19T13:29:35.000Z","dependencies_parsed_at":"2023-01-11T17:02:23.146Z","dependency_job_id":null,"html_url":"https://github.com/cbaggers/varjo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cbaggers/varjo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbaggers%2Fvarjo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbaggers%2Fvarjo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbaggers%2Fvarjo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbaggers%2Fvarjo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbaggers","download_url":"https://codeload.github.com/cbaggers/varjo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbaggers%2Fvarjo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28749309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T08:31:04.260Z","status":"ssl_error","status_checked_at":"2026-01-25T08:30:28.859Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["common-lisp","compiler","glsl","lisp"],"created_at":"2024-07-31T03:01:52.262Z","updated_at":"2026-01-25T08:31:35.527Z","avatar_url":"https://github.com/cbaggers.png","language":"Common Lisp","readme":"### Varjo [BETA]\n\nVarjo is a Lisp to GLSL compiler.\n\nVarjo has no OpenGL dependency as is designed to be integrated into other projects, see CEPL for an example.\n\nVari is the dialect of lisp Varjo compiles. It aims to be as close to Common Lisp as possible, but naturally it is statically typed so there are differences.\n\n#### Features\n\nSubset of common lisp. Including:\n\n- Macros\n  - `defmacro`, `define-compiler-macro`, `macrolet`, `symbol-macrolet` all supported\n  - `\u0026environment` supported (currently custom API for introspection but [cltl2](https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node102.html) API planned)\n- Multiple-value return via `values` \u0026 `multiple-value-bind`\n- local functions via `labels`\n- `defstruct` which can be used across multiple shaders (Less repeated code)\n- limited first-class function support (Functions have to be statically resolved to avoid runtime conditionals)\n- inline GLSL expressions\n- WIP for `declare` and extensible declaration identifiers\n- Type checking in and across shader stages\n- Rolling translate, where out vars from one stage can be automatically fed into the next\n- Easy to extend (API still in progress)\n\n### Documentation\n\nThe user guide can be found in [docs/user-guide.md](docs/user-guide.md)\n\nThe reference documentation for the compiler can be found [here](http://techsnuffle.com/varjo/varjo-reference.html)\n\nThe reference documentation for the Vari language can be found [here](http://techsnuffle.com/varjo/vari-reference.html)\n\n### Installing\n\nRun `(ql:quickload :varjo)` at your REPL.\n\n### Cloning\n\nWhist it is recommended to get Varjo from quicklisp, if you clone please note that `master` is not the stable branch. Please use `release-quicklisp` for the stable code that will be in the next Varjo release.\n\n#### Name Origins\n\n- Varjo is 'shadow' in Finnish\n- Vari is 'shadow' in Estonian\n\n### Updates\n\n#### 2018-04-05\n\n- Tonnes of improvements to docs (see the links in the 'Documentation' section above)\n- `vari-describe`, which is function that given a symbol that names a gpu func/var gives you documentation (check out vari-describe.el for emacs integration)\n- Lots more glsl operators are supported. WARNING we now have pre \u0026 post vector/matrix multiplication, please remember that the order matters (just like in regular glsl). To use the glsl specific operators (e.g. ~ ! \u0026 etc) please `:use` the `:glsl-symbols.operators` package in your project.\n\n#### 2018-03-14\n\nLots landing this month, whilst my current test suite passes I'm still expecting some issues or regressions, if these hit you PLEASE let me know so I can avoid merging this to quicklisp before the regressions have been handled. Quick summary of changes are:\n\n- Documentation! (see the Documentation section above for the links)\n- GLSL 460 fixes\n- compute bug fixes\n- tonnes of functions from the CL spec added (see below)\n- swizzle of rgba \u0026 stpq\n- more closely mimick the CL type tree (Still lots to be done here)\n- fix long standing bug which stopped you passing ubo/ssbo structs to functions (due to them being represented by interface blocks)\n- fix max array length bug\n- dont emit spurious function \u0026 struct glsl in various cases. Wasnt hurting anything except glsl compile time, but was still ugly.\n- internal environment object now uses the uniform-variable objects rather than lists\n- qualifier refactor to reduce duplication of information\n- some more validation checks around ubos \u0026 ssbos (though the validation code is scattered and needs a cleanup)\n- internal macro renaming\n- def-metadata-infer deprecated, use define-metadata-infer instead\n- def-metadata-kind deprecated, use define-metadata-kind instead\n- def-shadow-type-constructor deprecated, use define-shadow-type-constructor instead\n- :int32 \u0026 :uint32 type names now work as expected\n- improvements to slot-value\n- fix bug letting you assign to a read-only place\n- perf improvements\n- [BREAKING CHANGE] Removed ast (non trivial ammount of cons and not used for compile)\n- [BREAKING CHANGE] Removed the unused *draw-modes* variable\n\nCL functions added listed below. Some of the predicates are basically pointless, but for completeness it's nice to have them\n\n- symbolp\n- keywordp\n- row-major-aref\n- svref\n- array-rank\n- array-row-major-index\n- array-total-size\n- adjustable-array-p\n- array-has-fill-pointer-p\n- arrayp\n- bit-vector-p\n- simple-bit-vector-p\n- simple-vector-p\n- vectorp\n- compiled-function-p\n- functionp\n- 1+\n- 1-\n- cis\n- float (add optional args)\n- integer-length\n- signum\n- conjugate\n- random-state-p (though just false for now)\n- complexp\n- evenp\n- floatp\n- integerp\n- minusp\n- numberp\n- oddp\n- plusp\n- rationalp\n- realp\n- zerop\n- copy-structure\n- prog2\n- dotimes\n- typecase\n- phase\n- isqrt\n- logand\n- logandc1\n- logandc2\n- logcount\n- logeqv\n- logior\n- lognand\n- lognor\n- lognot\n- logorc1\n- logorc2\n- logtest\n- logxor\n- with-accessors\n- multiple-value-setq\n- nth-value\n\nAlso added the complex \u0026 ratio types. Complex support is limited right now and ratio basically useless. But we have a place to work from.\nComplex numbers are always single-float in vari.\n\n#### 2017-06-04\n\n**PACKAGES**\n\nThere has been a huge refactoring of packages.\n\nThis is annoying but a neccessary step before I could start documenting the project. The original structure just appeared out of neccessity so I'm hoping this will last a little longer. The most important changes are:\n\n- Our lisp dialect has a name. The naming around Varjo and it's lisp dialect were confusing people so I have named the dialect `Vari`, `Varjo` remains as the name of the compiler.\n\n- `varjo-lang` renamed to `vari`. You will need to update your package `:use`ings to pull in `vari` and not `varjo-lang`.\n\n- No more dependency on rtg-math! If you want to use rtg-math's functions in your shaders please quickload `rtg-math.vari`\n\n- The `varjo` package now only exports symbols for interacting with the compiler.\n\n- There are places where GLSL \u0026 Common Lisp's function names overlap. This is fine when the behaviour is also the same but this is not always the case. For this reason we have a `vari.cl` package and a `vari.glsl` package. When there are conflicts (that people care about) we will put the different versions in the respective packages and `vari` will use the most common case.\n\n**Bugfixes \u0026 Enhancements**\n\n- `if` will now generate a ternary expression (e.g. `x\u003c0 ? -1 : 1`) if the followiung is true\n  - there is an 'else' form\n  - both the 'then' \u0026 'else' forms return a value of the same type\n  - both the 'then' \u0026 'else' forms are pure\n  - neither the 'then' \u0026 'else' forms return multiple values\n  - there is also a 'style' restriction that means if the glsl code for the expression goes over 100 characters then it will emit a regular `if` block. This is just to keep code readable.\n\n- If you use `-\u003e` in a symbol it will become `_to_` in glsl. So `int-\u003efloat` becomes `int_to_float`\n\n- Fix bug where, if the 'then' clause of an `if` contained a progn, that code would be missing from the glsl.\n\n- Redamentary checks for purity of an expression (whether it has side effects). This feature is currently young and over conservative\n\n- Better error messages when assigning the wrong type to a place\n\n- Better error message for invalid argument format in function definition\n\n- Add the `dynamic` draw mode. Used when you dont know (or don't want to specify) the primitive for the compile. This will only work for vertex \u0026 fragment stages but will throw a sensible error if passed to anything else.\n\n- `vec2`, `vec3`, `vec4`, `mat3` \u0026 `mat4` constructors\n\n- Fix bug where `#'` would get confused in the presence of local \u0026 external functions\n\n#### 2017-05-16\n\n- Tesselation \u0026 Geometry stages are now fully supported (for real this time :D)\n\n- Very basic mutual recursion checks.\n\n- Fix bug where inlining and indirect recursion could cause compiler to infinite loop\n\n- Make use of `{}` braces consistent in emitted glsl\n\n- Add `continue`\n\n- Add `/=`\n\n- Add `with-slots` \u0026 `with-accessors`\n\n- Add `multiple-value-call`\n\n- strings containing floats will be spliced into the emitted glsl unchanged (very useful when float used for bits \u0026 you dont want the risk of lisp rounding something)\n\n- strings containing integers will be turned integer literals (only here for completeness with above code) doesnt not yet detect signed'ness of int.\n\n- make the value argument to `incf`, `decf` etc optional (defaulting to 1)\n\n- Better errors when can't find function match\n\n- Don't allow `funcall` on special operators. Give better error message\n\n- Fix bad glsl emitted for tail-calls to functions returning multiple values\n\n- Fix `funcall` so it handles multiple values correctly (dumb mistake :p)\n\n- Add the stage name (as a comment) to the generated glsl.\n\n- Large amount of refactoring how types are stored/propegated\n\n- `v-defun` renamed to `v-def-glsl-template-fun`, `v-defun` will be used for functions with lisp code.\n","funding_links":[],"categories":["Common Lisp","Miscellaneous ##"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbaggers%2Fvarjo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbaggers%2Fvarjo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbaggers%2Fvarjo/lists"}