raianmr / raytracing

Implementations of a simple ray tracer in all the languages I'm at least half-decent in.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ray Tracing

This repo is meant to host implementations of the simple ray tracer from RTOW in all the languages that I'm at least half-decent in. A ray tracer is a perfect candidate for language anthologies IMO for a couple of reasons,

  1. Most similar endeavors that I've come across are done with simple algorithms that rarely span multiple files. This flattens out the differences between some languages e.g., C and C++.
  2. The ray tracer from RTOW is especially fun in that you get to play with all kinds of polymorphism to your heart's content. I can't remember the last time I saw a generic implementation of FizzBuzz that makes justified use of operator overloading.
  3. I try to follow the idioms and conventions specific to the languages to the best of my ability. I think a ray tracer written this way is a decent way to benchmark languages, as opposed to making 1:1 copies of some original code snippet and ultimately just measuring the performance of runtimes.
  4. I just really, really like these books. The first one was the most fun I've ever had with any programming book, period.

None of the implementations are complete, and I haven't actually gone through all the books yet. But I hope to get done with 5+ languages by the end of 2023.

Line-up

  1. C++ (g++)
  2. Python (CPython)
  3. Go (gc)
  4. TypeScript (Deno)
  5. C# (.NET Core)
  6. A single docker-compose.yml to build, run, and benchmark all versions.
  7. Output in SVG instead of PPM for ease of sharing and viewing?
  8. Rust? (rustc)
  9. Clojure? (JVM)
  10. Haskell? (GHC)

About

Implementations of a simple ray tracer in all the languages I'm at least half-decent in.

License:GNU General Public License v3.0