Open jiayihu opened 4 years ago
Thanks for the heads up, I'll take a look at this when I can. I can agree that the C-source of wasm3 is very difficult to read as it looks very opinionated style-wise with the massive amount of macro magic going on. I hope wasmi will do you well 👍
Thanks! Also additional note: although wasm3 supports d_m3HasFloat
to disable float operations, it's a all-or-nothing flag. In my case, the STM32F4 board has FPU support but only for single-precision operations. Disabling floating point operations would severely limit the runnable WASM modules, while enabling the flag would probably result in runtime error for f64
types I guess.
@jiayihu i think we could add a flag to treat all f64 types as f32 (loosing precision), at some point.
Regarding the changing signatute. @Veykril with the latest wasm3, you should be able to use just the public API (only wasm3.h
). Let me know if you struggle to implement some functionality via the new API.
With #21 one can pass the propert clang flags in order to set the compilation flags in https://github.com/wasm3/wasm3/blob/master/source/m3_config.h, for instance:
Currently passing
-Dd_m3HasFloat=0
results in this error because the wasm3 signature changes:Passing
d_m3FixedHeap
, such as-Dd_m3FixedHeap=(8 * 1024)
, also results in compilation error because the(8 * 1024)
syntax is not supported by #21 .I just wanted to report the issues and causes for anyone interested. After being finally able to compile everything, I realized while I was implementing the intrinsics for
calloc, free, realloc
(required ifd_m3FixedHeap
is unset) that I was not very satisfied with the wasm3 implementation itself. Its C code is very hard to read and extend IMO. I'm ditching in favor of https://github.com/paritytech/wasmi or writing a WASM runtime myself.