pouët.net

Go to bottom

Mashi - A compressor for JS/WASM 64k intros

category: code [glöplog]
 
Hi friends, I just released the first version of Mashi, which is a compressor for JS/WASM 64k intros. It is based on the core compression routines of Squishy by Ferris/Logicoma, which I'm sure most of you are familiar with.

It is intended as a replacement for Compeko or JsExe or any other kind of tool that relies on the browser's built-in Deflate implementation. I built it primarily for use for compression of WASM (with a tiny amount of JS needed for browser interop) and for that reason it adds a full WASM context model that really improves compression of those kinds of binaries. The decompressor is hand-written in WASM so if you're interested to see what hell looks like, check out "decompress.wat" in the repo linked below.

However, intros that are pure JS can also benefit, although in my unscientific testing the results varied. 0b5vr's 0mix intro went from 64k to 48k, but Luminosity by Bypass was almost unchanged. So YMMV.

Anyway, feel free to test it out. Binaries are available at https://github.com/datatrash/mashi/releases and the source code is at https://github.com/datatrash/mashi

It's all a bit untested (especially under Linux and on non-Chrome-based browsers), but I thought that with Revision coming our way it could already be of use to someone.

Btw, pull requests that reduce final binary size are of course very welcome :)

And a big shout out to Ferris for allowing me to use Squishy as a basis for this, obviously!
added on the 2026-02-14 12:38:35 by sagacity sagacity
Nice 👍
added on the 2026-02-14 12:53:34 by neoman neoman
👍
added on the 2026-02-15 11:55:46 by rc55 rc55
That 2.5k stub handwritten in .wat 😅
added on the 2026-02-15 12:27:07 by pestis pestis
Very cool!
added on the 2026-02-16 16:59:45 by tomkh tomkh
wtf
added on the 2026-02-16 17:05:48 by 0b5vr 0b5vr
Ahh it's context modeling based on Squishy, very very nice contribution. Would try this later
added on the 2026-02-16 17:08:13 by 0b5vr 0b5vr
Yes, to be clear, WASM compression has a lot of extra logic to improve compression. JS doesn't, but it should still be nice improvement over just Deflate.
added on the 2026-02-16 19:07:43 by sagacity sagacity
BB Image
added on the 2026-02-16 22:32:21 by wullon wullon
Wow, the handdone WASM based depacker is super impressive.

Reading the context modelling code for Squishy was super instructive. My code for my packer is just bog standard LZMA1, with a super tiny (500 bytes) x86/x64 depacker. Should port to ARM/68k/WASM.
added on the 2026-02-17 19:33:59 by ^ML!^ ^ML!^
@^ML!^: I'm fairly sure people would find that very suitable for 4k intros :)
added on the 2026-02-17 20:01:58 by sagacity sagacity
Quote:
@^ML!^: I'm fairly sure people would find that very suitable for 4k intros :)


I wonder how hard it would be to modify crinkler to allow for the depacker. That seems to be the goto standard for Windows compressing linkers these days.

Or even do a custom packer ala 1kpack, but specifically made for GL4.6 (bindless could help there). Linux is interesting in that there is solutions out there for that.
added on the 2026-02-17 20:41:16 by ^ML!^ ^ML!^
Nice!
Also sounds like a dutch MicroW8 thingy for easter to me...? ;)
added on the 2026-02-17 23:56:07 by hfr hfr
hfr: That would be inaccurate, I'm afraid :)
added on the 2026-02-18 14:22:03 by sagacity sagacity
very nice!

Quote:
can also be used for JS-only productions


can this work together, with other wasm stuff, like sointu ?
added on the 2026-02-20 18:44:34 by pandur pandur

login

Go to top