https://gist.github.com/rookie/3d9a848c6fefacc4254da921da79b...
It now runs faster (when compiled, optimized) than the python code.
xcrun -sdk macosx swiftc -O gen.swift