Programming Languages Comparison pt.1
I have always wondered what programming language would be better suited for hobby and/or regular development. As the time passed, I jumped from language to language in order to find the one that would better fit my needs, but never really did a comparison between them. This is an attempt to do just that.
For me, the ideal programming language must be:
- Expressive. Fewer lines of code means faster prototyping.
- Have decent speed. I am not looking to use the language with the fastest running time, unless it is also the most expressive one.
- Compiles fast. It's not fun waiting for programs to be ready to run.
In order to measure these attributes, I'll implement several instances of a basic ray tracer (actually a path tracer), using different languages, following some simple guidelines:
- Code should be simple, as in, easy to read and understand.
- A single file per implementation, whenever possible.
- Intersection finding algorithms must be the same in all implementations.
- Brute force, no acceleration structures.
- If the language allows vectorization, parallel or distributed processing, those must be used in different implementations, i.e. crb (C single threaded), cmprb (C using OpenMP).
- Code must follow best practices in formating and structure, according to the language in use.
- Will only render spheres.
- Output image must be in PPM format.
A C language implementation will be used as baseline. This implementation should take around 2 minutes to render a 3D scene on a Basic A1 Microsoft Azure VM instance. That means 1 Core, 1.75 GB RAM, Ubuntu Server 14.04 LTS.
You can follow the development on the project repo.