Interactive backend playground

These Elm functions were compiled ahead of time to both JavaScript and WebAssembly. Pick one and an input — it runs in both compiled backends right here, with timings.

fib n = if n < 2 then n else fib (n - 1) + fib (n - 2)
factorial n = if n < 1 then 1 else n * factorial (n - 1)
sumTo n = if n == 0 then 0 else n + sumTo (n - 1)
triple n = n * 3
BackendResultTime
JavaScript
WebAssembly