Cosmos creates thousands of random planets and lets real Newtonian gravity do the rest. Every planet attracts every other planet; planets that touch merge, conserving mass and momentum. A dense core collapses into a star within seconds, most of the planets collide during the first minutes, and the survivors settle into a flat, stable solar system on nearly circular orbits.
All physics runs on the GPU: the N² force pass, collision detection, merging and integration are WebGL2 fragment shaders working on float textures. It is a single HTML file with no dependencies.
Source code and documentation on GitHub
Cosmos is an interactive WebGL2 simulation and needs JavaScript. See the project page on GitHub.