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!
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!
Nice 👍
👍
That 2.5k stub handwritten in .wat 😅
Very cool!
wtf
Ahh it's context modeling based on Squishy, very very nice contribution. Would try this later
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.
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.
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.
@^ML!^: I'm fairly sure people would find that very suitable for 4k intros :)
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.
Nice!
Also sounds like a dutch MicroW8 thingy for easter to me...? ;)
Also sounds like a dutch MicroW8 thingy for easter to me...? ;)
hfr: That would be inaccurate, I'm afraid :)
very nice!
can this work together, with other wasm stuff, like sointu ?
Quote:
can also be used for JS-only productions
can this work together, with other wasm stuff, like sointu ?
