Developing a Space Flight Simulator in Clojure

https://news.ycombinator.com/rss Hits: 18
Summary

Developing a Space Flight Simulator in Clojure 05 Sep 2025 In 2017 I discovered the free of charge Orbiter 2016 space flight simulator which was proprietary at the time and it inspired me to develop a space flight simulator myself. I prototyped some rigid body physics in C and later in GNU Guile and also prototyped loading and rendering of Wavefront OBJ files. I used GNU Guile (a Scheme implementation) because it has a good native interface and of course it has hygienic macros. Eventually I got interested in Clojure because unlike GNU Guile it has multi-methods as well as fast hash maps and vectors. I finally decided to develop the game for real in Clojure. I have been developing a space flight simulator in Clojure for almost 5 years now. While using Clojure I have come to appreciate the immutable values and safe parallelism using atoms, agents, and refs. In the beginning I decided to work on the hard parts first, which for me were 3D rendering of a planet, an atmosphere, shadows, and volumetric clouds. I read the OpenGL Superbible to get an understanding on what functionality OpenGL provides. When Orbiter was eventually open sourced and released unter MIT license here, I inspected the source code and discovered that about 90% of the code is graphics-related. So starting with the graphics problems was not a bad decision. Software dependencies The following software is used for development. The software libraries run on both GNU/Linux and Microsoft Windows. Clojure the programming language LWJGL provides Java wrappers for various libraries lwjgl-opengl for 3D graphics lwjgl-glfw for windowing and input devices lwjgl-nuklear for graphical user interfaces lwjgl-stb for image I/O and using truetype fonts lwjgl-assimp to load glTF 3D models with animation data Jolt Physics to simulate wheeled vehicles and collisions with meshes Fastmath for fast matrix and vector math as well as spline interpolation Comb for templating shader code Instaparse to parse NASA Planetary Const...

First seen: 2025-09-06 02:20

Last seen: 2025-09-06 19:27