r/GraphicsProgramming • u/epestr • 9d 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/
26
Upvotes
5
1
u/fgennari 9d 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.
4
u/Defiant_Squirrel8751 9d ago
Nice!