D WebAssembly working differently than C++, Zig

Allen Garvey allen.garvey at gmail.com
Mon May 16 17:32:20 UTC 2022


I'm working on a comparison of WebAssembly performance for error 
propagation dithering using D, C++ and Zig. So far C++ and Zig 
work as expected, but for D, despite using the same algorithm and 
similar code the output is different.

You can see the differences here 
https://wasm-error-propagation-dither-comparison.netlify.app/ by 
opening an image.

Code
* D 
https://github.com/allen-garvey/wasm-error-propagation-dither-comparison/blob/master/wasm/d/main.d
* C++ 
https://github.com/allen-garvey/wasm-error-propagation-dither-comparison/blob/master/wasm/cpp/main.cpp
* Zig 
https://github.com/allen-garvey/wasm-error-propagation-dither-comparison/blob/master/wasm/zig/main.zig

Any help would be appreciated. From my extensive debugging it 
seems that calculating the pixel lightness is working correctly, 
it has something to do with either saving or retrieving the 
stored error in the float arrays.


More information about the Digitalmars-d-learn mailing list