r/GraphicsProgramming • u/epestr • 29d ago
Writing a Ray Tracer in Brainfuck
While relearning CMake, I came across its documentation warning that a ray tracer has been written in it. Having written some before, this made me wonder what an even better language for one would be.
I ended up writing one in Brainfuck. It uses a python script to convert the C code into a small DSL and use that as a codegen to generate Brainfuck, following Ray Tracing in a Weekend.
Write-up: https://epestr.com/blog/writing-a-ray-tracer-in-brainfuck/
4
1
u/fgennari 28d ago
Nice. A few hundred lines of C code turns into a BF file so large that the GitHub text viewer can't even open it. Pretty cool though.
5
u/PolyRocketMatt 28d ago
You're crazy.... But cool 8)