You can try OCamlScript in the brower, edit the code on the left panel and see the generated JS on the right panel instantly.
Users of OCamlScript can write type-safe, high performance OCaml code, and deploy the generated JavaScript in any platform with a JavaScript execution engine.
view source