I started experimenting with emscripten (https://github.com/kripken/emscripten) lately. It compiled c++ code to js so you can run it in a browser. This evening, I tried getting newton to compile and run with it. I had to patch the code at a few places - primarily I defined the _LINUX_VER in the preprocessor and removed all too hardware close calls. I also had to modify a few things with the threads since js is basicly singlethreaded (except for webworkers). But all in all just minor changes.
I tried the simple example from here http://newtondynamics.com/wiki/index.php5?title=Super_simple_quick-start_with_48_lines_of_C_example and it works. Here is the result:
http://www.transmogrifier.de/emscripten/newtontest.html
It's a very simple demo. I'm looking forward to see if more complicated things work as well. Theoretically they should, but there are some things a bit different to native hardware. For example all floats become doubles as js has no 32 bit floats. Also js doesn't know 64bit ints. I'm not sure what emscripten does with them. I red that there are two options: simulate with 32 bit ints - which is "slow" - or use doubles and loose a few bits. Also the floating point control registers code in newton probably gets ignored. So maybe strange things could happen with precision making it unstable?