Ray Tracing Through Functional Programming Language Using OCaml with Comparative Performance Analysis
This paper explores the theory and implementation of ray tracing in OCaml. We discuss the mathematical concepts and algorithms that drive the rendering process, followed by implementation using OCaml’s functional programming paradigm. Our analysis compares the merits and challenges of functional versus object-oriented (OO) approaches, highlighting the advantages of code clarity, static type safety, and ease of debugging in a functional style. With the development of functional programming module, it has been established that the debugging cost is higher in object oriented module. In this context the functional module can identify the errors at the time of compilation and we establish this fact with the development of code using OCaml. We also address performance considerations related to recursive function calls and state management complexities. Ultimately, we advocate for implementing a basic ray tracer in a functional style, demonstrating that this approach enhances code quality while aligning with the principles of immutability and strong typing.
Authors
- Babul P. Tewari (ORCID: https://orcid.org/0000-0002-6289-3401)
- Poulomi Mukherjee (ORCID: https://orcid.org/0000-0002-9379-5628)
- Aditya Raj
Institutions
- National Institute of Technology Durgapur (IN)
- Poultry Research Institute (CN)
Publication Details
- Published
- 2025-07-18
- DOI
- https://doi.org/10.1109/ciacon65473.2025.11189694
- Primary Topic
- Augmented Reality Applications
- Type
- article
- Field-Weighted Citation Impact
- 0.00