Thanks! Great question, the port is quite primitive. It was mostly manual work of copying each function and manually massaging it to JavaScript. TypeScript did a lot of heavy lifting alerting me to various issues and allowed safe refactors.
From there it was adding additional glue code to ensure it worked in the web context and canvas rendering.
I know other people have had success compiling the source to WebAssembly with pretty good success, but it's harder to customise in the ways that I wanted.
From there it was adding additional glue code to ensure it worked in the web context and canvas rendering.