A WebAssembly compiler that fits in a tweet
wasmgroundup.com
wasmgroundup.com
I say normally because one could also have a superoptimizer search for a minimal program that achieves some desired behaviour, and then one has to understand it by slowly unraveling the generated code.
But cool stuff anyways
Can you make programs with it smaller than assembly language? Sure.
Will you come out the other side a mad hatter speaking of things such as words, dictionaries, and washing machine firmware? Well, I can only speak for myself...
:-D
It's a shame the article mostly teaches about codegolf tricks, and the actual wasm info is left to a single commented code block.
Nonetheless an interesting article about JavaScript quirks though!
I ended up converting the RPN style notation into a JavaScript string and creating a new function, which lets the JIT sort it out.
https://c50.fingswotidun.com/show/?code=xy!2*!2y!*6%2Bo2%2Fv...
which has the code
xy!2*!2y!*6+o2/vy#!*:Cy#*+z#d!;*:ze!xy*4s*43/*e+*+
becomes ((round(z) * ((v * (1 - round(y))) + (clamp((( ((x*(2**((2 * (1 - y)) + 6))) ^ ((1 - ((1 - y) * 2))*(2**((2 * (1 - y)) + 6)))) /(2**((2 * (1 - y)) + 6))) / 2)) * round(y)))) + ((1 - round(z)) * ((1 - smoothStep(z)) + smoothStep((((x * y) * sin(4)) * (4 / 3))))))
It would be interesting to see the performance difference from a wasm version, but in the end I found the human(ish) readable expression to be quite useful too.Originally I created an interpreter for a code as a texture maker for code golfed javascripted games. https://github.com/Lerc/stackie
There's potential for a WASM implementation to be both smaller than the small version and Faster than the fast version.
[1] https://github.com/marianoguerra/ricardo-forth
[2] https://github.com/marianoguerra/ricardo-forth/blob/master/s...
[3] https://www.ioccc.org/1992/buzzard.2/
[4] https://github.com/marianoguerra/ricardo-forth/blob/master/s...
The GSM-7 alphabet is the most common one in use with SMS (or, at least, it was as UCS-2 is more common now with emojis and such).
160 is the number of GSM-7 characters.
160*7/8 = 140 which is the number of bytes in the userdata portion of the TPDU.
This is cool though, i love these programs that exist in these constraints, like Dwitter does with the demoscene.