Ray Tracing in J

17 points by veqq


Moonchild

I should also mention, it is fast. I’ve written a very similar ray tracer in Common Lisp (which I won’t claim to be any good at, but certainly have at least as much experience in) and without optimizing anything in either implementation J is performing around 5 times as fast. While it isn’t very fair to CL or indicative of what can be done in the language it does seem telling that a fast solution is more apparent in J, at least to this novice.

unfortunately, i think it is not really telling of very much. skimming both of them, the author got a bit unlucky in his j solution, and then really quite unlucky in his common lisp solution. the predominating implementations of both j and common lisp have very fragile and unintuitive performance characteristics if you do not know what you are doing. there are simple, fairly mechanical transformations that could be undertaken on both implementations to get significant integer factor speedups, which i can easily see because i do know what i am doing, but those implementations should do them automatically