Main.html:1 Uncaught (in promise) TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
ahc-cabal. It's a wrapper to
cabal-install, so you should just do
ahc-cabal new-build, etc, and use 3rd party libraries just like a regular cabal package. It's possible to use
new-install --installdir .to create a symlink of the pseudo-executable, and then later use
ahc-distto extract the wasm/mjs artifacts from the pseudo-executable. I haven't written this in the documentation yet, will do later.
ahc-cabal. The "pure haskell" packages should just work fine, like
lens, but there also exist packages which compile but won't work at the moment due to cbits (like
cryptonite). Good timing to give it another try :)
https://www.tweag.io/wasm-todomvc/todomvc.wasmis only 81.3 KB, but when I compile it with
ahc-link .. --browser --bundle-> its 2.1 MB? what am I doing differently?
binaryenbackend and performs shrinking, so you may get smaller wasm binary again
diagramsin your browser!
ahc-cabaland then run
ahc-diston it. I tried disabling optimizations and shrinking but I still get a
StackOverflowexception even though I believe I shouldn't be getting it.
ahc-linkunder the hood so I'll just try aliasing it for now.
--verbose-err. it gives me the same exception as before.
res_cis a really large number and the issue can be solved by changing
BigInt(offset), but I do not know if
res_cshould be such a large number.
RuntimeErrornow which is being thrown here: https://github.com/tweag/asterius/blob/master/asterius/rts/rts.gc.mjs#L882 because the switch statement doesn't handle indirection with the case
this.memory.i64Load(c + rtsConstants.offset_StgInd_indirectee)then it's