
Challenge: Put all of Shakespeare's works into the smallest HTML file you can - tbodt
https://github.com/xem/miniBook
======
userbinator
I'm guessing whoever manages to implement a subset of
[https://en.wikipedia.org/wiki/PAQ](https://en.wikipedia.org/wiki/PAQ) in JS
is probably going to win.

Of course, the decompressor itself also needs to be compressed, which I
suspect will be where most of the competition will happen.

~~~
scrumper
> I'm guessing whoever manages to implement a subset of
> [https://en.wikipedia.org/wiki/PAQ](https://en.wikipedia.org/wiki/PAQ) in JS
> is probably going to win.

I'm not so sure; PAQ is pretty slow and the challenge has a 30m time limit.
Check out the 1GB text compression benchmark in the wiki - it's orders of
magnitude slower than the next best algorithm for a 5% improvement, and the
benchmark case is basically the same as this challenge.

Edit: I mean, it took 17 hours.

~~~
userbinator
According to
[http://prize.hutter1.net/#history](http://prize.hutter1.net/#history) the
current winner (which has stood since 2009) took 9h on a _2GHz P4_ to
decompress its input to 100MB, or roughly 3082 bytes/s.

30 minutes to decompress 5324821B is only slightly less, at 2958 bytes/s. This
"on a modern computer", certainly not one from 15 years ago, even after
factoring in JS overhead, sounds doable, if not easy. Have CPUs gotten more
than an order of magnitude faster since then? Probably (but perhaps not for
the type of code that would be encountered in a decompressor --- the biggest
boost has been for vector operations, which are neither particularly suitable
for high compression algorithms nor easily usable from JS.) Is JS overhead
less than 10x native code? Probably for some cases too.

In fact, I just tried paq8hp12 on the file and it compressed it to 1059027
bytes in 208 seconds on a moderately old system (i7 870). Decompression took
the same time.

~~~
xem
1059027 bytes for the Shakespeare file? that's impressive. I tried something
called "PAQ*" compression but it generated a file that was nearly 2MB...

------
xem
Hi! I created that challenge but didn't see this HN page until now :) That's
where all this traffic comes from! If you think 30 min is too short for
decompression, I can change that rule. Just let me know.

------
newman8r
another good challenge would to be trying to display them in the most
interesting way possible in under x bytes, demoscene style. But I suppose
that's a different audience.

~~~
xem
please develop, I'm actually interested by this kind of challenges too! :)
What's your idea? like, asking people to output as much text as they can in
512kb or 1mb?

------
dunkmaster
Easy 0 byte compressed solution: just put the entire output in the
decompressor and print it. This doesn't seem to be against the stated rules.

~~~
Shoop
Just put all of the text in the file names.

~~~
xem
You can't read neighbour files' names with JS, can you?

~~~
tbodt
you can if the server is configured to list directories O_o

