roc
roc copied to clipboard
Implement dec_alloca for Wasi
This function needs to be implemented for wasi. https://github.com/roc-lang/roc/blob/11ecfe0bc6b225b5f40d8cee9790eec139eb720c/crates/compiler/gen_llvm/src/llvm/lowlevel.rs#L2111 The implementation may be the same as for Unix.
Commented on the "new contributors" convo about this, gonna try and fix this issue
for context, what sort of program hits this todo!()
?
@folkertdev A roc-wasm4 program with a Dec on the model. I just ended up using F32 instead.
do you think you can make a failing test case? I'm not sure how we don't hit this in the test suite. We do run that with llvm-wasm
so it should touch a lot of the surrounding code.
Yeah, I will take a look later and try to make a repro
@folkertdev Here's a repro
Running
roc build --target wasm32 --no-link
with
app "repro"
packages {
pf: "https://github.com/roc-lang/basic-cli/releases/download/0.7.0/bkGby8jb0tmZYsy2hg1E_B2QrCgcSTxdUlHtETwm5m4.tar.br",
}
imports [
pf.Task,
]
provides [main] to pf
main =
foo = 10dec + 1
Task.ok {}
yields
thread 'main' panicked at 'not implemented', crates/compiler/gen_llvm/src/llvm/lowlevel.rs:1992:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Sorry for the delay on this, lots of random personal life stuff.
Currently using the array of 2 64s like unix causes a parameter mismatch issue in the LLVM IR code. I think Wasi actually uses two distinct 64 bit numbers and not an array, although looking into if under the hood there is really a difference.