Spasm - webassembly libary for single page applications

Sebastiaan Koppe mail at skoppe.eu
Tue Aug 6 20:20:13 UTC 2019


On Tuesday, 6 August 2019 at 19:02:09 UTC, a11e99z wrote:
> hi. can not compile for Windows
> LDC ver 1.16.0.

Currently ldc 1.16.0 isn't supported. You can downgrade to ldc 
1.15.0

>> spasm 0.1.13: target for configuration "library" is up to date.
>> test_spasm ~master: building configuration "application"...
>> Error: unrecognized file extension lib               <<<<<<<<
>>  ??????
>> ldc2 failed with exit code 1.

Have you tried the github issues? I remember dukc having the same 
issue on windows as well.

> and I have some questions:
> - spasm contains some GC-allocator. can I use "hello" ~ 
> 123.to!string or something? or I can use string literals only 
> without some kind of string builder?

No you cannot use the concat operator (~). Neither can you use 
new, class, AA or dynamic arrays among others. This is because 
Spasm uses betterC, and a lot of D features aren't available in 
betterC. I am working on a PR for druntime to at least compile to 
wasm without betterC. This will open the way to incrementally 
support more and more D features.

In the meantime you need to get familiar with the betterC 
constraints. You can always look in the examples for workable 
code. Make sure to use the 0.1.13 tag, since master has some new 
unreleased stuff (which I hope to release in the coming month).

There is a string builder in spasm as well as a betterC version 
of the phobos `text` function.

The GC allocator is still unreleased and experimental.


More information about the Digitalmars-d-announce mailing list