Not sure about the weird lisp he uses to generate the data but it’s a nice explanation of how to generate heightmaps.
http://stevelosh.com/blog/2016/02/midpoint-displacement/