Hacker News new | ask | show | jobs
by hsfzxjy 662 days ago
wasm has SIMD extension https://github.com/WebAssembly/simd/blob/master/proposals/si... . You can use them even in browsers (e.g. Chrome >= 91)
1 comments

OP is asking how SIMD is beneficial to this specific application. If there's a small neural network involved then evaluating that is probably a good place to use SIMD.
Yes. The program actually includes an ONNX runtime, which uses SIMD to accelerate NN inference.
but... the program ends up entirely compiled and executed as TTF bytecode in the end right, since it's entirely contained in the TTF font ? And TTF bytecode is only the following instructions : https://developer.apple.com/fonts/TrueType-Reference-Manual/... and I don't see anything related to SIMD in there
No that is not what is happening, HarfBuzz have a experimental Wasm shaper, so the font embeds some wasm code that tells Harfbuzz what to output.

https://github.com/harfbuzz/harfbuzz/blob/main/docs/wasm-sha...

oh ok, so it can't work in any system that doesn't use harfbuzz.. that's much less interesting than what I originally thought