In terms of web languages, Elm is perfect for this purpose. It's a statically typed, pure functional programming language. It's impossible for functions to generate side effects. Side effects must captured by the type system as external "Commands". Also, the type system is inspired by Haskell but far more basic. To hardcore functional programmers this is a negative, but Elm is really easy to teach to JavaScript programmers as a result.