LDC to WASM failed?

KnightMare black80 at bk.ru
Sat May 11 16:44:20 UTC 2019


I tried to compile the program as written in the article
https://wiki.dlang.org/Generating_WebAssembly_with_LDC
first sample add (not callback).

compilation is ok, I've got wasm.wasm that looks in binary like 
this
https://pastebin.com/JBr7V6if

but browser console says:
request sent wasm.html:20:7
response received wasm.html:8:9
instantiated wasm.html:12:11
TypeError: exports.add is not a function[Learn More] 
wasm.html:15:21

well, in binary representation wasm.wasm I dont see any text 
"add" (IMO method name should exists in any case when JS wants 
call it)

my current LDC version is 1.16.0.beta1

2nd question:
I understand that I cant import anything from Phobos yet, isnt it?
does LDC will give some wasm runtime in future?


More information about the digitalmars-d-ldc mailing list