Reimplementing the bulk of std.meta iteratively

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Sep 29 10:03:12 UTC 2020


On Tuesday, 29 September 2020 at 09:07:39 UTC, claptrap wrote:
> How do you decide what is an essential language primitive? Or 
> what is necessary syntactic sugar? I mean syntactic sugar 
> almost by definition isnt necessary, it's just window dressing.

The for loop and the while loop is syntactic sugar in C-like 
languages.
So clearly syntactic sugar is more than window dressing.

The usual way to define a minimal imperative language is to have 
concepts like "block" and "restart block" (covers  both looping 
and continue) and conditionals.

You can essentially do away with most concepts until you have 
just have a closure with coroutine capabilities + one conditional 
instruction. Two such tiny imperative languages are Self and 
Beta. So you basically merge the concept of a block and an object 
as well.. A constructor/destructor pair is just a single 
coroutine that has suspended.

However the minimal core language tend to be an on-paper 
construct for non-research languages. Theoretical. The compiler 
will most certainly have many more concepts than the minimal 
language to get better compilation times.



More information about the Digitalmars-d mailing list