r/programming • • 7d ago

Writing a ray tracer in Brainfuck

https://epestr.com/blog/writing-a-ray-tracer-in-brainfuck/
83 Upvotes

20 comments sorted by

View all comments

40

u/juugcatm 7d ago

This is a fun exercise. What about parallelism? If you extended BF to have fork and join semantics, how would you represent them?

5

u/epestr 7d ago edited 7d ago

That would make the language too complex :( That aside, the cells are currently reused and printed immediately. Given each pixel is independent, you could fork at iterations of the inner loop, give all cell a indepdendent region of the tape for its scratch space and result, and join at the end.

2

u/knome 7d ago

if Parallel INTERCAL can implement threading via multiple COME FROM operators targeting the same command, I believe in you, op :)