I posted this at Sitepoint, but thought I'd post it here as well to get a better survey.
Ok, I know Javascript compressors aren't rare, but they either only strip unneeded characters resulting in very low compression ratios (around 1.3:1), the javascript "crunchers" as many call themselves, or they crunch the script and perform some kind of regex based ASCII encoding to push the ratio to around 2.3:1 - 2.5:1. And while that ratio is a good ratio for text compression, both of these methods tend to be a little brittle because if all the new lines are stripped, then javascript that isn't strict about terminating statements with semi-colons will stop working. There are some crunchers that won't strip all new lines, but just blank new lines, but this results in even poorer ratios than the more brittle crunchers.
So I thought to myself, why can't there be a lossless javascript compressor? And so I set out a couple days ago to make one, testing and trying various proven compression algorithms.
And that's just what I've done. It uses an LZ77 variant algorithm with a quick decompression technique (since pure javascript has to decompress it). I've tested numerous javascript scripts, and only when the uncompressed file is huge (over 300K) do you notice a performance hit when decompressing the script.
I've got a few compression levels. The first is 100% lossless; all data is left in tact. And, what I think is the best part, this level results in a compression ratio that is competitive with the existing compressors that use brittle crunching + regex encoding, about 2.5:1 on average. Plus I've made a few lossy levels, one that does non-brittle crunching and then lossless compression on the result of that, giving about a 2.9:1 ratio, and then a higher lossy level that performs brittle crunching + lossless compression on the result, which yields about 3.2:1 or better.
Ok so to the point of this post. I'm willing to put it online free for use if people are interested in it. I can't find another lossless javascript compressor in existence, so I think this would be a pretty unique and useful tool [unless you count HTTP Gzip, but not everyone has that enabled on their server, and even if they do, not all have it enabled for JS files (I guess there can be some kind of problem with JS and HTTP Gzip?)]. But that does require some work (making the site, cleaning up the code, more testing of code, etc), so I'd thought I'd ask on here to get an idea if people would be interested in this kind of thing.
So, anyone interested?