[[bad mustMatch:]]: error while compiling to wasm
kinke
noone at nowhere.com
Sat Jul 7 18:01:46 UTC 2018
On Saturday, 7 July 2018 at 07:55:59 UTC, Hüseyin Akbaş wrote:
> Hi I was trying to build wasm code via ldc and binaryen. I saw
> how to do it in a c++ tutorial.
>
> My source code is:
>
> import std.stdio;
>
> extern(C) int main()
> {
> writeln("Edit source/app.d to start your project.");
> return 0;
> }
>
>
> I compile with the following:
> ldc2 app.d -output-s
> s2wasm app.s > app.wast
LDC will soon be able to compile & link some trivial D code
directly to WebAssembly, without any external tools. Don't expect
a seamingly simple `writeln()` to work soon though [you don't
even have access to the console in WebAssembly and must interop
with a JavaScript function to do so AFAIK].
See
https://github.com/ldc-developers/ldc/pull/2766#issuecomment-403222908 for how to get started.
More information about the digitalmars-d-ldc
mailing list