So why would you use JSCaml at all? Two reasons come to mind:
That said, JSCaml is still incomplete and more work is needed before realistic programs can routinely be compiled and expected to just run without problems. So, unless you are interested to work on the compiler and its runtime, hang on for a bit and check back later.
After cloning the JSCaml repository you also need to get hold of the submodules:
git submodule init git submodule update --recursive --init
Next, copy the relevant Webkit files to the runtime/regexp subdirectory and patch them to make them self contained.
cd regexp ./copy-patch-and-build.sh cd ..
First set up your environment as instructed in Flow repository, making sure that you can build and test Flow.
To build JSCaml use the buildcompiler.sh script in the compiler directory. It copies some files over into the flow sub directory, runs its make, copies the resulting extended flow binary back into the JSCaml bin directory and removes the copied files.
To build the runtime run the build.sh script in the runtime directory. This creates a bunch of files in the runtime/build and runtime/cobj directories, most of which are later required to be referenced by the ocamlopt call that compiles the translated (into OCaml) JS files together with the builtin object model binaries into a single executable.
It would be nice the JSCaml runtime could be packaged into a single file and if there were a simple way for ocamlopt get everything from the unified file, but this seems to be impossible. If you know how to do this, or can make it possible somehow, please help.
In the early development of JSCaml modified versions of these tests have been actually been run and about 5000 of them pass, so there is hope.
In this repository, right now, there is a single "smoke alarm" test. To compile this test run the build.sh script. (This will actually compile all of the JS files in the directory.)
To run the test file, just run the .out/test binary.
JSCaml is BSD-licensed. We also provide an additional patent grant.