Being reading a lot about betterC, but still have some questions
kiboshimo
matheusmvpeixoto at gmail.com
Tue Jul 9 09:27:30 UTC 2024
Thank you for the comprehensive responses
On 09/07/2024 8:43 PM, Richard (Rikki) Andrew Cattermole wrote:
> Atomics are provided by the compiler in the form of intrinsics.
>
> If you do not do this, they cannot be inlined as you're forced
> to use inline assembly.
>
> LDC and GDC like GCC and clang have an intrinsic based
> implementation for ``core.atomics``. DMD is the only D compiler
> that uses inline assembly currently.
>
> It is all templated so yes it is accessible within a -betterC
> codebase.
That is good to know. I should expect this kind of feature to be
present, after all betterC must be a working subset of D. But, I
wasn't sure enough.
Based on the responses I'm assuming my example of atomic is a
special case, but I shouldn't worry about low level things like
threads to be absent all the same.
That's betterC targeting native. What about WASM? Does LDC ->
WASM pipeline supports functionality one needs in a C-level
language? If not, aside from atomics, one should be able to use C
libraries to supplant any other purpose, right? Since C has
mature support for WASM.
More information about the Digitalmars-d-learn
mailing list