Possible duplicate: Tiny javascript implementation?
I have searched around for a C implementation of Javascript, but I couldn't find one. I need this for an ultra-portable application that will run on platforms without a C++ compiler.
Here are my requirements:
I don't care about speed, but correctness is an issue. I would prefer for it to support ECMAScript-262 v5, but v3 is good enough for now.
Does something like this exist? If not, are there any implementations that would be relatively simple to port?
DMDScript is the simplest that I've found, so I may end up porting that. Apparently there is no reference implementation, so this may be the best way to go.
Note:
I also found tiny-js, which is meant to be small and simple, but it doesn't seem to be standards compliant. It is actively developed it seems...
Spidermonkey 1.8.0 RC1 and the previous releases are in C. You can use that.
They introduced C++ in their latest release as of 11 Feb 2013 in 1.8.5 release
The SpiderMonkey wiki claims it is C/C++, however, from looking at the source package, it seems to be pure C actually.
The official download link is http://ftp.mozilla.org/pub/mozilla.org/js/js-1.8.0-rc1.tar.gz
If that doesn't turn out to be pure C, try the older versions. Their FTP (http://ftp.mozilla.org/pub/mozilla.org/js/) currently hosts spidermonkey 1.8.5 down to 1.4, and Rhino 1.7 down to 1.4.
The documentation for Spidermonkey API seems good as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With