This project is part of the "Effective programming with Effect" course at the University of Tuebingen. The aim of this project was to implement a simple raytracer based on Ray Tracing in One Weekend in the Effekt programming language.
"src/main.effekt" contains the scene, camera & rendering parameters that can be customized. The program will render an image based on the parameters and produce an image at "out.ppm".
"src/demo.effekt" contains some examples on how this project works. It is recommended to start a repl using effekt --backend llvm, import the demo file with import src/demo and then run one of the demo functions demo1() etc. which will produce an image corresponding to their name in the project root.
Only requires the Effekt language https://effekt-lang.org/docs to be installed with at least one working backend. LLVM is recommended.
Run the main file:
effekt src/main.effektThis (like many other Effekt commands) uses the JavaScript backend by default.
To use a different backend, add the --backend <backend> flag.
The LLVM backend --backend llvm is recommended for speed, but all backends that support writing files should be supported.
Only LLVM and JavaScript have been tested.
Run the tests:
effekt src/test.effektOpen the REPL:
effektBuild the project:
effekt --build src/main.effektThis builds the project into the out/ directory, creating a runnable file out/main.
To see all available options and backends, run:
effekt --helpWhile Nix installation is optional, it provides several benefits:
Update dependencies (also runs automatically in CI):
nix flake updateOpen a shell with all necessary dependencies:
nix developRun the main entry point:
nix runBuild the project (output in result/bin/):
nix build- see the
effekt-communityGitHub organization - This very project!
.github/workflows/*.yml: Contains the CI definitionssrc/: Contains the source codemain.effekt: Main entry pointtest.effekt: Entry point for testsdemo.effekt: Contains demo renderslib/: Library code imported bymainandtest
flake.nix: Package configuration in a Nix flakeflake.lock: Auto-generated lockfile for dependenciesLICENSE: Project licenseREADME: This README file
Two GitHub Actions are set up:
-
flake-check:- Checks the
flake.nixfile, builds and tests the project - Runs on demand, on
main, and on PRs - To run custom commands, add a step using:
nix run -- <ARGS>to run the main entry point with the given argumentsnix develop -c '<bash command to run>'to run commands in the correct environment
- Checks the
-
update-flake-lock:- Updates package versions in
flake.nix - Runs on demand and weekly (Tuesdays at 00:00 UTC)
- Updates package versions in




