Re: Building a wasm library, need to override .object._d_newitemT!T

2023-12-24 Thread Etienne via Digitalmars-d-learn

On Sunday, 24 December 2023 at 10:50:41 UTC, Johan wrote:
_d_newitemT!T is fairly new, what compiler version are you 
using?


-Johan


Nevermind, I managed to get it working but I had to compile 
without including druntime and phobos and move everything into 
the library. I'm using ldc 1.36.0-beta1


Re: Building a wasm library, need to override .object._d_newitemT!T

2023-12-24 Thread Johan via Digitalmars-d-learn
On Saturday, 23 December 2023 at 20:42:37 UTC, Etienne Cimon 
wrote:


I'm having a problem implementing the `new` keyword, so that I 
can start importing more libraries with minimal change. 
However, LDC calls .object._d_newitemT!T from the original 
druntime - which I need for compile-time function execution, 
but my implementation in `module object` doesn't override it in 
the compiler and the original implementation tries import 
core.stdc.time which errors out in wasm (with good reasons). Is 
there a compiler flag than I can use to override module 
templates?


_d_newitemT!T is fairly new, what compiler version are you using?

-Johan


Building a wasm library, need to override .object._d_newitemT!T

2023-12-23 Thread Etienne Cimon via Digitalmars-d-learn

Hello,

I've been developing a library[1] based on spasm for which I've 
implemented the druntime and currently it compiles web apps 
properly with TypeInfo, no GC, and it even uses diet templates.


I'm having a problem implementing the `new` keyword, so that I 
can start importing more libraries with minimal change. However, 
LDC calls .object._d_newitemT!T from the original druntime - 
which I need for compile-time function execution, but my 
implementation in `module object` doesn't override it in the 
compiler and the original implementation tries import 
core.stdc.time which errors out in wasm (with good reasons). Is 
there a compiler flag than I can use to override module templates?


Thanks in advance.

[1] https://github.com/etcimon/libwasm