December 11, 2019
On Wednesday, 11 December 2019 at 07:46:23 UTC, Jani Hur wrote:
> Is D's WebAssembly support usable in Screeps (https://screeps.com/) ?
>
> I just yesterday run into Screeps so I have no experience about it but the following caught my eye:
>
> "Use JavaScript or compile other languages via WebAssembly."
>
> See https://docs.screeps.com/modules.html#Binary-modules about the Screeps' WASM support. As I know nothing about Screeps and WebAssembly that tells me nothing at the moment :(

Of course. Follow the 'Building WebAssembly' section on https://wiki.dlang.org/Generating_WebAssembly_with_LDC to compile a wasm file, then call that using the instructions on the https://docs.screeps.com/modules.html#Binary-modules page. Just skip the part about emscripten since you already have a wasm file.

The only caveat is that it is betterC. But that should change soon.
December 11, 2019
On Wednesday, 11 December 2019 at 07:46:23 UTC, Jani Hur wrote:
> Is D's WebAssembly support usable in Screeps (https://screeps.com/) ?
>
> I just yesterday run into Screeps so I have no experience about it but the following caught my eye:
>
> "Use JavaScript or compile other languages via WebAssembly."

Yes it is. Interfacing will be real hard, but it can be done if you somehow enjoy spending a large chunk of your freetime on that.
December 11, 2019
On Wednesday, 11 December 2019 at 08:40:13 UTC, Dukc wrote:
> On Wednesday, 11 December 2019 at 07:46:23 UTC, Jani Hur wrote:
>> Is D's WebAssembly support usable in Screeps (https://screeps.com/) ?
>>
>> I just yesterday run into Screeps so I have no experience about it but the following caught my eye:
>>
>> "Use JavaScript or compile other languages via WebAssembly."
>
> Yes it is. Interfacing will be real hard, but it can be done if you somehow enjoy spending a large chunk of your freetime on that.

Interfacing is indeed the hardest part. The bindings in spasm can help you with calling webapi's (although you will need a custom entry for Screeps, but it is just JS). I have started a typescript binding generator that can wrap typescript libraries, but that isn't fully completed yet.

Hopefully the webassembly interface types proposal will stabilise next year, as this will ease calling other languages and dealing with strings/structs/arrays.
1 2
Next ›   Last »