Reimplementing the bulk of std.meta iteratively

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


On Tuesday, 29 September 2020 at 12:02:21 UTC, Patrick Schluter 
wrote:
> Sorry to not be completely convinced on the pertinence of that 
> statement. For the language designer it might well be true, for 
> the users of the language I'm not completely sold. There are 
> two languages that imho fit that description very well, they 
> are both very powerfull and extremely elegant, but boy do they 
> suck when you just want to get shit done: Lisp and Forth.

Most research languages try to fit the description, but they 
rarely reach production. But in essence you are right. The key 
problem isn't functional, but syntactical. When I wrote in Beta I 
could do everything as easily as in most imperative languages, 
but everything looked the same. So you end up looking a landscape 
of pebbles in various colours, but that makes the landscape less 
visible. Compare that to landscape with roads, lakes and 
mountains.

Template programming suffers from the same problem. You can 
create fancy semantics, but the syntax becomes very hard on the 
user. It leads to less legible code as code that represent 
different concepts don't stand out.

You can say the same about some C code bases.

So template programming is fun, but it will suck until there is a 
language that finds a good way to provide syntax extensions.

> Your AA example is a good one. If it wasn't in the language, it 
> would be the same issue with AA as in any other language that 
> defines it in libraries: several different incompatible 
> restricted implementations.

There are at least two ways to generalize AA, you can either have 
a language mechanism for serialization or mandate that all types 
provide a hash function and identity comparison (equality). I 
don't see how having a compiler built in is qualitatively 
different from having a standard library implementation in the 
general case.



More information about the Digitalmars-d mailing list