I am currently doing some experiments with the embeddable Wasm runtime Chasm. My goal is to be able to run some Java code compiled to Wasm via TeaVM (or some other transpiler) on it. I tried a few trivial examples like
Copy code
import org.teavm.jso.JSExport;
public class j_fibonacci {
@JSExport
public static int fibonacci(int n) {
int a = 0;
int b = 1;
int tmp;
for (int i = 2; i <= n; ++i) {
tmp = a + b;
a = b;
b = tmp;
}
return b;
}
}
but failed completely. Has anybody else tried that with more success? I tried the same with a corresponding C version of the above example compiled via Emscripten and that worked without problems. A Rust version also works.
c
Charlie Tapping
01/28/2025, 10:23 AM
Hi Michael, feel free to submit a bug with the generated wasm file attached and I’ll take a look when I get a chance. Also if you could state the error you get back that would also help