Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is so cool!

I'm completely new to WASM but excited to learn — how did you use the Squoosh repo to turn it into WASM, and how did you embed that into your app? Is that just a static file you can "import" and use in the client?

And can anything be "turned into" WASM (e.g. a python library), or is that kind of a new paradigm of writing code from scratch?



https://github.com/pyodide/pyodide

> Any pure Python package with a wheel available on PyPi is supported. Many packages with C extensions have also been ported for use with Pyodide. These include many general-purpose packages such as regex, PyYAML, lxml and scientific Python packages including NumPy, pandas, SciPy, Matplotlib, and scikit-learn.


Squoosh already had wasm files built, all i had to just import and create a common API.

For now wasm can be compiled from C,C++, Rust and Go, so mostly compiled languages. https://emscripten.org/ can help compile C,C++, Rust and Go has native support to compile. There is also a Typescript like language which compile to wasm(assembly script)

Python or most dynamic languages are too difficult to compile to wasm.


You could consider publishing it on GitHub and pinging squoosh guys: https://github.com/GoogleChromeLabs/squoosh/issues/1084


Its probably not practical to use python because I imagine you'd need to include the whole python interpreter or somesuch.

WASM is a compilation target for AOT compiled code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: