CTFE and Wasm

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Sat Apr 30 09:04:34 UTC 2022


On Saturday, 30 April 2022 at 08:51:26 UTC, Dukc wrote:
> On Saturday, 30 April 2022 at 07:08:48 UTC, Ola Fosheim Grøstad 
> wrote:
>> I understand why both D and C++ users make a fuzz about CTFE, 
>> it gives them a feeling of being able to extend the type 
>> system or language in a way they are used to. However they are 
>> still at wn disadvantage to more powerful languages that allow 
>> construction of new types at runtime and do CTFE as an 
>> optimization.
>
> No, we're not at a disadvantage. If CTFE was just an 
> optimisation, it'd mean we could not use it to compute values 
> that have to be compile-time by definition.

A language that allows everything to happen at runtime has no 
such hardcoded requirement. It has the advantage of fast 
compilation of debug builds and being able to debug those using 
the same debugging straregy as regular code.

That is an advatage, obviously?

> You can still execute the CTFE-able functions at runtime when 
> these are what you prefer.

What I am talking about is deceloping and debugging larger 
applications without limiting metaprogramming.

You can debug individual CTFE functions at runtime in your unit 
tests, but you cannot "probe" suspected failure points in the 
bulid of a full application. Big difference!





More information about the Digitalmars-d mailing list