>rewriting this in a functional language lets you ensure immutability of state and that lets you reason about the program and prove it's correctness in a logical and mathematically sound way
It always cracks me up when limp-wristed javascript webdev cunts try to LARP as mathmaticians.
Why do programmers have such delusions of grandeur? Especially the CS grads.
You're writing bottom of the barrel garbage CRUD code that glues other people's libraries together, stop pretending you're a mathmatician.